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

Pre-commit fixes #1047

Merged
merged 3 commits into from
Jan 10, 2025
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
16 changes: 8 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
default_stages: [pre-commit]
repos:
- repo: https://github.com/ambv/black
rev: 24.3.0
rev: 24.10.0
hooks:
- id: black
language_version: python3
exclude: snap_

- repo: https://github.com/PyCQA/flake8
rev: 3.9.2
rev: 7.1.1
hooks:
- id: flake8

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
rev: v5.0.0
hooks:
- id: check-json
- id: check-added-large-files
- id: check-yaml

- repo: https://github.com/Woile/commitizen
rev: v2.35.0
rev: v4.1.0
hooks:
- id: commitizen
# don't forget to run pre-commit install --hook-type commit-msg for this hook to run
stages: [commit-msg]

- repo: https://github.com/pre-commit/mirrors-prettier # to format JSON, YAML and markdown files among others
rev: v2.4.1
rev: v4.0.0-alpha.8
hooks:
- id: prettier

- repo: https://github.com/pycqa/isort
rev: 5.12.0
rev: 5.13.2
hooks:
- id: isort

Expand All @@ -46,7 +46,7 @@ repos:
files: '^README\.md$'

- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.19.0
rev: 0.31.0
hooks:
- id: check-github-workflows

Expand Down Expand Up @@ -90,7 +90,7 @@ repos:
hooks:
- id: import-linter-config
name: Import Linter Config Check
entry: pdm run ./scripts/check-import-linter-config.sh
entry: ./scripts/check-import-linter-config.sh
language: system
pass_filenames: false
types: [python]
Expand Down
2 changes: 1 addition & 1 deletion ggshield/verticals/secret/secret_scan_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ def get_incident_details(self, client: GGClient) -> Dict[str, SecretIncident]:
resp = client.retrieve_secret_incident(
incident_id, with_occurrences=0
)
if type(resp) == SecretIncident:
if isinstance(resp, SecretIncident):
incident_details[url] = resp
else:
assert isinstance(resp, Detail)
Expand Down
4 changes: 3 additions & 1 deletion scripts/check-import-linter-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ $ git add .importlinter
'

cd "$(dirname $0)/.."
if ! diff --color -u .importlinter <(./scripts/generate-import-linter-config.py) ; then
if ! diff --color --ignore-all-space --unified \
.importlinter <(pdm run ./scripts/generate-import-linter-config.py)
then
printf "${ERROR_MSG}"
exit 1
fi