diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 239e3cf8..26a0f7d0 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -30,7 +30,7 @@ repos: # ----- Formatting ------------------------------------------------------------------------------------------------> - repo: https://github.com/asottile/pyupgrade - rev: v2.11.0 + rev: v2.23.3 hooks: - id: pyupgrade name: Rewrite Code to be Py3.5+ @@ -46,7 +46,7 @@ repos: exclude: ^(docs/.*\.py|src/saltfactories/(cli|daemons)/__init__\.py)$ - repo: https://github.com/asottile/reorder_python_imports - rev: v2.4.0 + rev: v2.6.0 hooks: - id: reorder-python-imports args: [ @@ -56,19 +56,19 @@ repos: exclude: src/saltfactories/version.py - repo: https://github.com/psf/black - rev: 21.4b2 + rev: 21.7b0 hooks: - id: black args: [-l 100] exclude: src/saltfactories/version.py - repo: https://github.com/asottile/blacken-docs - rev: v1.7.0 + rev: v1.10.0 hooks: - id: blacken-docs args: [--skip-errors] - files: ^(docs/.*\.rst|saltfactories/.*\.py)$ - additional_dependencies: [black==21.4b2] + files: ^(docs/.*\.rst|src/saltfactories/.*\.py)$ + additional_dependencies: [black==21.7b0] - repo: https://github.com/pre-commit/mirrors-pylint rev: v2.4.4 diff --git a/changelog/79.trivial.rst b/changelog/79.trivial.rst new file mode 100644 index 00000000..7af800db --- /dev/null +++ b/changelog/79.trivial.rst @@ -0,0 +1,6 @@ +Update to latest versions on some pre-commit hooks + +* ``pyupgrade``: 2.23.3 +* ``reorder_python_imports``: 2.6.0 +* ``black``: 21.b7 +* ``blacken-docs``: 1.10.0 diff --git a/src/saltfactories/__init__.py b/src/saltfactories/__init__.py index 82c09dfa..cf2e270e 100644 --- a/src/saltfactories/__init__.py +++ b/src/saltfactories/__init__.py @@ -44,7 +44,7 @@ ) try: __version_info__ = tuple( - [int(p) if p.isdigit() else p for p in VERSION_INFO_REGEX.match(__version__).groups() if p] + int(p) if p.isdigit() else p for p in VERSION_INFO_REGEX.match(__version__).groups() if p ) except AttributeError: # pragma: no cover __version_info__ = (-1, -1, -1) diff --git a/src/saltfactories/utils/functional.py b/src/saltfactories/utils/functional.py index e0cf2e6d..145df055 100644 --- a/src/saltfactories/utils/functional.py +++ b/src/saltfactories/utils/functional.py @@ -38,10 +38,12 @@ class Loaders: import salt.config from saltfactories.utils.functional import Loaders + @pytest.fixture(scope="module") def minion_opts(): return salt.config.minion_config(None) + @pytest.fixture(scope="module") def loaders(minion_opts): return Loaders(minion_opts) @@ -385,7 +387,7 @@ def __call__(self, *args, **kwargs): @attr.s class MultiStateResult: - """ + ''' This class wraps multiple salt state returns, for example, running the ``state.sls`` execution module, into a more pythonic object in order to simplify assertions @@ -398,7 +400,7 @@ class MultiStateResult: def test_issue_1876_syntax_error(loaders, state_tree, tmp_path): testfile = tmp_path / "issue-1876.txt" - sls_contents = ''' + sls_contents = """ {}: file: - managed @@ -406,7 +408,7 @@ def test_issue_1876_syntax_error(loaders, state_tree, tmp_path): file.append: - text: foo - '''.format( + """.format( testfile ) with pytest.helpers.temp_file("issue-1876.sls", sls_contents, state_tree): @@ -421,11 +423,11 @@ def test_issue_1876_syntax_error(loaders, state_tree, tmp_path): def test_pydsl(loaders, state_tree, tmp_path): testfile = tmp_path / "testfile" - sls_contents = ''' + sls_contents = """ #!pydsl state("{}").file("touch") - '''.format( + """.format( testfile ) with pytest.helpers.temp_file("pydsl.sls", sls_contents, state_tree): @@ -433,7 +435,7 @@ def test_pydsl(loaders, state_tree, tmp_path): for staterun in ret: assert staterun.result is True assert testfile.exists() - """ + ''' raw = attr.ib() _structured = attr.ib(init=False)