Skip to content

Commit

Permalink
⬆️ UPGRADE: Autoupdate pre-commit config (#61)
Browse files Browse the repository at this point in the history
* ⬆️ UPGRADE: Autoupdate pre-commit config

* 🔧🧹 Removed interrogate pre-push hook

* 🩹📚 Fixed typo

* 🔧👌 Sorted pre-commit hooks to run more effectively

* 🔧🩹 Fixed rstcheck hook config

* 🔧🧹 Ignore false positive type error

Ref.: python/typeshed#7767

Co-authored-by: s-weigand <s-weigand@users.noreply.github.com>
  • Loading branch information
s-weigand and s-weigand committed Aug 27, 2022
1 parent 70554e1 commit 77de079
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 34 deletions.
44 changes: 18 additions & 26 deletions .pre-commit-config.yaml
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.2.0
rev: v4.3.0
hooks:
- id: check-ast
- id: check-builtin-literals
Expand All @@ -11,7 +11,7 @@ repos:
args: [--remove]

- repo: https://github.com/asottile/pyupgrade
rev: v2.32.0
rev: v2.37.3
hooks:
- id: pyupgrade
args: [--py36-plus]
Expand All @@ -22,28 +22,35 @@ repos:
- id: isort

- repo: https://github.com/python/black
rev: 22.3.0
rev: 22.6.0
hooks:
- id: black
language_version: python3

- repo: https://github.com/asottile/yesqa
rev: v1.4.0
hooks:
- id: yesqa
additional_dependencies: [flake8-docstrings]

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.6.2 # Use the sha or tag you want to point at
rev: v3.0.0-alpha.0 # Use the sha or tag you want to point at
hooks:
- id: prettier

- repo: https://github.com/asottile/setup-cfg-fmt
rev: v1.20.1
rev: v2.0.0
hooks:
- id: setup-cfg-fmt

- repo: https://gitlab.com/pycqa/flake8
rev: 3.9.2
- repo: https://github.com/pycqa/flake8
rev: 5.0.4
hooks:
- id: flake8
additional_dependencies: [flake8-comprehensions, flake8-2020]

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.942
rev: v0.971
hooks:
- id: mypy
exclude: "^(docs|tests/dummy_packages)"
Expand All @@ -69,10 +76,11 @@ repos:
pass_filenames: false

- repo: https://github.com/myint/rstcheck
rev: "v5.0.0"
rev: "v6.1.0"
hooks:
- id: rstcheck
additional_dependencies: [sphinx]
exclude: "^(docs/_templates)"

- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.9.0
Expand All @@ -87,25 +95,9 @@ repos:
- id: rst-inline-touching-normal

- repo: https://github.com/codespell-project/codespell
rev: v2.1.0
rev: v2.2.1
hooks:
- id: codespell
types: [file]
types_or: [python, pyi, markdown, rst, jupyter]
args: [-L nnumber]

- repo: https://github.com/asottile/yesqa
rev: v1.3.0
hooks:
- id: yesqa
additional_dependencies: [flake8-docstrings]

- repo: https://github.com/econchick/interrogate
rev: 1.5.0
hooks:
- id: interrogate
name: Update interrogate badge
args:
[-v, --config=pyproject.toml, -g, docs/_static/interrogate_badge.svg]
pass_filenames: false
stages: [push]
7 changes: 1 addition & 6 deletions setup.cfg
Expand Up @@ -16,11 +16,6 @@ classifiers =
Natural Language :: English
Programming Language :: Python :: 3
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
keywords = verbose_version_info
project_urls =
Documentation=https://verbose-version-info.readthedocs.io
Expand Down Expand Up @@ -71,7 +66,7 @@ convention = numpy
test = pytest

[rstcheck]
ignore_directives = autoattribute,autoclass,autoexception,autofunction,automethod,automodule,highlight
ignore_directives = highlight,autosummary

[mypy]
show_error_codes = True
4 changes: 3 additions & 1 deletion verbose_version_info/resource_finders.py
Expand Up @@ -136,7 +136,9 @@ def egg_link_lines(distribution_name: str) -> Optional[List[str]]:
--------
find_editable_install_basepath
"""
distribution_name = distribution(distribution_name).metadata.get("name")
distribution_name = distribution(distribution_name).metadata.get( # type:ignore[attr-defined]
"name"
)
for path_item in sys.path:
egg_link = os.path.join(path_item, f"{distribution_name}.egg-link")
if os.path.isfile(egg_link):
Expand Down
2 changes: 1 addition & 1 deletion verbose_version_info/settings.py
@@ -1,4 +1,4 @@
"""Module containing all seetings related functionalities."""
"""Module containing all settings related functionalities."""
from copy import copy

DEFAULT_VCS_SETTINGS = {"warn_dirty": True}
Expand Down

0 comments on commit 77de079

Please sign in to comment.