Skip to content

Commit

Permalink
Merge pull request #233 from macisamuele/maci-bump-pre-commit
Browse files Browse the repository at this point in the history
Bump pre commit configs
  • Loading branch information
macisamuele authored Jul 13, 2024
2 parents 37ef1db + 80f56a5 commit a1690c6
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 19 deletions.
7 changes: 1 addition & 6 deletions .github/workflows/bump_external_releases.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,7 @@ def bump_palantir_java_formatter():
)


bump_functions = (
bump_ktfmt,
bump_ktlint,
bump_google_java_formatter,
bump_palantir_java_formatter
)
bump_functions = (bump_ktfmt, bump_ktlint, bump_google_java_formatter, bump_palantir_java_formatter)

if __name__ == "__main__":
something_is_bumped = False
Expand Down
18 changes: 9 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
default_language_version:
python: python3.10
python: python3.12

repos:
- repo: https://github.com/pre-commit/pre-commit
rev: v3.7.0
rev: v3.7.1
hooks:
- id: validate_manifest
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.6.0
hooks:
- id: check-added-large-files
- id: check-docstring-first
Expand All @@ -27,7 +27,7 @@ repos:
exclude: ^test-data/.*$
- id: fix-encoding-pragma
- repo: https://github.com/asottile/reorder_python_imports
rev: v3.12.0
rev: v3.13.0
hooks:
- id: reorder-python-imports
args:
Expand All @@ -38,31 +38,31 @@ repos:
- --remove-import
- from __future__ import unicode_literals
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
rev: v2.12.0
rev: v2.13.0
hooks:
- id: pretty-format-yaml
exclude: ^test-data/.*$
args:
- --autofix
- repo: https://github.com/ambv/black
rev: 24.3.0
rev: 24.4.2
hooks:
- id: black
args: [--config, .black.toml]
- repo: https://github.com/PyCQA/flake8
rev: 7.0.0
rev: 7.1.0
hooks:
- id: flake8
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.9.0
rev: v1.10.1
hooks:
- id: mypy
exclude: ^(\.github/workflows/bump_external_releases\.py)$
additional_dependencies:
- types-requests
- types-setuptools
- repo: https://github.com/PyCQA/bandit
rev: 1.7.8
rev: 1.7.9
hooks:
- id: bandit
exclude: ^tests/.*\.py$
3 changes: 2 additions & 1 deletion language_formatters_pre_commit_hooks/pretty_format_java.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ def get_urls(_version: str) -> typing.List[str]:
),
)


@java_required
def pretty_format_java(argv: typing.Optional[typing.List[str]] = None) -> int:
parser = argparse.ArgumentParser()
Expand Down Expand Up @@ -223,7 +224,7 @@ def format_palantir(args):
]
if args.aosp: # pragma: no cover
cmd_args.append("--aosp")
if args.autofix: # pragma: no cover
if args.autofix: # pragma: no cover
cmd_args.append("--replace")
else:
cmd_args.append("--dry-run")
Expand Down
4 changes: 1 addition & 3 deletions tests/pretty_format_java_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@ def test__download_google_java_formatter_jar(ensure_download_possible, version):

@pytest.mark.parametrize(
"version",
(
_get_default_version("palantir"),
),
(_get_default_version("palantir"),),
)
@pytest.mark.integration
def test__download_palantir_java_formatter_jar(ensure_download_possible, version): # noqa: F811
Expand Down

0 comments on commit a1690c6

Please sign in to comment.