-
Notifications
You must be signed in to change notification settings - Fork 44
Use ruff formatter and pre-commit #2524
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
Merged
Merged
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
c742deb
Replace yapf and isort by ruff, drop docformatter
bouweandela 1ded8c1
Apply formatting
bouweandela dc55690
Replace flake8 by ruff and move to pre-commit.ci
bouweandela fec33a1
Add yamllint configuration
bouweandela d39fc88
Disable pycodestyle rules that conflict with ruff and fix some issuesβ¦
bouweandela a4c9423
Disable conflicting pycodestyle vs ruff settings also in prospector cβ¦
bouweandela cc9e50d
Try renaming pycodestyle to pep8
bouweandela ebda3b9
Another attempt
bouweandela 2edc268
And another one
bouweandela 0c3f2ae
Update docs
bouweandela 2f94086
Fix link
bouweandela d2de728
Merge branch 'main' of github.com:ESMValGroup/ESMValCore into ruff-foβ¦
bouweandela f048a81
Replace flake8 by pre-commit linting in GitHub Actions
bouweandela 901439d
Test this branch
bouweandela fe3ff7b
Add Python 3.10 codespell pre-commit hook dependency
bouweandela 7d8d20e
Revert "Test this branch"
bouweandela 93cfe33
Remove pre-commit run from conda-lock files GitHub Actions
bouweandela 60c802f
Merge branch 'main' of github.com:ESMValGroup/ESMValCore into ruff-foβ¦
bouweandela 652e8ff
Ruff formatting
bouweandela 7b0f8cd
Add links with explanations why certain rules are ignored
bouweandela abd97a1
Pin pandas
bouweandela 1507502
Another try
bouweandela b2ae94e
Merge branch 'main' of github.com:ESMValGroup/ESMValCore into ruff-foβ¦
bouweandela 21b1a1e
Reformat
bouweandela 9208d58
Merge branch 'tmp' into ruff-format
bouweandela File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,4 +27,3 @@ indent_size = 2 | |
|
|
||
| [*.{md,Rmd}] | ||
| trim_trailing_whitespace = false | ||
|
|
||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1 @@ | ||
| esmvalcore/cmor @jvegasbsc | ||
| .github/workflows @valeriupredoi | ||
|
|
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,16 +10,21 @@ test-warnings: true | |
| member-warnings: false | ||
|
|
||
| pyroma: | ||
| run: true | ||
| run: true | ||
|
|
||
| pep8: | ||
| full: true | ||
| full: true | ||
| # ignore rules that conflict with ruff formatter | ||
| # E203: https://black.readthedocs.io/en/stable/the_black_code_style/current_style.html#slices | ||
| # E501: https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules | ||
| # W503: https://pycodestyle.pycqa.org/en/latest/intro.html#error-codes | ||
| disable: ['E203', 'E501', 'W503'] | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there some kind of reference that you could add as a comment here?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done in 7b0f8cd |
||
|
|
||
| mypy: | ||
| run: true | ||
|
|
||
| pep257: | ||
| # disable rules that are allowed by the numpy convention | ||
| # see https://github.com/PyCQA/pydocstyle/blob/master/src/pydocstyle/violations.py | ||
| # and http://pydocstyle.readthedocs.io/en/latest/error_codes.html | ||
| disable: ['D107', 'D203', 'D212', 'D213', 'D402', 'D413', 'D416'] | ||
| # disable rules that are allowed by the numpy convention | ||
| # see https://github.com/PyCQA/pydocstyle/blob/master/src/pydocstyle/violations.py | ||
| # and http://pydocstyle.readthedocs.io/en/latest/error_codes.html | ||
| disable: ['D107', 'D203', 'D212', 'D213', 'D402', 'D413', 'D416'] | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| --- | ||
|
|
||
| extends: default | ||
|
|
||
| rules: | ||
| line-length: | ||
| level: warning | ||
| max: 120 | ||
bouweandela marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| octal-values: enable | ||
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| Dataset | ||
| ======= | ||
| ======== | ||
|
|
||
| .. automodule:: esmvalcore.dataset | ||
| :no-show-inheritance: |
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,4 +8,3 @@ The recipe format | |
|
|
||
| Overview <overview> | ||
| Preprocessor <preprocessor> | ||
|
|
||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.