Skip to content

Commit 8e2c839

Browse files
Merge branch 'main' into CCM-6104-AMET-Structure
2 parents 8c34b83 + 61b18d1 commit 8e2c839

File tree

4 files changed

+62
-1
lines changed

4 files changed

+62
-1
lines changed

.tool-versions

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ act 0.2.64
22
gitleaks 8.18.4
33
pre-commit 3.6.0
44
terraform 1.9.2
5-
vale 3.6.0
65
tfsec 1.28.10
6+
vale 3.6.0
77

88
# ==============================================================================
99
# The section below is reserved for Docker image versions.

scripts/config/gitleaks.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,9 @@ paths = [
2222
'''yarn.lock''',
2323
'''Gemfile.lock''',
2424
]
25+
26+
# Exclude Chrome version in user agent
27+
regexTarget = "line"
28+
regexes = [
29+
'''Chrome/[\d.]+'''
30+
]

scripts/config/pre-commit.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@ repos:
1515
- id: pretty-format-json
1616
args: ['--autofix']
1717
# - id: ...
18+
- repo: local
19+
hooks:
20+
- id: sort-dictionary
21+
name: Sort dictionary
22+
entry: ./scripts/githooks/sort-dictionary.sh
23+
language: script
24+
pass_filenames: false
1825
- repo: local
1926
hooks:
2027
- id: scan-secrets
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#!/bin/bash
2+
3+
set -euo pipefail
4+
5+
# Pre-commit git hook to sort the Vale dictionary in a consistent manner to avoid future merge conflicts and aid insertion of new terms
6+
#
7+
# Usage:
8+
# $ [options] ./sort-dictionary.sh
9+
#
10+
# Options:
11+
#
12+
#
13+
# Exit codes:
14+
# 0 - Successfully sorted the dictionary
15+
# non-zero - failed to sort dictionary
16+
17+
# ==============================================================================
18+
19+
function main() {
20+
root=scripts/config/vale/styles/config/vocabularies/words
21+
opts="--dictionary-order --ignore-case -s"
22+
sort $opts $root/accept.txt > $root/accept.sorted.txt
23+
sort $opts $root/reject.txt > $root/reject.sorted.txt
24+
25+
mv $root/accept.sorted.txt $root/accept.txt
26+
mv $root/reject.sorted.txt $root/reject.txt
27+
28+
git add -uv $root/*
29+
}
30+
31+
# ==============================================================================
32+
33+
function is-arg-true() {
34+
35+
if [[ "$1" =~ ^(true|yes|y|on|1|TRUE|YES|Y|ON)$ ]]; then
36+
return 0
37+
else
38+
return 1
39+
fi
40+
}
41+
42+
# ==============================================================================
43+
44+
is-arg-true "${VERBOSE:-false}" && set -x
45+
46+
main "$@"
47+
48+
exit 0

0 commit comments

Comments
 (0)