aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/linters.yml
blob: 936db9c8b31917a3e1aed3404888a88029f1104c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
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 .;