Skip to content

Commit 29bf183

Browse files
committed
github: workflow: Check for EOF newline
The C standard requires that "A source file that is not empty shall end with a newline character, which shall not be immediately preceded by a backslash character before any such splicing takes place." This workflow ensures compliance with this requirement. Signed-off-by: Yasushi SHOJI <[email protected]>
1 parent a31faec commit 29bf183

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

.github/workflows/linelint.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: EOF newline
2+
3+
on:
4+
pull_request
5+
6+
jobs:
7+
linelint:
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v4
13+
14+
- name: Linelint
15+
uses: fernandrone/linelint@master

.linelint.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# 'true' will fix files
2+
autofix: false
3+
4+
# list of paths to ignore, uses gitignore syntaxes (executes before any rule)
5+
ignore:
6+
- /.git
7+
- /zephyr
8+
9+
rules:
10+
# checks if file ends in a newline character
11+
end-of-file:
12+
# set to true to enable this rule
13+
enable: true
14+
15+
# set to true to disable autofix (if enabled globally)
16+
disable-autofix: true
17+
18+
# if true also checks if file ends in a single newline character
19+
single-new-line: true

0 commit comments

Comments
 (0)