Skip to content

Commit 770d40a

Browse files
chore: use cpp-linter instead of inhouse linter
1 parent c9d9cf8 commit 770d40a

File tree

1 file changed

+9
-36
lines changed

1 file changed

+9
-36
lines changed

.github/workflows/awesome_workflow.yml

Lines changed: 9 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -9,42 +9,14 @@ jobs:
99
runs-on: ubuntu-latest
1010
steps:
1111
- uses: actions/checkout@v4
12+
- uses: cpp-linter/cpp-linter-action@v2
13+
id: linter
14+
env:
15+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1216
with:
13-
fetch-depth: 0
14-
- uses: actions/setup-python@v4
15-
- name: requirements
16-
run: |
17-
sudo apt-get -qq update
18-
sudo apt-get -qq install clang-tidy clang-format
19-
# checks are passing with less errors when used with this version.
20-
# The default installs v6.0 which did not work out well in my tests
21-
- name: Setup Git Specs
22-
run: |
23-
git config --global user.name github-actions[bot]
24-
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
25-
- name: Filename Formatter
26-
run: |
27-
wget https://raw.githubusercontent.com/TheAlgorithms/scripts/main/filename_formatter.sh
28-
chmod +x filename_formatter.sh
29-
./filename_formatter.sh . .cpp,.hpp
30-
- name: Get file changes
31-
run: |
32-
git branch
33-
git diff --diff-filter=dr --name-only origin/master > git_diff.txt
34-
echo "Files changed-- `cat git_diff.txt`"
35-
- name: Configure for static lint checks
36-
# compiling first gives clang-tidy access to all the header files and settings used to compile the programs.
37-
# This will check for macros, if any, on linux and not for Windows. But the use of portability checks should
38-
# be able to catch any errors for other platforms.
39-
run: cmake -B build -S . -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
40-
- name: Lint modified files
41-
shell: bash
42-
run: python3 scripts/file_linter.py
43-
- name: Commit and push changes
44-
run: |
45-
git diff DIRECTORY.md
46-
git commit -am "clang-format and clang-tidy fixes for ${GITHUB_SHA::8}" || true
47-
git push origin HEAD:$GITHUB_REF || true
17+
style: "file"
18+
tidy-checks: ".clang-tidy"
19+
thread-comments: ${{ github.event_name == 'pull_request' && 'update' }}
4820

4921
build:
5022
name: Compile checks
@@ -59,7 +31,8 @@ jobs:
5931
- uses: actions/checkout@v4
6032
with:
6133
submodules: true
62-
- uses: root-project/gcc-problem-matcher-improved@v1
34+
- name: GCC problem matcher
35+
uses: ammaraskar/[email protected]
6336
- run: |
6437
cmake -B ./build -S .
6538
cmake --build build --parallel 4

0 commit comments

Comments
 (0)