Skip to content

Commit fe0215b

Browse files
build: upgrade Poetry, pylint and pre-commit hooks (#494)
* [pre-commit.ci] pre-commit autoupdate updates: - [github.com/pre-commit/pre-commit-hooks: v4.1.0 → v4.3.0](pre-commit/pre-commit-hooks@v4.1.0...v4.3.0) - [github.com/asottile/pyupgrade: v2.31.1 → v2.37.1](asottile/pyupgrade@v2.31.1...v2.37.1) - [github.com/psf/black: 22.1.0 → 22.6.0](psf/black@22.1.0...22.6.0) - [github.com/pre-commit/mirrors-prettier: v2.6.1 → v2.7.1](pre-commit/mirrors-prettier@v2.6.1...v2.7.1) - [github.com/pre-commit/mirrors-mypy: v0.942 → v0.961](pre-commit/mirrors-mypy@v0.942...v0.961) - [github.com/commitizen-tools/commitizen: v2.21.2 → v2.28.0](commitizen-tools/commitizen@v2.21.2...v2.28.0) * build: upgrade Poetry and pylint * build: remove @lru_cache on methods to fix flake8 warning B019 * ci: use Python3.8 only on flake8 * ci: upgrade black and all hooks black is failing on pre-commit.ci with ImportError: cannot import name '_unicodefun' from 'click' Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 6cff555 commit fe0215b

File tree

6 files changed

+54
-29
lines changed

6 files changed

+54
-29
lines changed

.pre-commit-config.yaml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ repos:
3434
types: [python, toml]
3535
stages: [commit]
3636
- repo: https://github.com/pre-commit/pre-commit-hooks
37-
rev: v4.1.0
37+
rev: v4.3.0
3838
hooks:
3939
- id: debug-statements
4040
- id: end-of-file-fixer
4141
- id: trailing-whitespace
4242
- repo: https://github.com/asottile/pyupgrade
43-
rev: v2.31.1
43+
rev: v2.37.1
4444
hooks:
4545
- id: pyupgrade
4646
args: [--py37-plus]
@@ -64,7 +64,7 @@ repos:
6464
compat.py,
6565
]
6666
- repo: https://github.com/psf/black
67-
rev: 22.1.0
67+
rev: 22.6.0
6868
hooks:
6969
- id: black
7070
args: [--safe, --quiet]
@@ -86,14 +86,15 @@ repos:
8686
- id: python-no-log-warn
8787
- id: rst-backticks
8888
- repo: https://github.com/pre-commit/mirrors-prettier
89-
rev: v2.6.1
89+
rev: v2.7.1
9090
hooks:
9191
- id: prettier
9292
stages: [commit]
9393
- repo: https://github.com/PyCQA/flake8
9494
rev: 4.0.1
9595
hooks:
9696
- id: flake8
97+
language_version: python3.8
9798
additional_dependencies:
9899
[
99100
flake8-blind-except,
@@ -109,7 +110,7 @@ repos:
109110
yesqa,
110111
]
111112
- repo: https://github.com/pre-commit/mirrors-mypy
112-
rev: v0.942
113+
rev: v0.961
113114
hooks:
114115
- id: mypy
115116
# https://mypy.readthedocs.io/en/stable/command_line.html#cmdoption-mypy-show-error-codes
@@ -154,7 +155,7 @@ repos:
154155
# https://docs.openstack.org/bashate/latest/man/bashate.html#options
155156
args: [-i, E006]
156157
- repo: https://github.com/commitizen-tools/commitizen
157-
rev: v2.21.2
158+
rev: v2.28.0
158159
hooks:
159160
- id: commitizen
160161
stages: [commit-msg]

.tool-versions

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
poetry 1.1.12
1+
poetry 1.1.14
22
pre-commit 2.17.0

poetry.lock

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

src/nitpick/blender.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import json
1111
import re
1212
import shlex
13-
from functools import lru_cache, partial
13+
from functools import partial
1414
from pathlib import Path
1515
from typing import Any, Callable, TypeVar, cast
1616

@@ -494,7 +494,6 @@ def __init__(
494494
super().__init__(path=path, string=string, obj=obj)
495495
self.use_tomlkit = use_tomlkit
496496

497-
@lru_cache()
498497
def load(self) -> bool:
499498
"""Load a TOML file by its path, a string or a dict."""
500499
if self.path is not None:
@@ -586,7 +585,6 @@ class YamlDoc(BaseDoc):
586585

587586
updater: SensibleYAML
588587

589-
@lru_cache()
590588
def load(self) -> bool:
591589
"""Load a YAML file by its path, a string or a dict."""
592590
self.updater = SensibleYAML()
@@ -663,7 +661,6 @@ def traverse_yaml_tree(yaml_obj: YamlObject, change: JsonDict):
663661
class JsonDoc(BaseDoc):
664662
"""JSON configuration format."""
665663

666-
@lru_cache()
667664
def load(self) -> bool:
668665
"""Load a JSON file by its path, a string or a dict."""
669666
if self.path is not None:

src/nitpick/plugins/base.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
import abc
55
import fnmatch
6-
from functools import lru_cache
76
from pathlib import Path
87
from typing import Iterator
98

@@ -83,7 +82,6 @@ def predefined_special_config(self) -> SpecialConfig: # pylint: disable=no-self
8382
return SpecialConfig()
8483

8584
@mypy_property
86-
@lru_cache()
8785
def nitpick_file_dict(self) -> JsonDict:
8886
"""Nitpick configuration for this file as a TOML dict, taken from the style file."""
8987
return search_json(self.info.project.nitpick_section, f'files."{self.filename}"', {})

src/nitpick/style/fetchers/github.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,7 @@ class GitHubFetcher(HttpFetcher): # pylint: disable=too-few-public-methods
161161
protocols: tuple[str, ...] = (Scheme.GH, Scheme.GITHUB) # type: ignore
162162
domains: tuple[str, ...] = (GITHUB_COM,)
163163

164-
@staticmethod
165-
def _normalize_scheme(scheme: str) -> str:
164+
def _normalize_scheme(self, scheme: str) -> str: # pylint: disable=no-self-use
166165
# Use github:// instead of gh:// in the canonical URL
167166
return Scheme.GITHUB if scheme == Scheme.GH else scheme # type: ignore
168167

0 commit comments

Comments
 (0)