forked from huggingface/trl
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pre-commit: replace linters + formatters with Ruff; fix some issues (h…
…uggingface#1300) * pre-commit: replace linters + formatters with Ruff * Don't use bare except * Clean up `noqa`s * Enable Ruff UP; apply auto-fixes * Enable Ruff B; apply fixes * Enable Ruff T with exceptions * Enable Ruff C (complexity); autofix * Upgrade Ruff to 0.2.0
- Loading branch information
Showing
30 changed files
with
113 additions
and
149 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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 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 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 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 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 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 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 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,16 +1,22 @@ | ||
[tool.black] | ||
line-length = 119 | ||
target-version = ['py38'] | ||
|
||
[tool.ruff] | ||
ignore = ["E501", "E741", "W605"] | ||
select = ["E", "F", "I", "W"] | ||
target-version = "py37" | ||
line-length = 119 | ||
|
||
# Ignore import violations in all `__init__.py` files. | ||
[tool.ruff.per-file-ignores] | ||
"__init__.py" = ["E402", "F401", "F403", "F811"] | ||
[tool.ruff.lint] | ||
ignore = [ | ||
"B028", # warning without explicit stacklevel | ||
"C408", # dict() calls (stylistic) | ||
"C901", # function complexity | ||
"E501", | ||
] | ||
extend-select = ["E", "F", "I", "W", "UP", "B", "T", "C"] | ||
|
||
[tool.ruff.lint.per-file-ignores] | ||
# Allow prints in auxiliary scripts | ||
"benchmark/**.py" = ["T201"] | ||
"examples/**.py" = ["T201"] | ||
"scripts/**.py" = ["T201"] | ||
|
||
[tool.ruff.isort] | ||
[tool.ruff.lint.isort] | ||
lines-after-imports = 2 | ||
known-first-party = ["trl"] |
This file contains 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 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 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 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,11 +1,2 @@ | ||
[metadata] | ||
license_file = LICENSE | ||
|
||
[isort] | ||
ensure_newline_before_comments = True | ||
force_grid_wrap = 0 | ||
include_trailing_comma = True | ||
line_length = 119 | ||
lines_after_imports = 2 | ||
multi_line_output = 3 | ||
use_parentheses = True |
This file contains 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
Oops, something went wrong.