Skip to content

Commit fcd0d88

Browse files
committed
ruff improvements
1 parent 0cd3f0d commit fcd0d88

File tree

3 files changed

+36
-1
lines changed

3 files changed

+36
-1
lines changed

.ruff.toml

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,27 @@ ignore = [
4545
"S101", # use of `assert` detected hanbled by pylance, does not support noseq
4646
"TID252", # [*] Relative imports from parent modules are banned
4747
]
48-
extend-exclude = ["**/tests", "**/generated_models", "**/director/"]
48+
49+
target-version = "py310"
50+
51+
52+
[per-file-ignores]
53+
"**/tests/**" = [
54+
"T201", # print found
55+
"ARG001", # unused function argument
56+
"PT019", # user pytest.mark.usefixture
57+
"PLR2004", # use of magic values
58+
"PLR0913", # too many arguments
59+
"N806", # Uppercase variables in functions
60+
"PT001", # use pytest.fixture over pytest.fixture() whatsoever
61+
"ERA001", # found commented out code
62+
]
63+
64+
[flake8-pytest-style]
65+
fixture-parentheses = false
66+
parametrize-names-type = "csv"
67+
68+
69+
70+
[pylint]
71+
max-args = 10

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -514,6 +514,11 @@ ruff: ## python ruffing
514514
@ruff --version
515515
# Running ruff in packages and services (except director)
516516
@ruff check \
517+
--config=$(CURDIR)/.ruff.toml \
518+
--respect-gitignore \
519+
--extend-exclude="**/tests" \
520+
--extend-exclude="**/generated_models" \
521+
--extend-exclude="**/director/" \
517522
$(CURDIR)/services \
518523
$(CURDIR)/packages
519524

scripts/common.Makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,13 @@ pyupgrade: ## upgrades python syntax for newer versions of the language (SEE htt
129129
pylint: $(REPO_BASE_DIR)/.pylintrc ## runs pylint (python linter) on src and tests folders
130130
@pylint --rcfile="$(REPO_BASE_DIR)/.pylintrc" -v $(CURDIR)/src $(CURDIR)/tests
131131

132+
.PHONY: ruff
133+
ruff: $(REPO_BASE_DIR)/.ruff.toml ## runs ruff (python fast linter) on src and tests folders
134+
@ruff check \
135+
--config=$(REPO_BASE_DIR)/.ruff.toml \
136+
--respect-gitignore \
137+
$(CURDIR)/src \
138+
$(CURDIR)/tests
132139

133140
.PHONY: mypy
134141
mypy: $(REPO_BASE_DIR)/scripts/mypy.bash $(REPO_BASE_DIR)/mypy.ini ## runs mypy python static type-checker on this services's code. Use AFTER make install-*

0 commit comments

Comments
 (0)