Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0b7f159

Browse files
committed
lint: replaceflake8 withruff check
1 parent49cb48a commit0b7f159

File tree

5 files changed

+44
-37
lines changed

5 files changed

+44
-37
lines changed

‎.flake8

Lines changed: 0 additions & 26 deletions
This file was deleted.

‎.pre-commit-config.yaml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,13 @@ repos:
1414
name:black (format)
1515
exclude:^git/ext/
1616

17-
-repo:https://github.com/PyCQA/flake8
18-
rev:6.1.0
17+
-repo:https://github.com/astral-sh/ruff-pre-commit
18+
rev:v0.3.0
1919
hooks:
20-
-id:flake8
21-
additional_dependencies:
22-
-flake8-bugbear==23.9.16
23-
-flake8-comprehensions==3.14.0
24-
-flake8-typing-imports==1.14.0
20+
#- id: ruff-format # todo: eventually replace Black with Ruff for consistency
21+
# args: ["--preview"]
22+
-id:ruff
23+
args:["--fix"]
2524
exclude:^doc|^git/ext/
2625

2726
-repo:https://github.com/shellcheck-py/shellcheck-py

‎README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ The same linting, and running tests on all the different supported Python versio
187187
Specific tools:
188188

189189
- Configurations for`mypy`,`pytest`,`coverage.py`, and`black` are in`./pyproject.toml`.
190-
- Configuration for`flake8` is in the`./.flake8` file.
190+
- Configuration for`ruff` is in the`pyproject.toml` file.
191191

192192
Orchestration tools:
193193

‎pyproject.toml

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ warn_unreachable = true
2929
show_error_codes =true
3030
implicit_reexport =true
3131
# strict = true
32-
3332
# TODO: Remove when 'gitdb' is fully annotated.
3433
exclude = ["^git/ext/gitdb"]
3534
[[tool.mypy.overrides]]
@@ -47,3 +46,40 @@ omit = ["*/git/ext/*"]
4746
line-length =120
4847
target-version = ["py37"]
4948
extend-exclude ="git/ext/gitdb"
49+
50+
[tool.ruff]
51+
target-version ="py37"
52+
line-length =120
53+
# Exclude a variety of commonly ignored directories.
54+
exclude = [
55+
"git/ext/",
56+
"doc",
57+
"build",
58+
"dist",
59+
]
60+
# Enable Pyflakes `E` and `F` codes by default.
61+
lint.select = [
62+
"E",
63+
"W",# see: https://pypi.org/project/pycodestyle
64+
"F",# see: https://pypi.org/project/pyflakes
65+
# "I", #see: https://pypi.org/project/isort/
66+
# "S", # see: https://pypi.org/project/flake8-bandit
67+
# "UP", # see: https://docs.astral.sh/ruff/rules/#pyupgrade-up
68+
]
69+
lint.extend-select = [
70+
"A",# see: https://pypi.org/project/flake8-builtins
71+
"B",# see: https://pypi.org/project/flake8-bugbear
72+
"C4",# see: https://pypi.org/project/flake8-comprehensions
73+
"TCH004",# see: https://docs.astral.sh/ruff/rules/runtime-import-in-type-checking-block/
74+
]
75+
lint.ignore = [
76+
"E203","W503"
77+
]
78+
lint.ignore-init-module-imports =true
79+
lint.unfixable = ["F401"]
80+
81+
#[tool.ruff.lint.per-file-ignores]
82+
#"setup.py" = ["ANN202", "ANN401"]
83+
#"docs/source/conf.py" = ["A001", "D103"]
84+
#"src/**" = ["ANN401"]
85+
#"tests/**" = ["S101", "ANN001", "ANN201", "ANN202", "ANN401"]

‎requirements-dev.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,5 @@
33

44
# libraries for additional local testing/linting - to be added to test-requirements.txt when all pass
55

6-
flake8-type-checking;python_version>="3.8"# checks for TYPE_CHECKING only imports
7-
86
pytest-icdiff
97
# pytest-profiling

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp