core: added ruff check/format configs
This commit is contained in:
parent
bf83236cf8
commit
7130effb58
3 changed files with 14 additions and 2 deletions
|
|
@ -5,6 +5,6 @@ repos:
|
||||||
hooks:
|
hooks:
|
||||||
# Run the linter.
|
# Run the linter.
|
||||||
- id: ruff
|
- id: ruff
|
||||||
args: [ "--ignore=F401", "--ignore=I001", "--ignore=E402", "--ignore=E501", "--ignore=F841" ]
|
args: [ "--ignore=F401", "--ignore=I001", "--ignore=E402", "--ignore=E501", "--ignore=F841", "--ignore=F405" ]
|
||||||
# Run the formatter.
|
# Run the formatter.
|
||||||
- id: ruff-format
|
- id: ruff-format
|
||||||
|
|
|
||||||
2
Makefile
2
Makefile
|
|
@ -172,7 +172,7 @@ dev-srv:
|
||||||
.PHONY: ruff-check
|
.PHONY: ruff-check
|
||||||
# ruff-check: run a ruff analysis
|
# ruff-check: run a ruff analysis
|
||||||
ruff-check:
|
ruff-check:
|
||||||
ruff check --ignore F401 --ignore I001 --ignore E402 --ignore E501 --ignore F841 --exclude rhodecode/lib/dbmigrate --exclude .eggs --exclude .dev .
|
ruff check --exclude rhodecode/lib/dbmigrate --exclude .eggs --exclude .dev .
|
||||||
|
|
||||||
.PHONY: ruff-format
|
.PHONY: ruff-format
|
||||||
# Get changed Python files
|
# Get changed Python files
|
||||||
|
|
|
||||||
|
|
@ -71,6 +71,10 @@ line-length = 120
|
||||||
# Assume Python 3.11
|
# Assume Python 3.11
|
||||||
target-version = "py311"
|
target-version = "py311"
|
||||||
|
|
||||||
|
exclude = [
|
||||||
|
"rhodecode/config/rcextensions/examples",
|
||||||
|
"rhodecode/lib/_vendor/authomatic/six.py"
|
||||||
|
]
|
||||||
|
|
||||||
[tool.ruff.lint]
|
[tool.ruff.lint]
|
||||||
select = [
|
select = [
|
||||||
|
|
@ -84,7 +88,15 @@ select = [
|
||||||
]
|
]
|
||||||
|
|
||||||
ignore = [
|
ignore = [
|
||||||
|
"I001", # unsorted-imports
|
||||||
|
|
||||||
|
"E402", # module-import-not-at-top-of-file
|
||||||
"E501", # line too long, handled by black
|
"E501", # line too long, handled by black
|
||||||
|
|
||||||
|
"F403", # undefined-local-with-import-star
|
||||||
|
"F405", # undefined-local-with-import-star-usage
|
||||||
|
"F401", # unused-import
|
||||||
|
"F841", # unused-variable
|
||||||
]
|
]
|
||||||
|
|
||||||
[tool.ruff.lint.isort]
|
[tool.ruff.lint.isort]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue