Skip to content

Commit 2423bef

Browse files
committed
Bump pre-commit hooks and some dependency versions.
Minimal python version is now 3.6.1 and core has been rewritten to use f-strings Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
1 parent d074054 commit 2423bef

39 files changed

Lines changed: 98 additions & 121 deletions

.pre-commit-config.yaml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
minimum_pre_commit_version: 1.15.2
33
repos:
44
- repo: https://github.com/pre-commit/pre-commit-hooks
5-
rev: v2.1.0
5+
rev: v4.3.0
66
hooks:
77
- id: check-merge-conflict # Check for files that contain merge conflict strings.
88
- id: trailing-whitespace # Trims trailing whitespace.
@@ -12,17 +12,24 @@ repos:
1212
- id: end-of-file-fixer # Makes sure files end in a newline and only a newline.
1313
- id: check-merge-conflict # Check for files that contain merge conflict strings.
1414
- id: check-ast # Simply check whether files parse as valid python.
15+
16+
- repo: https://github.com/asottile/pyupgrade
17+
rev: v2.34.0
18+
hooks:
19+
- id: pyupgrade
20+
args:
21+
- --py36-plus
22+
- --keep-mock
1523
- repo: https://github.com/asottile/reorder_python_imports
16-
rev: v1.9.0
24+
rev: v3.1.0
1725
hooks:
1826
- id: reorder-python-imports
1927
args: [--py3-plus]
2028
- repo: https://github.com/psf/black
21-
rev: 20.8b1
29+
rev: 22.3.0
2230
hooks:
2331
- id: black
2432
args: [-l 100]
25-
language_version: python3.6
2633
- repo: local
2734
hooks:
2835
- id: pylint

.pylintrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ confidence=
6363
disable=R,
6464
bad-continuation,
6565
unused-argument,
66-
fixme
66+
fixme,
67+
unspecified-encoding
6768

6869
# Enable the message, report, category or checker with the given id(s). You can
6970
# either give multiple identifier separated by comma (,) or put this option

poetry.lock

Lines changed: 54 additions & 46 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ packages = [
1212
"salt-rewrite" = "saltrewrite.__main__:rewrite"
1313

1414
[tool.poetry.dependencies]
15-
python = "^3.6"
15+
python = ">=3.6.1"
1616
bowler = ">= 0.9.0"
1717
fissix = {version = "^19.2b1", allow-prereleases = true}
1818
importlib_metadata = {version = "*", python="<3.8"}
1919

2020
[tool.poetry.dev-dependencies]
2121
pytest = ">= 5.3.4"
2222
pylint = "^2.4.4"
23-
pre-commit = "^1.21.0"
23+
pre-commit = "^2.17.0"
2424
coverage = "^5.0.3"
2525

2626
[build-system]

src/saltrewrite/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
# -*- coding: utf-8 -*-
21
# pylint: disable=missing-module-docstring

src/saltrewrite/__main__.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
"""
32
saltrewrite.cli
43
~~~~~~~~~~~~~~~
@@ -46,9 +45,7 @@ def rewrite(paths, interactive, silent, list_fixes, fix, exclude_fix):
4645
Main CLI entry-point
4746
"""
4847
if list_fixes:
49-
click.echo(
50-
"Fixes:\n{}".format("\n".join(" - {}".format(fix) for fix in Registry.fix_names()))
51-
)
48+
click.echo("Fixes:\n{}".format("\n".join(f" - {fix}" for fix in Registry.fix_names())))
5249
return
5350

5451
if fix and exclude_fix:
@@ -67,4 +64,4 @@ def format_progress_bar(item):
6764
Format a progress bar item
6865
"""
6966
if item is not None:
70-
return "Processing {}".format(item[0])
67+
return f"Processing {item[0]}"

src/saltrewrite/fixes.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
"""
32
saltrewrite.fixes
43
~~~~~~~~~~~~~~~~~
@@ -13,7 +12,7 @@
1312
import saltrewrite.testsuite
1413

1514

16-
class RegistryClass(object):
15+
class RegistryClass:
1716
"""
1817
Registry class to hold all available fixes
1918
"""

src/saltrewrite/imports/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
# pylint: disable=missing-module-docstring
32
from saltrewrite.imports import fix_tornado_imports
43

src/saltrewrite/imports/fix_tornado_imports.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
"""
32
saltrewrite.imports.fix_tornado_imports
43
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -93,7 +92,7 @@ def replace_decorators(node, capture, filename):
9392
SYMBOL.decorator,
9493
[
9594
Leaf(TOKEN.AT, "@"),
96-
Name("salt.ext.{}".format(get_decorator_name(decorator))),
95+
Name(f"salt.ext.{get_decorator_name(decorator)}"),
9796
Leaf(TOKEN.NEWLINE, "\n"),
9897
],
9998
)

src/saltrewrite/salt/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
# pylint: disable=missing-module-docstring
32
from saltrewrite.salt import fix_docstrings
43

0 commit comments

Comments
 (0)