Skip to content

Commit 1cafe9a

Browse files
committed
Move lint and format back to Makefile
1 parent 4c91ec9 commit 1cafe9a

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,5 @@ jobs:
3030
- name: Install clang-format
3131
run: sudo apt-get install -y clang-format
3232

33-
- name: Check formatting
34-
run: |
35-
find . -name '*.[ch]' -not -path './vendor/*' | xargs clang-format -i
36-
git diff --exit-code || (echo "❌ Code formatting check failed! Run clang-format locally and commit changes." && exit 1)
33+
- name: Lint
34+
run: bin/lint

Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,9 @@ test: $(test_objects) $(non_main_objects)
4848
clean:
4949
rm -f $(exec) $(test_exec) $(lib_name) $(ruby_extension)
5050
rm -rf src/*.o test/*.o lib/erbx/*.bundle tmp
51+
52+
format:
53+
clang-format -i $(wildcard src/*.c) $(wildcard src/**/*.c) $(wildcard src/*.h) $(wildcard src/**/*.h) $(wildcard ext/**/*.c) $(wildcard ext/**/*.h)
54+
55+
lint:
56+
clang-format --dry-run --Werror $(wildcard src/*.c) $(wildcard src/**/*.c) $(wildcard src/*.h) $(wildcard src/**/*.h) $(wildcard ext/**/*.c) $(wildcard ext/**/*.h)

bin/format

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
set -e # Exit on error
44

5-
clang-format -i src/*.c src/**/*.c src/*.h src/**/*.h ext/**/*.c ext/**/*.h
5+
make format
66

77
echo "Formatting complete!"

bin/lint

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
set -e # Exit on error
44

5-
clang-format --dry-run --Werror src/*.c src/**/*.c src/*.h src/**/*.h ext/**/*.c ext/**/*.h
5+
make lint
66

77
echo "Linting complete!"

0 commit comments

Comments
 (0)