File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -940,11 +940,14 @@ RUN apt-get update && apt-get dist-upgrade -yy && apt-get install -yy \
940
940
wget \
941
941
xxd
942
942
943
+ RUN pip install --break-system-packages --upgrade "git+https://github.com/ibm/detect-secrets.git@master#egg=detect-secrets"
944
+
943
945
RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 14 \
944
946
--slave /usr/bin/g++ g++ /usr/bin/g++-14 \
945
947
--slave /usr/bin/gcov gcov /usr/bin/gcov-14 \
946
948
--slave /usr/bin/gcov-dump gcov-dump /usr/bin/gcov-dump-14 \
947
949
--slave /usr/bin/gcov-tool gcov-tool /usr/bin/gcov-tool-14
950
+
948
951
RUN update-alternatives --remove cpp /usr/bin/cpp && \
949
952
update-alternatives --install /usr/bin/cpp cpp /usr/bin/cpp-14 14
950
953
Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ LINTERS_ALL=( \
37
37
markdownlint \
38
38
prettier \
39
39
shellcheck \
40
+ detect_secrets \
40
41
)
41
42
LINTERS_DISABLED=()
42
43
LINTERS_ENABLED=()
@@ -278,6 +279,13 @@ function do_clang_format() {
278
279
" ${CLANG_FORMAT} " -i " $@ "
279
280
}
280
281
282
+ LINTER_REQUIRE+=([detect_secrets]=" detect-secrets;.secrets.baseline" )
283
+ LINTER_TYPES+=([detect_secrets]=" c;cpp;bash;sh;json;python" )
284
+ function do_detect_secrets() {
285
+ detect-secrets scan --update .secrets.baseline
286
+ detect-secrets audit --report --fail-on-unaudited --fail-on-live --fail-on-audited-real .secrets.baseline
287
+ }
288
+
281
289
function get_file_type()
282
290
{
283
291
case " $( basename " $1 " ) " in
433
441
# Check for differences.
434
442
if [ -z " $OPTION_NO_DIFF " ]; then
435
443
echo -e " ${BLUE} Result differences...${NORMAL} "
436
- if ! git --no-pager diff --exit-code ; then
444
+ # .secrets.baseline will have its date updated everytime we run so
445
+ # just restore it
446
+ if [ -e .secrets.baseline ]
447
+ then
448
+ git restore .secrets.baseline
449
+ fi
450
+ if ! git --no-pager diff --exit-code; then
437
451
echo -e " Format: ${RED} FAILED${NORMAL} "
438
452
exit 1
439
453
else
You can’t perform that action at this time.
0 commit comments