Skip to content

Commit e1f78c7

Browse files
authored
Merge pull request #1108 from GitGuardian/severine/pre-commit-prettier
chore: change pre-commit hook for prettier
2 parents 95738b6 + c3f89cf commit e1f78c7

File tree

7 files changed

+14
-11
lines changed

7 files changed

+14
-11
lines changed

.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ GITGUARDIAN_INSTANCE=https://dashboard.gitguardian.com/
1515
# - set TEST_GG_VALID_TOKEN to this value
1616
# - and set TEST_GG_VALID_TOKEN_IGNORE_SHA to matching commit sha
1717
# TEST_GG_VALID_TOKEN=
18-
# TEST_GG_VALID_TOKEN_IGNORE_SHA=
18+
# TEST_GG_VALID_TOKEN_IGNORE_SHA=

.pre-commit-config.yaml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,14 @@ repos:
1515
- repo: https://github.com/pre-commit/pre-commit-hooks
1616
rev: v5.0.0
1717
hooks:
18+
- id: trailing-whitespace
19+
exclude: .importlinter|tests/unit/verticals/secret/output/snapshots/*|tests/unit/core/scan/test_commit_utils.py
1820
- id: check-json
1921
- id: check-added-large-files
2022
- id: check-yaml
23+
- id: check-toml
24+
- id: end-of-file-fixer
25+
exclude: .importlinter
2126

2227
- repo: https://github.com/Woile/commitizen
2328
rev: v4.1.0
@@ -26,8 +31,8 @@ repos:
2631
# don't forget to run pre-commit install --hook-type commit-msg for this hook to run
2732
stages: [commit-msg]
2833

29-
- repo: https://github.com/pre-commit/mirrors-prettier # to format JSON, YAML and markdown files among others
30-
rev: v4.0.0-alpha.8
34+
- repo: https://github.com/rbubley/mirrors-prettier
35+
rev: v3.6.0
3136
hooks:
3237
- id: prettier
3338

CHANGELOG.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,6 @@ Yanked: release process issue.
551551
#### IaC
552552

553553
- `ggshield iac scan` now provides three new commands for use as Git hooks:
554-
555554
- `ggshield iac scan pre-commit`
556555
- `ggshield iac scan pre-push`
557556
- `ggshield iac scan pre-receive`
@@ -636,7 +635,6 @@ Yanked: release process issue.
636635
- New command: `ggshield iac scan all`. This command replaces the now-deprecated `ggshield iac scan`. It scans a directory for IaC vulnerabilities.
637636

638637
- New command: `ggshield iac scan diff`. This command scans a Git repository and inspects changes in IaC vulnerabilities between two points in the history.
639-
640638
- All options from `ggshield iac scan all` are supported: `--ignore-policy`, `--minimum-severity`, `--ignore-path` etc. Execute `ggshield iac scan diff -h` for more details.
641639
- Two new options allow to choose which state to select for the difference: `--ref <GIT-REFERENCE>` and `--staged`.
642640
- The command can be integrated in Git hooks using the `--pre-commit`, `--pre-push`, `--pre-receive` options.

scripts/build-os-packages/windows-functions.bash

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ windows_build_chocolatey_package() {
5252
info "Chocolatey package created in $PACKAGES_DIR/ggshield.$VERSION.nupkg"
5353

5454
rm -rf choco-package
55-
55+
5656
}
5757

5858
# cf https://docs.chocolatey.org/en-us/create/create-packages/#testing-your-package
@@ -65,4 +65,4 @@ test_chocolatey_package() {
6565
create_windows_packages() {
6666
windows_create_archive
6767
windows_build_chocolatey_package
68-
}
68+
}

scripts/chocolatey/VERIFICATION.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ $hashes2 = Get-ChildItem -Path $folder2 -Recurse -File | ForEach-Object {
2828
}
2929
}
3030

31-
Compare-Object -ReferenceObject $hashes1 -DifferenceObject $hashes2 -Property RelativePath, Hash
31+
Compare-Object -ReferenceObject $hashes1 -DifferenceObject $hashes2 -Property RelativePath, Hash

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ max-line-length = 120
55
ignore = E203, E704, W503
66
exclude = **/snapshots/*.py, .venv, build
77
per-file-ignores =
8-
tests/unit/conftest.py: E501
8+
tests/unit/conftest.py: E501

tests/unit/data/archives/generate-archives

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ set -euo pipefail
1313
# subdir/fine-symlink -> ../fine
1414
#
1515
# It also createst good.zip, good.whl and good.tar, which only contain:
16-
#
16+
#
1717
# fine
1818
# subdir/fine-symlink -> ../fine
1919

@@ -54,7 +54,7 @@ mkdir -p work/archive-root/subdir
5454
ZIP_CMD="7z a"
5555
7z a -spf -snl "$BAD_ZIP" ../bad-relative /tmp/bad-absolute . > /dev/null
5656
7z a "$GOOD_ZIP" fine subdir/fine-symlink > /dev/null
57-
57+
5858
# A .jar is a .zip with a different extension
5959

6060
cp "$BAD_ZIP" "$BAD_JAR"

0 commit comments

Comments
 (0)