|
| 1 | +[tool.ruff] |
| 2 | +line-length = 100 |
| 3 | + |
| 4 | +extend-exclude = [ |
| 5 | +] |
| 6 | + |
| 7 | +lint.select = [ |
| 8 | + # Builtins |
| 9 | + "A", |
| 10 | + # Bugbear |
| 11 | + "B", |
| 12 | + # comprehensions |
| 13 | + "C4", |
| 14 | + # Pycodestyle |
| 15 | + "E", |
| 16 | + # eradicate |
| 17 | + "ERA", |
| 18 | + # Pyflakes |
| 19 | + "F", |
| 20 | + # isort |
| 21 | + "I", |
| 22 | + # return |
| 23 | + "RET", |
| 24 | + # Bandit |
| 25 | + "S", |
| 26 | + # print |
| 27 | + "T20", |
| 28 | + "W", |
| 29 | + # flake8-2020 |
| 30 | + "YTT", |
| 31 | +] |
| 32 | + |
| 33 | +lint.extend-ignore = [ |
| 34 | + # Unnecessary `elif` after `return` statement |
| 35 | + "RET505", |
| 36 | + # Probable insecure usage of temporary file or directory |
| 37 | + "S108", |
| 38 | + # Possible SQL injection vector through string-based query construction |
| 39 | + "S608", |
| 40 | +] |
| 41 | + |
| 42 | +lint.per-file-ignores."examples/*" = [ |
| 43 | + "ERA001", # Found commented-out code |
| 44 | + "T201", # Allow `print` |
| 45 | +] |
| 46 | + |
| 47 | +lint.per-file-ignores."tests/*" = [ |
| 48 | + "S101", # Allow use of `assert` |
| 49 | +] |
| 50 | + |
| 51 | +[tool.pytest.ini_options] |
| 52 | +addopts = """ |
| 53 | + -rfEXs -p pytester --strict-markers --verbosity=3 |
| 54 | + --cov --cov-report=term-missing --cov-report=xml |
| 55 | + """ |
| 56 | +minversion = "2.0" |
| 57 | +log_level = "DEBUG" |
| 58 | +log_cli_level = "DEBUG" |
| 59 | +log_format = "%(asctime)-15s [%(name)-36s] %(levelname)-8s: %(message)s" |
| 60 | +xfail_strict = true |
| 61 | + |
| 62 | + |
| 63 | +[tool.coverage.paths2] |
| 64 | +source = [ |
| 65 | + ".", |
| 66 | + "examples", |
| 67 | +] |
| 68 | + |
| 69 | +[tool.coverage.run] |
| 70 | +branch = false |
| 71 | +source = [ |
| 72 | + ".", |
| 73 | + "examples", |
| 74 | +] |
| 75 | +omit = [ |
| 76 | + "tests/*", |
| 77 | +] |
| 78 | + |
| 79 | +[tool.coverage.report] |
| 80 | +fail_under = 0 |
| 81 | +show_missing = true |
| 82 | +exclude_lines = [ |
| 83 | + "# pragma: no cover", |
| 84 | + "raise NotImplemented", |
| 85 | +] |
| 86 | + |
| 87 | + |
| 88 | +# =================== |
| 89 | +# Tasks configuration |
| 90 | +# =================== |
| 91 | + |
| 92 | +[tool.poe.tasks] |
| 93 | + |
| 94 | +check = [ |
| 95 | + "lint", |
| 96 | + "test", |
| 97 | +] |
| 98 | + |
| 99 | +format = [ |
| 100 | + { cmd = "ruff format ." }, |
| 101 | + # Configure Ruff not to auto-fix (remove!): |
| 102 | + # unused imports (F401), unused variables (F841), `print` statements (T201), and commented-out code (ERA001). |
| 103 | + { cmd = "ruff check --fix --ignore=ERA --ignore=F401 --ignore=F841 --ignore=T20 --ignore=ERA001 ." }, |
| 104 | + { cmd = "pyproject-fmt --keep-full-version pyproject.toml" }, |
| 105 | +] |
| 106 | + |
| 107 | +lint = [ |
| 108 | + { cmd = "ruff format --check ." }, |
| 109 | + { cmd = "ruff check ." }, |
| 110 | + { cmd = "validate-pyproject pyproject.toml" }, |
| 111 | +] |
| 112 | + |
| 113 | + |
| 114 | +[tool.poe.tasks.test] |
| 115 | +cmd = "pytest" |
| 116 | +help = "Invoke software tests" |
| 117 | + |
| 118 | +[tool.poe.tasks.test.args.expression] |
| 119 | +options = [ "-k" ] |
| 120 | + |
| 121 | +[tool.poe.tasks.test.args.marker] |
| 122 | +options = [ "-m" ] |
0 commit comments