|
1 | 1 | line-length = 79 # Accessibility-friendly |
2 | 2 |
|
| 3 | +namespace-packages = [ |
| 4 | + "docs/", |
| 5 | + "src/pylibsshext/", |
| 6 | + "tests/", |
| 7 | +] |
| 8 | + |
3 | 9 | [format] |
4 | 10 | quote-style = "single" |
5 | 11 |
|
| 12 | +[lint] |
| 13 | +external = [ |
| 14 | + "WPS", # Do not remove noqa for wemake-python-style (WPS) checks |
| 15 | +] |
| 16 | +ignore = [ |
| 17 | + "CPY001", # Skip copyright notice requirement at top of files |
| 18 | + |
| 19 | + # Legitimate cases, no need to "fix" these violations: |
| 20 | + # E501: "line too long", its function is replaced by `flake8-length` |
| 21 | + "E501", |
| 22 | + # W505: "doc line too long", its function is replaced by `flake8-length` |
| 23 | + "W505", |
| 24 | + |
| 25 | + # FIXME: These `flake8-annotations` errors need fixing and removal |
| 26 | + # ANN001: Missing type annotation for function argument 'argv' |
| 27 | + "ANN001", |
| 28 | + # ANN201: Missing return type annotation for public function |
| 29 | + "ANN201", |
| 30 | + # ANN202: Missing return type annotation for protected function |
| 31 | + "ANN202", |
| 32 | + "ANN401", # any-type # FIXME |
| 33 | + |
| 34 | + # Refs: |
| 35 | + # * https://github.com/astral-sh/ruff/issues/6606 |
| 36 | + # * https://github.com/astral-sh/ruff/pull/13286 |
| 37 | + "DOC201", # Ruff doesn't understand sphinx-native param lists |
| 38 | + "DOC402", # docstring-missing-yields # Ruff doesn't understand sphinx-native param lists |
| 39 | + "DOC501", # docstring-missing-exception # Ruff doesn't understand sphinx-native param lists |
| 40 | + |
| 41 | + "FIX001", # line-contains-fixme # FIXME |
| 42 | + "FIX002", # line-contains-todo # FIXME / noqa |
| 43 | + |
| 44 | + "PLR0914", # too-many-locals # FIXME / noqa |
| 45 | + "PLR2004", # magic-value-comparison # FIXME |
| 46 | + |
| 47 | + "RUF100", # Ruff doesn't know about WPS |
| 48 | + |
| 49 | + "SIM117", # multiple-with-statements # FIXME |
| 50 | + |
| 51 | + "TD002", # missing-todo-author # FIXME |
| 52 | + "TD004", # missing-todo-colon # FIXME |
| 53 | + |
| 54 | + "TRY003", # raise-vanilla-args # controversial |
| 55 | + |
| 56 | + "UP024", # os-error-alias # FIXME |
| 57 | +] |
| 58 | +preview = true # Live dangerously |
| 59 | +select = [ |
| 60 | + "ALL", |
| 61 | +] |
| 62 | +task-tags = [ |
| 63 | + "FIXME", |
| 64 | + "NOTE", |
| 65 | + "Ref", |
| 66 | + "Refs", |
| 67 | + "TODO", |
| 68 | +] |
| 69 | + |
| 70 | +[lint.flake8-pytest-style] |
| 71 | +parametrize-values-type = "tuple" |
| 72 | + |
| 73 | +[lint.flake8-quotes] |
| 74 | +inline-quotes = "single" |
| 75 | + |
6 | 76 | [lint.isort] |
7 | 77 | combine-as-imports = true |
8 | 78 | force-wrap-aliases = true |
@@ -35,3 +105,30 @@ testing = [ |
35 | 105 | "unittest", |
36 | 106 | "_service_utils", |
37 | 107 | ] |
| 108 | + |
| 109 | + |
| 110 | +[lint.per-file-ignores] |
| 111 | +# Exceptions for code samples in the docs |
| 112 | +"docs/_samples/**.py" = [ |
| 113 | + "ERA001", # commented-out-code |
| 114 | + "S105", # hardcoded-password-string |
| 115 | + "S108", # hardcoded-temp-file |
| 116 | + "T201", # print |
| 117 | +] |
| 118 | + |
| 119 | +# Exceptions for test files |
| 120 | +"tests/**.py" = [ |
| 121 | + "ARG002", # Allow unused arguments in instance methods (required for test stubs) |
| 122 | + "ARG004", # unused-static-method-argument (hit in WSGI test apps) |
| 123 | + "PLC1901", # compare-to-empty-string (test accuracy) |
| 124 | + "PLC2701", # Allow importing internal files needed for testing |
| 125 | + # "PLR6301", # Allow 'self' parameter in method definitions (required for test stubs) |
| 126 | + "S101", # Allow use of `assert` in test files |
| 127 | + "S311", # suspicious-non-cryptographic-random-usage |
| 128 | + "S404", # Allow importing 'subprocess' module to testing call external tools needed by these hooks |
| 129 | + "S603", # subprocess-without-shell-equals-true |
| 130 | + "SLF001", # Private member accessed |
| 131 | +] |
| 132 | + |
| 133 | +[lint.pydocstyle] |
| 134 | +convention = "pep257" |
0 commit comments