Skip to content

chore(ci): replace flake8 with Ruff as a linter #2495

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Jun 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 3 additions & 10 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,9 @@ repos:
entry: poetry run black
language: system
types: [python]
- id: isort
name: formatting::isort
entry: poetry run isort
language: system
types: [python]
- repo: local
hooks:
- id: flake8
name: linting::flake8
entry: poetry run flake8
- id: ruff
name: linting-format::ruff
entry: poetry run ruff
language: system
types: [python]
- repo: https://github.com/igorshubovych/markdownlint-cli
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ You might find useful to run both the documentation website and the API referenc
| Category | Convention |
| --------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Docstring** | We use a slight variation of Numpy convention with markdown to help generate more readable API references. |
| **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). |
| **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). |
| **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. |
| **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). |
| **Exceptions** | Specific exceptions live within utilities themselves and use `Error` suffix e.g. `MetricUnitError`. |
Expand Down
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,10 @@ dev-gitpod:
pre-commit install

format:
poetry run isort aws_lambda_powertools tests examples
poetry run black aws_lambda_powertools tests examples

lint: format
poetry run flake8 aws_lambda_powertools tests examples
poetry run ruff aws_lambda_powertools tests examples

lint-docs:
docker run -v ${PWD}:/markdown 06kellyjac/markdownlint-cli "docs"
Expand Down
Loading