Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

use maintained cmake-lint fork for codeql workflow #1269

Merged
merged 2 commits into from
Feb 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,22 @@ jobs:
uses: actions/checkout@v3

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y bison check cmake debhelper flex groff libbsd-dev libcurl4-openssl-dev libmaxminddb-dev libgtk-3-dev libgtk2.0-dev libidn11-dev libltdl-dev libluajit-5.1-dev libncurses5-dev libnet1-dev libpcap-dev libpcre3-dev librtmp-dev libssl-dev
- run: |
git clone https://github.com/richq/cmake-lint.git
cd cmake-lint
python setup.py install --user
cd -

- name: CMake formatting check
run: |
pip install cmakelint
./misc/cmakelint.sh

- name: Building software
run: |
mkdir build
cd build
cmake -DENABLE_TESTS=Off $BUILD_ARGS ..
Expand All @@ -51,6 +53,6 @@ jobs:
BUILD_ARGS: ''

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
3 changes: 2 additions & 1 deletion misc/cmakelint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,11 @@ FILTERS=\
+whitespace/newline,\
+whitespace/tabs

echo Running CMake Lint against CMake files
CMAKELINT="cmakelint --filter=$FILTERS --quiet --spaces=2"

FIND="$(find $ECROOT \
-name CMakeLists.txt -not -path "$ECROOT/build*/*" -or \
-name *.cmake -not -path "$ECROOT/build*/*")"

$CMAKELINT $FIND
$CMAKELINT $FIND