aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMario Trangoni <mjtrangoni@gmail.com>2021-01-31 10:29:14 +0100
committerMario Trangoni <mjtrangoni@gmail.com>2021-02-06 18:13:39 +0100
commit637d6d733a96557c3c9aa345c23c9b233bb6710e (patch)
tree461310decbf44643edaad4dd10cb6e0654c61e0a
parent763a9ee0ef774114f06e57edb3869ba5bfed6feb (diff)
downloadnx-libs-637d6d733a96557c3c9aa345c23c9b233bb6710e.tar.gz
nx-libs-637d6d733a96557c3c9aa345c23c9b233bb6710e.tar.bz2
nx-libs-637d6d733a96557c3c9aa345c23c9b233bb6710e.zip
Add shellcheck and cppcheck linters
Signed-off-by: Mario Trangoni <mjtrangoni@gmail.com>
-rw-r--r--.github/workflows/linters.yml47
1 files changed, 47 insertions, 0 deletions
diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml
new file mode 100644
index 000000000..936db9c8b
--- /dev/null
+++ b/.github/workflows/linters.yml
@@ -0,0 +1,47 @@
+name: linters
+
+on:
+ push:
+ branches: [ 3.6.x ]
+ pull_request:
+ branches: [ 3.6.x ]
+
+jobs:
+ shellcheck:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v2
+
+ - name: Install linters on ubuntu
+ run: |
+ sudo apt-get update
+ sudo apt-get install shellcheck
+
+ - name: run Shellcheck
+ run: |
+ find . -name "*.sh" | xargs shellcheck || true
+
+ cppcheck:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v2
+
+ - name: Install linters on ubuntu
+ run: |
+ sudo apt-get update
+ sudo apt-get install cppcheck
+
+ - name: run cppcheck
+ run: |
+ # cppcheck
+ if ! [ -x "$(command -v cppcheck)" ]; then
+ echo 'Error: cppcheck is not installed.' >&2
+ exit 1
+ fi
+ CPPCHECK_OPTS='--error-exitcode=0 --force --quiet --suppressions-list=./static-analysis-suppressions'
+ # we exclude some external projects
+ CPPCHECK_EXCLUDES='-i ./nx-X11/extras/ -i nx-X11/programs/Xserver/GL/mesa* -i ./.pc -i ./nx-X11/.build-exports -i ./nx-X11/exports -i ./doc'
+ echo "$(cppcheck --version):";
+ cppcheck $CPPCHECK_OPTS $CPPCHECK_EXCLUDES .;