Adopt inital noop ruff linter#5623
Merged
tkknight merged 3 commits intoSciTools:mainfrom Dec 11, 2023
Merged
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5623 +/- ##
=======================================
Coverage 89.69% 89.69%
=======================================
Files 90 90
Lines 22807 22807
Branches 5441 5441
=======================================
Hits 20456 20456
Misses 1618 1618
Partials 733 733 ☔ View full report in Codecov by Sentry. |
136c5b3 to
f0d3dc8
Compare
f0d3dc8 to
78e1a21
Compare
tkknight
added a commit
to tkknight/iris
that referenced
this pull request
Dec 13, 2023
* main: Adopt inital noop ruff linter (SciTools#5623) Update links to https (SciTools#5621) Bump actions/stale from 8 to 9 (SciTools#5616) Faster and simpler iris.util.array_equal (SciTools#5610) Updated environment lockfiles (SciTools#5608) Bump actions/setup-python from 4 to 5 (SciTools#5614) Possible citation updates -- not clear whether appropriate. (SciTools#5453) Whats new updates for v3.7.0 . (SciTools#5451)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🚀 Pull Request
Description
This pull-request adds the configuration for a no-op
rufflinter i.e., therufflinter runs but all rules are ignored, hence there are no compliance exceptions raised.Note that, it adds the
pre-commithook to ensure thatruff(and it's configured rules) are applied for developers usingpre-commitand on pull-requests via thepre-commit.ciservice.Also note that
ALLlinter rules have been selected in thepyproject.toml, and each of the currently existing 58rufflinter rules (see here) have been ignored in the.ruff.tomlconfiguration file, which extends theruffconfiguration defined in thepyproject.toml.As a strategy going forwards, I'd recommend that we:
pyproject.toml.ruff.tomlto collate all temporary rule and file exceptions, but aim to address these all over time.Ultimately, the goal would be to have no temporary exceptions in the
.ruff.tomlconfiguration file. Also, we should always aim to minimize our permanent (documented) exceptions.We can also slowly drop use of all the third-party packages that
ruffreplaces, namely:blackflake8isortTaking the above approach will allow us to adopt and become more compliant with
ruffover time, at our own pace.This strategy is open-ended, in that we have enabled
ALLlinter rules forruff(with explicitignores) so that we automatically adopt new non-previewlinter rules by default. If new rules are implemented withinruffthat break us, then either we address them straight away or add temporary/permanent exceptions as we deem fit.Consult Iris pull request check list