File tree Expand file tree Collapse file tree 4 files changed +53
-0
lines changed
Expand file tree Collapse file tree 4 files changed +53
-0
lines changed Original file line number Diff line number Diff line change 1010exec 1>&2
1111
1212.github/lint-disallowed-functions-in-library.sh
13+ .github/lint-no-trailing-newline-in-log-messages.sh
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ #
4+ # DO NOT EDIT THIS FILE
5+ #
6+ # It is automatically copied from https://github.com/pion/.goassets repository.
7+ #
8+ # If you want to update the shared CI config, send a PR to
9+ # https://github.com/pion/.goassets instead of this repository.
10+ #
11+
12+ set -e
13+
14+ # Disallow usages of functions that cause the program to exit in the library code
15+ SCRIPT_PATH=$( cd " $( dirname " ${BASH_SOURCE[0]} " ) " ; pwd -P )
16+ if [ -f ${SCRIPT_PATH} /.ci.conf ]
17+ then
18+ . ${SCRIPT_PATH} /.ci.conf
19+ fi
20+
21+ files=$(
22+ find " $SCRIPT_PATH /.." -name " *.go" \
23+ | while read file
24+ do
25+ excluded=false
26+ for ex in $EXCLUDE_DIRECTORIES
27+ do
28+ if [[ $file == * /$ex /* ]]
29+ then
30+ excluded=true
31+ break
32+ fi
33+ done
34+ $excluded || echo " $file "
35+ done
36+ )
37+
38+ if grep -E ' \.(Trace|Debug|Info|Warn|Error)f?\("[^"]*\\n"\)?' $files | grep -v -e ' nolint' ; then
39+ echo " Log format strings should have trailing new-line"
40+ exit 1
41+ fi
Original file line number Diff line number Diff line change 1818 - name : Checkout repo
1919 uses : actions/checkout@v3
2020
21+ # The code in examples/ might intentionally do things like log credentials
22+ # in order to show how the library is used, aid in debugging etc. We
23+ # should ignore those for CodeQL scanning, and only focus on the package
24+ # itself.
25+ - name : Remove example code
26+ run : |
27+ rm -rf examples/
28+
2129 - name : Initialize CodeQL
2230 uses : github/codeql-action/init@v2
2331 with :
Original file line number Diff line number Diff line change 3636 - name : Functions
3737 run : .github/lint-disallowed-functions-in-library.sh
3838
39+ - name : Logging messages should not have trailing newlines
40+ run : .github/lint-no-trailing-newline-in-log-messages.sh
41+
3942 lint-go :
4043 name : Go
4144 runs-on : ubuntu-latest
You can’t perform that action at this time.
0 commit comments