|
| 1 | +[tool.ruff] |
| 2 | +line-length = 120 |
| 3 | + |
| 4 | +[tool.ruff.lint] |
| 5 | +select = [ |
| 6 | + "E", # pycodestyle errors |
| 7 | + "W", # pycodestyle warnings |
| 8 | + "C90", # mccabe |
| 9 | + "F", # pyflakes |
| 10 | + "UP", # pyupgrade |
| 11 | + "I", # isort |
| 12 | +] |
| 13 | +ignore = [ |
| 14 | + "UP008", # pyupgrade: Use `super()` instead of `super(__class__, self)` (no autofix) |
| 15 | + "UP031", # pyupgrade: use format specifiers instead of percent format (no autofix) |
| 16 | + "E712", # avoid equality comparisons to False (no autofix) |
| 17 | + "E721", # do not compare types, use 'isinstance()' (no autofix) |
| 18 | + "E722", # do not use bare `except` (no autofix) |
| 19 | + "E731", # do not assign `lambda` expression, use a `def` (no autofix) |
| 20 | + "E741", # ambiguos variable name (no autofix) |
| 21 | +] |
| 22 | + |
| 23 | +[tool.ruff.lint.per-file-ignores] |
| 24 | +"__init__.py" = ["F401", "I001"] |
| 25 | +"__manifest__.py" = ["B018"] |
| 26 | + |
| 27 | +[tool.ruff.lint.pycodestyle] |
| 28 | +# line-length is set in [tool.ruff], and it's used by the formatter |
| 29 | +# in case the formatted can't autofix the line length, it will be reported as an error |
| 30 | +# only if it exceeds the max-line-length set here. We use 999 to effectively disable |
| 31 | +# this check. |
| 32 | +max-line-length = 999 |
| 33 | + |
| 34 | +[tool.ruff.lint.isort] |
| 35 | +combine-as-imports = true |
| 36 | +force-wrap-aliases = true |
| 37 | +known-third-party = [ |
| 38 | + "dateutil", |
| 39 | + "git", |
| 40 | + "gnupg", |
| 41 | + "openupgradelib", |
| 42 | + "pkg_resources", |
| 43 | + "psycopg2", |
| 44 | + "requests", |
| 45 | + "setuptools", |
| 46 | + "urllib2", |
| 47 | + "yaml", |
| 48 | +] |
| 49 | + |
| 50 | +[tool.ruff.lint.mccabe] |
| 51 | +max-complexity = 20 |
| 52 | + |
| 53 | +[tool.pylint.master] |
| 54 | +load-plugins = ["pylint_odoo"] |
| 55 | +score = false |
| 56 | + |
| 57 | +[tool.pylint.odoolint] |
| 58 | +manifest-required-authors = "ADHOC SA" |
| 59 | +manifest-required-keys = ["license"] |
| 60 | +manifest-deprecated-keys = ["description", "active"] |
| 61 | +license-allowed = [ |
| 62 | + "AGPL-3", |
| 63 | + "GPL-2", |
| 64 | + "GPL-2 or any later version", |
| 65 | + "GPL-3", |
| 66 | + "GPL-3 or any later version", |
| 67 | + "LGPL-3", |
| 68 | +] |
| 69 | + |
| 70 | +[tool.pylint."messages control"] |
| 71 | +disable = "all" |
| 72 | +enable = [ |
| 73 | + "anomalous-backslash-in-string", |
| 74 | + "api-one-deprecated", |
| 75 | + "api-one-multi-together", |
| 76 | + "assignment-from-none", |
| 77 | + "attribute-deprecated", |
| 78 | + "attribute-string-redundant", |
| 79 | + "character-not-valid-in-resource-link", |
| 80 | + "class-camelcase", |
| 81 | + "consider-merging-classes-inherited", |
| 82 | + "context-overridden", |
| 83 | + "create-user-wo-reset-password", |
| 84 | + "dangerous-default-value", |
| 85 | + "dangerous-filter-wo-user", |
| 86 | + "dangerous-qweb-replace-wo-priority", |
| 87 | + "dangerous-view-replace-wo-priority", |
| 88 | + "deprecated-data-xml-node", |
| 89 | + "deprecated-openerp-xml-node", |
| 90 | + "development-status-allowed", |
| 91 | + "duplicate-id-csv", |
| 92 | + "duplicate-key", |
| 93 | + "duplicate-po-message-definition", |
| 94 | + "duplicate-xml-fields", |
| 95 | + "duplicate-xml-record-id", |
| 96 | + "eval-referenced", |
| 97 | + "eval-used", |
| 98 | + # "except-pass", # Annoying |
| 99 | + "external-request-timeout", |
| 100 | + "file-not-used", |
| 101 | + "incoherent-interpreter-exec-perm", |
| 102 | + "invalid-commit", |
| 103 | + "license-allowed", |
| 104 | + "manifest-author-string", |
| 105 | + "manifest-deprecated-key", |
| 106 | + "manifest-maintainers-list", |
| 107 | + "manifest-required-author", |
| 108 | + "manifest-required-key", |
| 109 | + # "manifest-version-format", # Errors on non-migrated modules, and redundant with runbot |
| 110 | + "method-compute", |
| 111 | + "method-inverse", |
| 112 | + "method-required-super", |
| 113 | + "method-search", |
| 114 | + "missing-newline-extrafiles", |
| 115 | + # "missing-return", # Annoying. Not applicable for computed field methods |
| 116 | + "odoo-addons-relative-import", |
| 117 | + "old-api7-method-defined", |
| 118 | + "openerp-exception-warning", |
| 119 | + "po-msgstr-variables", |
| 120 | + "po-syntax-error", |
| 121 | + "pointless-statement", |
| 122 | + "pointless-string-statement", |
| 123 | + "print-used", |
| 124 | + "redundant-keyword-arg", |
| 125 | + "redundant-modulename-xml", |
| 126 | + "reimported", |
| 127 | + "relative-import", |
| 128 | + "renamed-field-parameter", |
| 129 | + "resource-not-exist", |
| 130 | + "return-in-init", |
| 131 | + "rst-syntax-error", |
| 132 | + "sql-injection", |
| 133 | + "str-format-used", |
| 134 | + "test-folder-imported", |
| 135 | + "too-few-format-args", |
| 136 | + "translation-contains-variable", |
| 137 | + "translation-field", |
| 138 | + # "translation-positional-used", # Annoying in our use case |
| 139 | + # "translation-required", # We don't always translate everything, and that's fine |
| 140 | + "unnecessary-utf8-coding-comment", |
| 141 | + "unreachable", |
| 142 | + "use-vim-comment", |
| 143 | + "wrong-tabs-instead-of-spaces", |
| 144 | + "xml-attribute-translatable", |
| 145 | + "xml-deprecated-qweb-directive", |
| 146 | + "xml-deprecated-tree-attribute", |
| 147 | + "xml-syntax-error" |
| 148 | +] |
| 149 | + |
| 150 | +[tool.pylint.reports] |
| 151 | +output-format = "colorized" |
| 152 | +msg-template = "{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}" |
0 commit comments