Skip to content

Commit 28f5153

Browse files
authored
Merge pull request #1047 from GitGuardian/agateau/pre-commit-fixes
Pre-commit fixes
2 parents 276a186 + 851fcc3 commit 28f5153

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

.pre-commit-config.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,38 @@
11
default_stages: [pre-commit]
22
repos:
33
- repo: https://github.com/ambv/black
4-
rev: 24.3.0
4+
rev: 24.10.0
55
hooks:
66
- id: black
77
language_version: python3
88
exclude: snap_
99

1010
- repo: https://github.com/PyCQA/flake8
11-
rev: 3.9.2
11+
rev: 7.1.1
1212
hooks:
1313
- id: flake8
1414

1515
- repo: https://github.com/pre-commit/pre-commit-hooks
16-
rev: v4.0.1
16+
rev: v5.0.0
1717
hooks:
1818
- id: check-json
1919
- id: check-added-large-files
2020
- id: check-yaml
2121

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

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

3434
- repo: https://github.com/pycqa/isort
35-
rev: 5.12.0
35+
rev: 5.13.2
3636
hooks:
3737
- id: isort
3838

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

4848
- repo: https://github.com/python-jsonschema/check-jsonschema
49-
rev: 0.19.0
49+
rev: 0.31.0
5050
hooks:
5151
- id: check-github-workflows
5252

@@ -90,7 +90,7 @@ repos:
9090
hooks:
9191
- id: import-linter-config
9292
name: Import Linter Config Check
93-
entry: pdm run ./scripts/check-import-linter-config.sh
93+
entry: ./scripts/check-import-linter-config.sh
9494
language: system
9595
pass_filenames: false
9696
types: [python]

ggshield/verticals/secret/secret_scan_collection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ def get_incident_details(self, client: GGClient) -> Dict[str, SecretIncident]:
290290
resp = client.retrieve_secret_incident(
291291
incident_id, with_occurrences=0
292292
)
293-
if type(resp) == SecretIncident:
293+
if isinstance(resp, SecretIncident):
294294
incident_details[url] = resp
295295
else:
296296
assert isinstance(resp, Detail)

scripts/check-import-linter-config.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ $ git add .importlinter
1111
'
1212

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

0 commit comments

Comments
 (0)