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

Make linting more rigorous. #359

Merged
merged 20 commits into from
Nov 1, 2023
Merged

Make linting more rigorous. #359

merged 20 commits into from
Nov 1, 2023

Conversation

mbkumar
Copy link
Collaborator

@mbkumar mbkumar commented Oct 5, 2023

I'd like to expand the linting rule list to catch more issues. At the same time, I'd like to update the linting framework to the one based on ruff. In place of pep8 and flake8 tools, we will use ruff.

To use ruff, run pip install ruff followed by ./run_ruff.
The configuration for ruff is done in pyproject.toml. The linter workflow is updated to use ruff. If you are satisfied, I can commit the fixes by ruff and do one more push with all the changes to the source code.

@mbkumar mbkumar requested a review from landreman October 5, 2023 17:24
@codecov
Copy link

codecov bot commented Oct 5, 2023

Codecov Report

Attention: 9 lines in your changes are missing coverage. Please review.

Comparison is base (317b846) 91.38% compared to head (42b50ac) 91.40%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #359      +/-   ##
==========================================
+ Coverage   91.38%   91.40%   +0.01%     
==========================================
  Files          72       72              
  Lines       12700    12659      -41     
==========================================
- Hits        11606    11571      -35     
+ Misses       1094     1088       -6     
Flag Coverage Δ
unittests 91.40% <74.28%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
src/simsopt/_core/optimizable.py 90.34% <ø> (-0.02%) ⬇️
src/simsopt/field/coil.py 95.93% <100.00%> (ø)
src/simsopt/field/magneticfield.py 99.25% <ø> (-0.02%) ⬇️
src/simsopt/field/magneticfieldclasses.py 97.33% <100.00%> (-0.03%) ⬇️
src/simsopt/field/mgrid.py 93.00% <ø> (-0.05%) ⬇️
src/simsopt/field/tracing.py 96.38% <ø> (-0.05%) ⬇️
src/simsopt/geo/curve.py 95.07% <ø> (-0.06%) ⬇️
src/simsopt/geo/curveperturbed.py 98.80% <100.00%> (ø)
src/simsopt/geo/curverzfourier.py 100.00% <ø> (ø)
src/simsopt/geo/permanent_magnet_grid.py 95.60% <100.00%> (ø)
... and 16 more

... and 1 file with indirect coverage changes

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

landreman
landreman previously approved these changes Oct 24, 2023
@mbkumar
Copy link
Collaborator Author

mbkumar commented Oct 27, 2023

@landreman
I pushed the changes where linter fixes related to unused imports and a few other minor things are applied. I have more in the pipeline, but they need more careful analysis before getting committed. So I want to get these out of the way.

@mbkumar mbkumar requested a review from landreman October 27, 2023 18:45
@mbkumar
Copy link
Collaborator Author

mbkumar commented Oct 31, 2023

@landreman
Ready for final review.

@mbkumar mbkumar merged commit b1986cf into master Nov 1, 2023
41 of 47 checks passed
@mbkumar mbkumar deleted the ruff branch November 1, 2023 12:58
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