This repository has been archived by the owner on Mar 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Use ruff as a linter as a replacement for flake8/isort #147
Merged
coretl
merged 1 commit into
DiamondLightSource:main
from
Tom-Willemsen:change_linter_to_ruff
Sep 15, 2023
Merged
Use ruff as a linter as a replacement for flake8/isort #147
coretl
merged 1 commit into
DiamondLightSource:main
from
Tom-Willemsen:change_linter_to_ruff
Sep 15, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Tom-Willemsen looks good. I'll try this out against the ibek project. @coretl I'm pretty sure we want to go with this - what do you think? |
coretl
reviewed
Sep 12, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks for doing this! Just a couple of questions...
Tom-Willemsen
force-pushed
the
change_linter_to_ruff
branch
from
September 12, 2023 15:54
33b144b
to
34391eb
Compare
Codecov Report
@@ Coverage Diff @@
## main #147 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 2 2
Lines 16 16
=========================================
Hits 16 16 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
coretl
reviewed
Sep 12, 2023
Tom-Willemsen
force-pushed
the
change_linter_to_ruff
branch
from
September 13, 2023 09:02
34391eb
to
31833a3
Compare
Tom-Willemsen
force-pushed
the
change_linter_to_ruff
branch
from
September 13, 2023 09:29
31833a3
to
199f346
Compare
coretl
approved these changes
Sep 13, 2023
This seems fine, shall I merge? |
If you're happy with it then yes please? Think I've addressed all the review comments that have been left. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Use
ruff
as a linter, as a replacement forflake8
&isort
.ruff
is much faster (Somewhere around 100x) than flake8+isort, and seems to be the direction which a lot of modern python projects are taking. It is pretty much 1:1 compatible with flake8 + isort, with very few exceptions.To test this:
python -m pip install -e .[dev]
or an equivalent command to getruff
installed.pre-commit
orruff .
, verify thatruff
runs successfully.py
file insrc
ortests
, verify thatruff
picks this upruff .
pre-commit
vscode
from this directory, verify that:ruff
can fix quite a lot of problems automatically but I found this somewhat surprising to run "on save", happy to hear other opinions about this?ruff
instead offlake8
orisort
.