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

Add RUF (ruff specific rules) to linting rules #8695

Merged
merged 1 commit into from
Sep 16, 2024

Conversation

larsevj
Copy link
Contributor

@larsevj larsevj commented Sep 13, 2024

See https://docs.astral.sh/ruff/rules/#ruff-specific-rules-ruf

  • PR title captures the intent of the changes, and is fitting for release notes.
  • Added appropriate release note label
  • Commit history is consistent and clean, in line with the contribution guidelines.
  • Make sure tests pass locally (after every commit!)

When applicable

  • When there are user facing changes: Updated documentation
  • New behavior or changes to existing untested code: Ensured that unit tests are added (See Ground Rules).
  • Large PR: Prepare changes in small commits for more convenient review
  • Bug fix: Add regression test for the bug
  • Bug fix: Create Backport PR to latest release

@@ -99,15 +99,15 @@ class IESSettings(BaseSettings):
] = "subspace_exact"
ies_max_steplength: Annotated[
float,
Field(ge=0.1, le=1.0, title="GaussNewton maximum steplength"),
Field(ge=0.1, le=1.0, title="Gauss-Newton maximum steplength"),
Copy link
Contributor

Choose a reason for hiding this comment

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

Changing en-dashes to simple dashes? en-dash is the correct way of concatenating scientists names like this (says a LaTeX-fanboy)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed it.
Was mainly interested in adding the rule RUF100 to remove unused noqa, but thought it couldnt hurt to add all RUF rules. One issue is the fact that we have enabled preview rules, which causes some issues and increases the number of rules by a lot.

@codecov-commenter
Copy link

codecov-commenter commented Sep 13, 2024

Codecov Report

Attention: Patch coverage is 87.93103% with 7 lines in your changes missing coverage. Please review.

Project coverage is 91.44%. Comparing base (d69bbe3) to head (2ad7010).

Files with missing lines Patch % Lines
src/ert/storage/local_experiment.py 0.00% 3 Missing ⚠️
src/ert/dark_storage/enkf.py 0.00% 1 Missing ⚠️
src/ert/data/_measured_data.py 0.00% 1 Missing ⚠️
src/ert/gui/model/snapshot.py 0.00% 1 Missing ⚠️
src/ert/libres_facade.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8695      +/-   ##
==========================================
- Coverage   91.45%   91.44%   -0.02%     
==========================================
  Files         343      343              
  Lines       21292    21293       +1     
==========================================
- Hits        19473    19471       -2     
- Misses       1819     1822       +3     
Flag Coverage Δ
cli-tests 38.77% <51.72%> (+0.01%) ⬆️
gui-tests 72.35% <74.13%> (+0.02%) ⬆️
performance-tests 49.26% <58.62%> (+<0.01%) ⬆️
unit-tests 80.08% <74.13%> (-0.02%) ⬇️

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

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

@larsevj larsevj marked this pull request as ready for review September 16, 2024 11:36
Copy link
Contributor

@berland berland left a comment

Choose a reason for hiding this comment

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

Looks good, remember to squash.

@larsevj larsevj force-pushed the extend_ruff_rules branch 3 times, most recently from 2363b11 to 6358dd2 Compare September 16, 2024 17:42
@larsevj larsevj added the release-notes:skip If there should be no mention of this in release notes label Sep 16, 2024
@larsevj larsevj merged commit 092a861 into equinor:main Sep 16, 2024
35 checks passed
@larsevj larsevj deleted the extend_ruff_rules branch September 16, 2024 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-notes:skip If there should be no mention of this in release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants