Skip to content

Commit a22776b

Browse files
committed
test: add GitHub Actions workflow for line length and trailing lines checks
1 parent 91c0c6b commit a22776b

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

.github/workflows/lint.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Test
2+
3+
on: push
4+
5+
jobs:
6+
test:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Checkout
10+
uses: actions/checkout@v2
11+
with:
12+
lfs: true
13+
14+
- name: Check line length of lox files
15+
run: |
16+
# Run check_line_length and capture output
17+
output=$(make check_line_length)
18+
19+
# Check if the output contains "ERROR"
20+
if echo "$output" | grep -q "ERROR"; then
21+
echo "::error::Line length check failed. Some files have lines exceeding the maximum length."
22+
echo "$output"
23+
exit 1
24+
else
25+
echo "Line length check passed."
26+
fi
27+
28+
- name: Check empty trailing lines in lox files
29+
run: |
30+
# Run check_empty_trailing_lines and capture output
31+
output=$(make check_empty_trailing_lines)
32+
33+
# Check if the output contains "ERROR"
34+
if echo "$output" | grep -q "ERROR"; then
35+
echo "::error::Empty trailing lines check failed. Some files have empty trailing lines."
36+
echo "$output"
37+
exit 1
38+
else
39+
echo "Empty trailing lines check passed."
40+
fi

0 commit comments

Comments
 (0)