diff options
-rw-r--r-- | .editorconfig | 9 | ||||
-rw-r--r-- | pyproject.toml | 50 |
2 files changed, 59 insertions, 0 deletions
diff --git a/.editorconfig b/.editorconfig index 41ec3a1dc3d..0d2ec3d0766 100644 --- a/.editorconfig +++ b/.editorconfig @@ -34,6 +34,15 @@ indent_style = space indent_size = 2 max_line_length = 99 +# Tom's Obvious Minimal Language +[*.toml] +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true +indent_style = space +indent_size = 4 +max_line_length = 120 + # reStructuredText [*.rst] charset = utf-8 diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000000..921157d9034 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,50 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + +[tool.autopep8] +# Configuratuion for `autopep8`, allowing the command: autopep8 . +# to reformat all source files. +# +# NOTE: the settings defined here map directly to commmand line arguments +# which will override these settings when passed in to autopep8. + +max_line_length = 120 + +ignore = [ + # Info: Use `isinstance()` instead of comparing types directly. + # Why disable? Changes code logic, in rare cases we want to compare exact types. + "E721", + # Info: Fix bare except. + # Why disable? Disruptive, leave our exceptions alone. + "E722", + # Info: Fix module level import not at top of file. + # Why disable? Re-ordering imports is disruptive and breaks some scripts + # that need to check if a module has already been loaded in the case of reloading. + "E402", + # Info: Fix various deprecated code (via lib2to3) + # Why disable? Does nothing besides incorrectly adding a duplicate import, + # could be reported as a bug except this is likely to be removed soon, see: + # https://github.com/python/cpython/issues/84540. + "W690", +] + +# Exclude: +# - `./extern/` because it's maintained separately. +# - `./release/scripts/addons*` & `./source/tools/` because they are external repositories +# which can contain their own configuration and be handled separately. +# - `./release/scripts/modules/rna_manual_reference.py` because it's a generated data-file. +exclude = """ +./extern/*, +./release/scripts/addons/*, +./release/scripts/addons_contrib/*, +./release/scripts/modules/rna_manual_reference.py, +./source/tools/*, +""" + +# Match CPU count. +jobs = 0 + +# Format files in-place. +in_place = true + +# Format directories recursively (except for excluded paths). +recursive = true |