Skip to content

Migrate flake8, isort, black rules to ruff#49

Merged
weiji14 merged 5 commits intomainfrom
flake8-to-ruff
Jun 25, 2024
Merged

Migrate flake8, isort, black rules to ruff#49
weiji14 merged 5 commits intomainfrom
flake8-to-ruff

Conversation

@weiji14
Copy link
Member

@weiji14 weiji14 commented Jun 25, 2024

Translating the previous flake8 rules in setup.cfg to ruff rules in pyproject.toml. Original rules were set in #15.

The following ruff lint rules are set:

  • B - flake8-bugbear
  • C4 -flake8-comprehensions
  • C90 - mccabe
  • E - pycodestyle
  • F - pyflakes
  • I - isort
  • SIM - flake8-simplify
  • W - pycodestyle warnings

Notes:

  • Did not keep any of the ignored rules (E203,E266,E501,W503,E722,E402,C901,E731) since none of them were triggered
  • Dropped the deprecated flake8-mypy (T4) rule.

References:

Part of effort at #47 to remove the setup.cfg file.

weiji14 added 2 commits June 25, 2024 14:11
Translating the previous flake8 rules in setup.cfg to ruff rules in pyproject.toml. Did not keep any of the ignored rules since none of them were triggered. Dropped the deprecated flake8-mypy (T4) rule.
@weiji14 weiji14 marked this pull request as ready for review June 25, 2024 02:21
@weiji14 weiji14 requested a review from andersy005 June 25, 2024 02:22
@dcherian
Copy link
Contributor

i would replace isort and black too while you're at it.

My current fave is

https://github.com/earth-mover/forecast-datacube-demo/blob/7ce8082aa6e4e02ffd5ac2fe124e0f3c689be477/pyproject.toml#L4-L15
https://github.com/earth-mover/forecast-datacube-demo/blob/main/.pre-commit-config.yaml

@weiji14 weiji14 changed the title Migrate flake8 rules to ruff Migrate flake8, isort, black rules to ruff Jun 25, 2024
@weiji14
Copy link
Member Author

weiji14 commented Jun 25, 2024

Cool, thanks for the tips @dcherian. There's a few more linter stuff we can move to ruff, but that can wait. I'll merge this in now and combine it into #48.

@weiji14 weiji14 merged commit 7fc3df5 into main Jun 25, 2024
@weiji14 weiji14 deleted the flake8-to-ruff branch June 25, 2024 02:59
weiji14 added a commit that referenced this pull request Jun 25, 2024
Not needed after #49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments