Skip to content

Commit

Permalink
ci: Linter
Browse files Browse the repository at this point in the history
  • Loading branch information
obiwac committed Nov 5, 2024
1 parent 8f7c97b commit e6c2563
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/formatting.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Check formatting

on: [push, pull_request, workflow_dispatch]
on: [push, workflow_dispatch]

jobs:
check_formatting:
Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Linting and extra checks

on: [push, workflow_dispatch]

jobs:
run_lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up compiler
uses: egor-tensin/setup-clang@v1
with:
version: latest
platform: x64
- name: Get all source files
run: echo "SRC='$(find src -name "*.[ch]" -o -path src/flamingo -prune -type f)'" >> $GITHUB_ENV
- name: Build (with LSP output)
run: intercept-build sh build.sh
- name: Run clang-tidy
run: clang-tidy $SRC
- name: Make sure 'mkdir_wrapped' is used everywhere (except for once for 'fsutils.c')
run: |
if [ $(cat $SRC | grep "[^\"]mkdir(" | wc -l) -gt 1 ]; then
echo "Error: 'mkdir' is used in multiple places. Use 'mkdir_wrapped' instead."
exit 1
fi

0 comments on commit e6c2563

Please sign in to comment.