Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(pre-commit): autoupdate ⬆️ #69

Merged
merged 3 commits into from
Feb 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
repos:
### GENERAL ###
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
rev: v9.4.0
rev: v9.10.0
hooks:
- id: commitlint
stages: [commit-msg]
additional_dependencies: ["@commitlint/config-conventional"]

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: check-case-conflict
- id: check-symlinks
Expand All @@ -34,25 +34,25 @@ repos:

# opinionated code formatter for all things frontend (also includes Markdown, JSON, YAML)
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.0-alpha.6
rev: v4.0.0-alpha.8
hooks:
- id: prettier

- repo: https://github.com/adrienverge/yamllint
rev: v1.30.0
rev: v1.33.0
hooks:
- id: yamllint
args: [-c=.yamllint]

### PYTHON ###
- repo: https://github.com/asottile/pyupgrade
rev: v3.3.1
rev: v3.15.0
hooks:
- id: pyupgrade
args: [--py37-plus]

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: check-ast
- id: check-builtin-literals
Expand All @@ -62,32 +62,32 @@ repos:
- id: requirements-txt-fixer

- repo: https://github.com/asottile/setup-cfg-fmt
rev: v2.2.0
rev: v2.5.0
hooks:
- id: setup-cfg-fmt

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.1.1
rev: v1.8.0
hooks:
- id: mypy
additional_dependencies: ["attrs", "types-PyYAML", "types-requests"] # as per setup.cfg

# the uncompromising (opinionated / barely configurable) PEP8 Python code formatter.
- repo: https://github.com/psf/black
rev: "23.3.0"
rev: "23.12.1"
hooks:
- id: black

# isort alternative
- repo: https://github.com/asottile/reorder_python_imports
rev: v3.9.0
- repo: https://github.com/asottile/reorder-python-imports
rev: v3.12.0
hooks:
- id: reorder-python-imports
args: [--py37-plus, --add-import, "from __future__ import annotations"]

# formats docstrings to follow PEP 257.
- repo: https://github.com/PyCQA/docformatter
rev: v1.5.1
rev: v1.7.5
hooks:
- id: docformatter
args: [--in-place]
Expand All @@ -99,7 +99,7 @@ repos:
# some third-party plugins
# …to check the style and quality of python code.
- repo: https://github.com/pycqa/flake8
rev: "6.0.0"
rev: "6.1.0"
hooks:
- id: flake8

Expand Down
17 changes: 8 additions & 9 deletions ansible_roles_scripts/cruft.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,17 +160,16 @@ def main(push: bool, repo_name_filter: str, silent: bool, verbosity: int) -> int
"""Script to loop through all ANSIBLE repositories (`all-repos-in.json`),
execute `cruft update ...` / `pre-commit run ...` and commit the results.
This script relies on the machine executing this script
to have the appropiate command lines tools installed
and accessible from the within current PATH.
This script relies on the machine executing this script to have the
appropiate command lines tools installed and accessible from the
within current PATH.
To actually push the results you need to add the option `-P`
for safety reason.
To actually push the results you need to add the option `-P` for
safety reason.
This script recognizes cruft- and git-conflicts,
aborting the operation for a given repository
if any were found and notifies of the required
manual intervention needed.
This script recognizes cruft- and git-conflicts, aborting the
operation for a given repository if any were found and notifies of
the required manual intervention needed.
"""
utils.init(verbosity=verbosity, silent=silent)
retv = 1
Expand Down
7 changes: 4 additions & 3 deletions ansible_roles_scripts/script_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,8 @@ def get_all_cloned_github_repositories() -> list[Path]:
"""Recurse the 'all-repos' directory and return each directory that has
github info.
:return: A list of directories of which origin/master points to github
:return: A list of directories of which origin/master points to
github
"""

all_repos = [
Expand All @@ -233,8 +234,8 @@ def get_all_cloned_ansible_repositories() -> list[Path]:
"""Recurse the 'all-repos' directory and return each directory that has
cookiecutter info.
:return: A list of directories found to be valid ansible roles
(i.e. cruft'ed from my cookiecutter).
:return: A list of directories found to be valid ansible roles (i.e.
cruft'ed from my cookiecutter).
"""

all_repos = [
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ url = https://github.com/JonasPammer/ansible-roles
author = Jonas Pammer
author_email = opensource@jonaspammer.at
license = MIT
license_file = LICENSE
license_files = LICENSE
classifiers =
Development Status :: 1 - Planning
Environment :: Console
Expand Down
Loading