Skip to content

Switch to using ruff, re: python project template#140

Merged
glass-ships merged 7 commits intonextfrom
ruff
Feb 17, 2025
Merged

Switch to using ruff, re: python project template#140
glass-ships merged 7 commits intonextfrom
ruff

Conversation

@glass-ships
Copy link
Member

@glass-ships glass-ships commented Jan 27, 2025

Quick PR to convert to using Ruff, to be consistent with https://github.com/neutrons/python_project_template

Note that the standard list of included rules found 113 errors that would require a not insignificant change of multiple variable names, function arguments, etc. that may break current functionality.

The specific rules were instead added to ruff's ignore list for now - the necessary changes can be made downstream in a separate PR if we decide that's necessary.

@glass-ships glass-ships requested a review from jmborr January 27, 2025 16:48
@codecov-commenter
Copy link

codecov-commenter commented Jan 27, 2025

Codecov Report

Attention: Patch coverage is 75.31447% with 157 lines in your changes missing coverage. Please review.

Project coverage is 63.76%. Comparing base (56b727f) to head (3a93542).

Files with missing lines Patch % Lines
RefRed/config/baseconfig.py 41.02% 23 Missing ⚠️
RefRed/plot/mouse_leave_plot.py 5.26% 18 Missing ⚠️
.../autopopulatemaintable/reductiontable_auto_fill.py 47.61% 11 Missing ⚠️
RefRed/gui_handling/data_norm_spinboxes.py 58.82% 7 Missing ⚠️
RefRed/plot/log_plot_toggle.py 12.50% 7 Missing ⚠️
RefRed/decorators.py 50.00% 6 Missing ⚠️
...calculator/compare_two_nxsdata_for_sfcalculator.py 0.00% 6 Missing ⚠️
RefRed/gui_handling/gui_utility.py 61.53% 5 Missing ⚠️
RefRed/plot/home_plot_button_clicked.py 0.00% 5 Missing ⚠️
RefRed/reduction/calculate_sf_overlap_range.py 28.57% 5 Missing ⚠️
... and 30 more
Additional details and impacted files
@@            Coverage Diff             @@
##             next     #140      +/-   ##
==========================================
- Coverage   63.78%   63.76%   -0.03%     
==========================================
  Files         118      118              
  Lines        9882     9876       -6     
==========================================
- Hits         6303     6297       -6     
  Misses       3579     3579              

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

Copy link
Member

@jmborr jmborr left a comment

Choose a reason for hiding this comment

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

There's Ruff messing with the the standard / third-party / RefRed partition of imports.
Also, I'd switch back to single-quotes. In pyproject.toml:

[tool.ruff.format]
quote-style = "single"

@glass-ships
Copy link
Member Author

Also, I'd switch back to single-quotes. In pyproject.toml:

[tool.ruff.format]
quote-style = "single"

Is there a particular reason for this preference? I chose double here to be consistent with all other neutrons projects and the python project template

@glass-ships glass-ships merged commit d5c6d85 into next Feb 17, 2025
3 checks passed
@glass-ships glass-ships deleted the ruff branch February 17, 2025 16:11
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