Skip to content

Commit fa7cc51

Browse files
chore(ci): replace flake8 with Ruff as a linter (#2495)
1 parent 1b9459e commit fa7cc51

File tree

6 files changed

+387
-527
lines changed

6 files changed

+387
-527
lines changed

.pre-commit-config.yaml

+3-10
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,9 @@ repos:
1717
entry: poetry run black
1818
language: system
1919
types: [python]
20-
- id: isort
21-
name: formatting::isort
22-
entry: poetry run isort
23-
language: system
24-
types: [python]
25-
- repo: local
26-
hooks:
27-
- id: flake8
28-
name: linting::flake8
29-
entry: poetry run flake8
20+
- id: ruff
21+
name: linting-format::ruff
22+
entry: poetry run ruff
3023
language: system
3124
types: [python]
3225
- repo: https://github.com/igorshubovych/markdownlint-cli

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ You might find useful to run both the documentation website and the API referenc
7676
| Category | Convention |
7777
| --------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
7878
| **Docstring** | We use a slight variation of Numpy convention with markdown to help generate more readable API references. |
79-
| **Style guide** | We use black as well as flake8 extensions to enforce beyond good practices [PEP8](https://pep8.org/). We use type annotations and enforce static type checking at CI (mypy). |
79+
| **Style guide** | We use black as well as [Ruff](https://beta.ruff.rs/docs/) to enforce beyond good practices [PEP8](https://pep8.org/). We use type annotations and enforce static type checking at CI (mypy). |
8080
| **Core utilities** | Core utilities use a Class, always accept `service` as a constructor parameter, can work in isolation, and are also available in other languages implementation. |
8181
| **Utilities** | Utilities are not as strict as core and focus on solving a developer experience problem while following the project [Tenets](https://docs.powertools.aws.dev/lambda/python/#tenets). |
8282
| **Exceptions** | Specific exceptions live within utilities themselves and use `Error` suffix e.g. `MetricUnitError`. |

Makefile

+1-2
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,10 @@ dev-gitpod:
1717
pre-commit install
1818

1919
format:
20-
poetry run isort aws_lambda_powertools tests examples
2120
poetry run black aws_lambda_powertools tests examples
2221

2322
lint: format
24-
poetry run flake8 aws_lambda_powertools tests examples
23+
poetry run ruff aws_lambda_powertools tests examples
2524

2625
lint-docs:
2726
docker run -v ${PWD}:/markdown 06kellyjac/markdownlint-cli "docs"

0 commit comments

Comments
 (0)