Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#654)
Browse files Browse the repository at this point in the history
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.3.5 → v0.4.4](astral-sh/ruff-pre-commit@v0.3.5...v0.4.4)
- [github.com/psf/black: 24.3.0 → 24.4.2](psf/black@24.3.0...24.4.2)
- [github.com/pre-commit/mirrors-mypy: v1.9.0 → v1.10.0](pre-commit/mirrors-mypy@v1.9.0...v1.10.0)
- [github.com/commitizen-tools/commitizen: v3.21.3 → v3.25.0](commitizen-tools/commitizen@v3.21.3...v3.25.0)

* build: fix mypy warnings

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: W. Augusto Andreoli <andreoliwa@sent.com>
  • Loading branch information
pre-commit-ci[bot] and andreoliwa committed May 17, 2024
1 parent 7c4ae18 commit cb472c9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ repos:
# - poetry.lock: auto-generated file
exclude: (ideas/|resources/|tests/|poetry.lock)
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.5
rev: v0.4.4
hooks:
- id: ruff
args: [--fix]
Expand All @@ -66,7 +66,7 @@ repos:
hooks:
- id: sort-all
- repo: https://github.com/psf/black
rev: 24.3.0
rev: 24.4.2
hooks:
- id: black
args: [--safe, --quiet]
Expand All @@ -86,7 +86,7 @@ repos:
- id: prettier
stages: [commit]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.9.0
rev: v1.10.0
hooks:
- id: mypy
# https://mypy.readthedocs.io/en/stable/command_line.html#cmdoption-mypy-show-error-codes
Expand Down Expand Up @@ -131,7 +131,7 @@ repos:
# https://docs.openstack.org/bashate/latest/man/bashate.html#options
args: [-i, E006]
- repo: https://github.com/commitizen-tools/commitizen
rev: v3.21.3
rev: v3.25.0
hooks:
- id: commitizen
stages: [commit-msg]
4 changes: 2 additions & 2 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ autorepr==0.3.0 ; python_version >= "3.8" and python_version < "4.0"
babel==2.13.0 ; python_version >= "3.8" and python_version < "4.0"
cattrs==23.1.2 ; python_version >= "3.8" and python_version < "4.0"
certifi==2023.7.22 ; python_version >= "3.8" and python_version < "4.0"
charset-normalizer==3.3.2 ; python_version >= "3.8" and python_version < "4.0"
charset-normalizer==3.3.0 ; python_version >= "3.8" and python_version < "4.0"
click==8.1.7 ; python_version >= "3.8" and python_version < "4.0"
colorama==0.4.6 ; python_version >= "3.8" and python_version < "4.0" and (platform_system == "Windows" or sys_platform == "win32")
configupdater==3.1.1 ; python_version >= "3.8" and python_version < "4.0"
Expand All @@ -20,7 +20,7 @@ identify==2.5.30 ; python_version >= "3.8" and python_version < "4.0"
idna==3.7 ; python_version >= "3.8" and python_version < "4.0"
imagesize==1.4.1 ; python_version >= "3.8" and python_version < "4.0"
importlib-metadata==6.8.0 ; python_version >= "3.8" and python_version < "3.10"
importlib-resources==6.4.0 ; python_version >= "3.8" and python_version < "3.9"
importlib-resources==6.1.0 ; python_version >= "3.8" and python_version < "3.9"
iniconfig==2.0.0 ; python_version >= "3.8" and python_version < "4.0"
jinja2==3.1.3 ; python_version >= "3.8" and python_version < "4.0"
jmespath==1.0.1 ; python_version >= "3.8" and python_version < "4.0"
Expand Down
8 changes: 5 additions & 3 deletions src/nitpick/flake8.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,20 @@ def collect_errors(self) -> Iterator[Fuss]:
if current_python_file.absolute() != main_python_file.absolute():
# Only report warnings once, for the main Python file of this project.
logger.debug("Ignoring other Python file: {}", self.filename)
return []
return

logger.debug("Nitpicking file through flake8: {}", self.filename)
yield from nit.run()
return []
return

@staticmethod
@lru_cache # To avoid calling this function twice in the same process
def add_options(option_manager: OptionManager):
"""Add the offline option."""
option_manager.add_option(
Flake8OptionEnum.OFFLINE.as_flake8_flag(), action="store_true", help=Flake8OptionEnum.OFFLINE.value
Flake8OptionEnum.OFFLINE.as_flake8_flag(),
action="store_true",
help=Flake8OptionEnum.OFFLINE.value,
)

@staticmethod
Expand Down

0 comments on commit cb472c9

Please sign in to comment.