Skip to content
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

Replace black and flake8 with ruff #3424

Merged
merged 2 commits into from
Jan 8, 2025
Merged

Conversation

timothy-nunn
Copy link
Contributor

Update our codebase to use ruff as a formatter instead of black, and use ruff as a linter instead of flake8. The benefits of this change are:

  • Faster linting and formatting.
  • Unification of formatting and linting into one tool.
  • Ability to enable future rules (e.g. import sorting) without additional tools.
  • Parity with other open-source UKAEA codes like bluemira and PyVMCON.

The downsides could be merge conflicts in the short term.

@codecov-commenter
Copy link

codecov-commenter commented Dec 12, 2024

Codecov Report

Attention: Patch coverage is 20.72072% with 88 lines in your changes missing coverage. Please review.

Project coverage is 29.56%. Comparing base (7844aa2) to head (c74892d).

Files with missing lines Patch % Lines
process/build.py 0.00% 30 Missing ⚠️
process/sctfcoil.py 0.00% 10 Missing ⚠️
process/io/sankey_funcs.py 0.00% 7 Missing ⚠️
process/physics.py 50.00% 6 Missing ⚠️
process/power.py 0.00% 6 Missing ⚠️
process/pfcoil.py 0.00% 4 Missing ⚠️
process/io/configuration.py 0.00% 3 Missing ⚠️
process/io/plot_proc.py 0.00% 3 Missing ⚠️
process/geometry/blanket_geometry.py 0.00% 2 Missing ⚠️
process/geometry/firstwall_geometry.py 0.00% 2 Missing ⚠️
... and 10 more
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3424   +/-   ##
=======================================
  Coverage   29.56%   29.56%           
=======================================
  Files          78       78           
  Lines       19131    19131           
=======================================
  Hits         5656     5656           
  Misses      13475    13475           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@timothy-nunn
Copy link
Contributor Author

Rules that are not going to be implemented but will be papercuts:
NPY, SLF, BLE, B, A, DTZ, EXE, ICN, PIE, RET, PD, PERF, FURB

@timothy-nunn timothy-nunn force-pushed the ruff branch 3 times, most recently from 875e617 to de73c85 Compare January 8, 2025 15:03
@timothy-nunn timothy-nunn marked this pull request as ready for review January 8, 2025 15:04
Copy link
Collaborator

@chris-ashe chris-ashe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor spelling error

documentation/proc-pages/development/pre-commit.md Outdated Show resolved Hide resolved
Copy link
Collaborator

@chris-ashe chris-ashe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Happy with doc changes

@timothy-nunn timothy-nunn merged commit 661027a into ukaea:main Jan 8, 2025
9 checks passed
@timothy-nunn timothy-nunn deleted the ruff branch January 8, 2025 15:51
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.

3 participants