Skip to content

Commit

Permalink
Update to latest versions on some pre-commit hooks
Browse files Browse the repository at this point in the history
* ``pyupgrade``: 2.23.3
* ``reorder_python_imports``: 2.6.0
* ``black``: 21.b7
* ``blacken-docs``: 1.10.0
  • Loading branch information
s0undt3ch committed Aug 16, 2021
1 parent 894f65e commit d6859b6
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 13 deletions.
12 changes: 6 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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+
Expand All @@ -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: [
Expand All @@ -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
Expand Down
6 changes: 6 additions & 0 deletions changelog/79.trivial.rst
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion src/saltfactories/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
14 changes: 8 additions & 6 deletions src/saltfactories/utils/functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand All @@ -398,15 +400,15 @@ 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
- source: salt://testfile
file.append:
- text: foo
'''.format(
""".format(
testfile
)
with pytest.helpers.temp_file("issue-1876.sls", sls_contents, state_tree):
Expand All @@ -421,19 +423,19 @@ 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):
ret = loaders.modules.state.sls("pydsl")
for staterun in ret:
assert staterun.result is True
assert testfile.exists()
"""
'''

raw = attr.ib()
_structured = attr.ib(init=False)
Expand Down

0 comments on commit d6859b6

Please sign in to comment.