diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 000000000..200463757 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,32 @@ +name: Lint +on: [push] +jobs: + diff-upstream: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + + - name: install kernel headers + run: | + sudo apt update + sudo apt install -y linux-headers-$(uname -r) + + - name: checkpatch + shell: bash + run: | + cd /lib/modules/$(uname -r)/build + touch COPYING CREDITS MAINTAINERS README + scripts/checkpatch.pl --ignore \ + LINUX_VERSION_CODE,CONSTANT_COMPARISON \ + -f ${GITHUB_WORKSPACE}/src/kmod/{rex.c,rex.h,rex_trace.h} \ + --codespell --codespellfile \ + /usr/lib/python3/dist-packages/codespell_lib/data/dictionary.txt + + - name: coccicheck + run: | + make -C /lib/modules/$(uname -r)/build \ + C=2 CHECK=/lib/modules/$(uname -r)/build/scripts/coccicheck \ + PYTHONHOME=/usr \ + M=$PWD/src \ + -j$(nproc) kmod/rex.o \ + | grep --line-buffered --color -E "WARNING|\$"