-
Notifications
You must be signed in to change notification settings - Fork 102
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
Ruff #250
Ruff #250
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #250 +/- ##
==========================================
- Coverage 75.39% 75.31% -0.09%
==========================================
Files 55 55
Lines 4723 4707 -16
Branches 692 682 -10
==========================================
- Hits 3561 3545 -16
- Misses 975 982 +7
+ Partials 187 180 -7
|
This looks great, but could you fix the failing linting? |
Definitely. Just wanted to hear your feedback first. |
Awesome thank you. Ruff looks excellent! I'll have to switch to it on all my projects |
That's what I did. 😄 And certainly didn't regret it. The speed is incredible as is the number of linting rules it provides! |
- repo: https://github.com/pycqa/isort | ||
rev: 5.12.0 | ||
hooks: | ||
- id: isort | ||
- repo: https://github.com/pycqa/flake8 |
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.
We could prob replace flake8
here with ruff
too. I know ruff
implements these plugins since I was using those as well.
- pyproject-flake8==6.0.0
- flake8-bugbear==22.12.6
- flake8-typing-imports==1.14.0
- flake8-docstrings==1.6.0
But haven't checked these two yet:
- flake8-rst-docstrings==0.3.0
- flake8-rst==0.8.0
What should be E501s
|
So I think black has the behaviour that 88 is the ideal length but if it can't make the line any shorter then it's okay to go beyond that. I think there was an option in flake-bugbear to support this behaviour: PyCQA/flake8-bugbear#54 I'm not sure if that is also available in ruff? |
IIUC astral-sh/ruff#389 (comment) suggests just disabling E501. Charlie decided to not support B950 for now. |
I went ahead and fixed the existing E501s. All but one case were easily refactored to avoid long lines and the last one I added |
refactor caused raise FileNotFoundError(f"Could not find {base_name} or {base_name}.gz file.") FileNotFoundError: Could not find INCAR or INCAR.gz file.
Thanks! |
Closes #249.
Just to give an idea, this is what adding
ruff
linter would look like.