-
Notifications
You must be signed in to change notification settings - Fork 101
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1116 from ViniciusTxc3/dev-ruff
Dev migration from black to ruff
- Loading branch information
Showing
7 changed files
with
43 additions
and
21 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
repos: | ||
- repo: https://github.com/psf/black | ||
rev: 24.3.0 | ||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
# Ruff version. | ||
rev: v0.6.8 | ||
hooks: | ||
- id: black | ||
language_version: python3 | ||
# Run the linter. | ||
- id: ruff | ||
# Run the formatter. | ||
- id: ruff-format |
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
[tool.ruff.lint] | ||
# 1. Enable flake8-bugbear (`B`) rules, in addition to the defaults. | ||
select = ["B", "C", "E", "F", "Q", "W"] | ||
|
||
# 2. Avoid enforcing line-length violations (`E501`) | ||
ignore = [ | ||
"B006","B007", "B017", "B023", "B024", "B027", "B028", "B904", | ||
"C403", "C408", "C416", "C419", "C901", | ||
"E203", "E266", "E501", "E711", "E721", "E722", "E731", "E741", | ||
"F401", "F403", "F405", "F541", "F811", "F841", | ||
"W291", "W293", | ||
] | ||
|
||
# 3. Avoid trying to fix flake8-bugbear (`B`) violations. | ||
unfixable = ["B"] | ||
|
||
# 4. Ignore `E402` (import violations) in all `__init__.py` files, and in selected subdirectories. | ||
[tool.ruff.lint.per-file-ignores] | ||
"__init__.py" = ["E402"] | ||
"**/{tests}/*" = ["E402"] | ||
|
||
[tool.ruff.format] | ||
# 5. Use single quotes in `ruff format`. | ||
quote-style = "single" | ||
|
||
[tool.ruff.lint.flake8-quotes] | ||
docstring-quotes = "double" | ||
|
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