|
1 | | -# ================== |
2 | | -# Build system setup |
3 | | -# ================== |
4 | | - |
5 | 1 | [build-system] |
| 2 | +build-backend = "setuptools.build_meta" |
6 | 3 | requires = [ |
7 | 4 | "setuptools>=42", # At least v42 of setuptools required! |
8 | 5 | "versioningit", |
9 | 6 | ] |
10 | | -build-backend = "setuptools.build_meta" |
11 | | - |
12 | | -[tool.pytest.ini_options] |
13 | | -minversion = "2.0" |
14 | | -addopts = """ |
15 | | - -rsfEX -p pytester --strict-markers --verbosity=3 |
16 | | - --cov=epo_ops tests --cov-report=term-missing --cov-report=xml |
17 | | - """ |
18 | | -log_level = "DEBUG" |
19 | | -log_cli_level = "DEBUG" |
20 | | -testpaths = ["tests"] |
21 | | -xfail_strict = true |
22 | | -markers = [] |
23 | 7 |
|
24 | 8 | [tool.ruff] |
25 | 9 | line-length = 80 |
26 | | - |
| 10 | +extend-exclude = [ "__init__.py" ] |
27 | 11 | lint.select = [ |
28 | | - # Bandit |
29 | | - "S", |
30 | | - # Bugbear |
31 | | - "B", |
32 | 12 | # Builtins |
33 | 13 | "A", |
| 14 | + # Bugbear |
| 15 | + "B", |
| 16 | + "B9", |
34 | 17 | # comprehensions |
35 | 18 | "C", |
| 19 | + # Pycodestyle |
| 20 | + "E", |
36 | 21 | # eradicate |
37 | 22 | "ERA", |
38 | | - # flake8-2020 |
39 | | - "YTT", |
| 23 | + # Pyflakes |
| 24 | + "F", |
40 | 25 | # isort |
41 | 26 | "I", |
42 | 27 | # pandas-vet |
43 | 28 | "PD", |
44 | | - # print |
45 | | - "T20", |
46 | | - # Pycodestyle |
47 | | - "E", |
48 | | - "W", |
49 | | - # Pyflakes |
50 | | - "F", |
51 | 29 | # return |
52 | 30 | "RET", |
| 31 | + # Bandit |
| 32 | + "S", |
53 | 33 | # from `.flake8` file |
54 | | - "T", # T4 |
55 | | - "B9", |
| 34 | + "T", # T4 |
| 35 | + # print |
| 36 | + "T20", |
| 37 | + "W", |
| 38 | + # flake8-2020 |
| 39 | + "YTT", |
56 | 40 | ] |
57 | | - |
58 | | -extend-exclude = ["__init__.py"] |
59 | | - |
60 | 41 | lint.ignore = [ |
61 | | - "B905", # B905 `zip()` without an explicit `strict=` parameter |
| 42 | + "B905", # B905 `zip()` without an explicit `strict=` parameter |
62 | 43 | "E203", |
63 | 44 | "E266", |
64 | 45 | "E501", |
65 | 46 | "ERA001", # Found commented-out code |
66 | 47 | "RET505", # Unnecessary `else` after `return` statement |
67 | 48 | # "W503", # Unknown rule selector |
68 | 49 | ] |
69 | | - |
| 50 | +# FIXME: Improve this situation wrt. SQL injection, even it is not be an actual attack vector. |
| 51 | +lint.per-file-ignores."*sqlite.py" = [ |
| 52 | + "S608", # Possible SQL injection vector through string-based query construction |
| 53 | +] |
| 54 | +lint.per-file-ignores."epo_ops/api.py" = [ |
| 55 | + "A001", # Variable `range` is shadowing a Python builtin |
| 56 | + "A002", # Argument `input` is shadowing a Python builtin |
| 57 | + "C408", # Unnecessary `dict` call (rewrite as a literal) |
| 58 | +] |
| 59 | +lint.per-file-ignores."tests/*" = [ |
| 60 | + "S101", # Use of `assert` detected |
| 61 | +] |
| 62 | +lint.per-file-ignores."tests/middlewares/throttle/conftest.py" = [ |
| 63 | + "S311", # Standard pseudo-random generators are not suitable for cryptographic purposes |
| 64 | +] |
70 | 65 | # from `.isort.cfg` file |
71 | | -[tool.ruff.lint.isort] |
72 | | -combine-as-imports = true |
73 | | -force-wrap-aliases = true |
74 | | -known-third-party = [ |
| 66 | +lint.isort.combine-as-imports = true |
| 67 | +lint.isort.force-wrap-aliases = true |
| 68 | +lint.isort.known-third-party = [ |
75 | 69 | "dateutil", |
76 | 70 | "dogpile", |
77 | 71 | "dotenv", |
78 | 72 | "pytest", |
79 | 73 | "requests", |
80 | 74 | "six", |
81 | 75 | ] |
82 | | -split-on-trailing-comma = false |
83 | | - |
| 76 | +lint.isort.split-on-trailing-comma = false |
84 | 77 | # from `.flake8` file |
85 | | -[tool.ruff.lint.mccabe] |
86 | 78 | # Flag errors (`C901`) whenever the complexity level exceeds the configured value. |
87 | | -max-complexity = 7 |
88 | | - |
89 | | - |
90 | | -[tool.ruff.lint.per-file-ignores] |
91 | | -"tests/*" = [ |
92 | | - "S101", # Use of `assert` detected |
93 | | -] |
94 | | -"epo_ops/api.py" = [ |
95 | | - "A001", # Variable `range` is shadowing a Python builtin |
96 | | - "A002", # Argument `input` is shadowing a Python builtin |
97 | | - "C408", # Unnecessary `dict` call (rewrite as a literal) |
98 | | -] |
99 | | -# FIXME: Improve this situation wrt. SQL injection, even it is not be an actual attack vector. |
100 | | -"*sqlite.py" = [ |
101 | | - "S608", # Possible SQL injection vector through string-based query construction |
102 | | -] |
103 | | -"tests/middlewares/throttle/conftest.py" = [ |
104 | | - "S311", # Standard pseudo-random generators are not suitable for cryptographic purposes |
105 | | -] |
| 79 | +lint.mccabe.max-complexity = 7 |
106 | 80 |
|
| 81 | +[tool.pytest] |
| 82 | +ini_options.minversion = "2.0" |
| 83 | +ini_options.addopts = """ |
| 84 | + -rsfEX -p pytester --strict-markers --verbosity=3 |
| 85 | + --cov=epo_ops tests --cov-report=term-missing --cov-report=xml |
| 86 | + """ |
| 87 | +ini_options.log_level = "DEBUG" |
| 88 | +ini_options.log_cli_level = "DEBUG" |
| 89 | +ini_options.testpaths = [ "tests" ] |
| 90 | +ini_options.xfail_strict = true |
| 91 | +ini_options.markers = [] |
107 | 92 |
|
108 | 93 | [tool.versioningit] |
109 | 94 | vcs.method = "git-archive" |
|
0 commit comments