From c1baa329c697535e9d15f53d2e2bb6c34bb1e135 Mon Sep 17 00:00:00 2001 From: Wayne Werner Date: Tue, 4 Feb 2020 13:59:56 -0600 Subject: [PATCH] Add black and isort to precommit E203 is *not* pep8 compliant, pylint. --- .isort.cfg | 7 +++++++ .pre-commit-config.yaml | 10 ++++++++++ .pylintrc | 4 +++- pyproject.toml | 6 ++++++ 4 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 .isort.cfg create mode 100644 pyproject.toml diff --git a/.isort.cfg b/.isort.cfg new file mode 100644 index 00000000000..4f77f9eb6f3 --- /dev/null +++ b/.isort.cfg @@ -0,0 +1,7 @@ +[settings] +multi_line_output=3 +include_trailing_comma=True +force_grid_wrap=0 +line_length=88 +ensure_newline_before_comments=True +use_parentheses=True diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c4de5c154c0..1aa4ff53704 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -416,6 +416,16 @@ repos: - --py-version=3.7 - --platform=linux + - repo: https://github.com/timothycrosley/isort + rev: '1e78a9acf3110e1f9721feb591f89a451fc9876a' + hooks: + - id: isort + + - repo: https://github.com/psf/black + rev: stable + hooks: + - id: black + language_version: python3.7 - repo: https://github.com/saltstack/salt-nox-pre-commit rev: master diff --git a/.pylintrc b/.pylintrc index 57105fd554a..809c96f4828 100644 --- a/.pylintrc +++ b/.pylintrc @@ -12,7 +12,7 @@ ignore=CVS, # Add files or directories matching the regex patterns to the blacklist. The # regex matches against base names, not paths. -ignore-patterns= +ignore-patterns=salt.ext.* # Python code to execute, usually for sys.path manipulation such as # pygtk.require(). @@ -77,6 +77,7 @@ disable=R, no-member, unsubscriptable-object, un-indexed-curly-braces-error, + whitespace-before-colon, indentation-is-not-a-multiple-of-four-comment, blacklisted-name, invalid-name, @@ -126,6 +127,7 @@ disable=R, str-format-in-logging, import-outside-toplevel, deprecated-method, + repr-flag-used-in-string, keyword-arg-before-vararg # Enable the message, report, category or checker with the given id(s). You can diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000000..da0b69c3c03 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,6 @@ +[tool.black] +exclude= ''' +\( + salt/ext + | tests/kitchen +)/