Skip to content

Commit 2d2c7db

Browse files
add linting for sh and cmake files.
1 parent fdbc424 commit 2d2c7db

46 files changed

Lines changed: 2470 additions & 2134 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.cmake-format

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
format:
2+
tab_size: 2
3+
line_width: 100
4+
dangle_parens: true
5+
max_pargs_hwrap: 3
6+
separate_ctrl_name_with_space: false
7+
separate_fn_name_with_space: false

.editorconfig

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
root = true
2+
3+
[CMakeLists.txt]
4+
indent_style = space
5+
indent_size = 4
6+
end_of_line = lf
7+
charset = utf-8
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true
10+
11+
[*.{sh,sh.in}]
12+
indent_style = space
13+
indent_size = 2
14+
end_of_line = lf
15+
charset = utf-8
16+
trim_trailing_whitespace = true
17+
insert_final_newline = true

.github/workflows/format-check.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,27 @@ jobs:
1313
steps:
1414
- uses: actions/checkout@v4
1515

16+
- name: Set up Go
17+
uses: actions/setup-go@v5
18+
with:
19+
go-version: '1.21'
20+
1621
- name: Install clang-format
1722
run: |
1823
sudo apt-get update
1924
sudo apt-get install -y --no-install-recommends \
2025
build-essential \
2126
clang-format-19
27+
28+
- name: Install shfmt
29+
run: |
30+
go install mvdan.cc/sh/v3/cmd/shfmt@latest
31+
echo "$HOME/go/bin" >> $GITHUB_PATH
32+
33+
- name: Install cmake-format
34+
run: |
35+
sudo apt-get install -y python3-pip
36+
sudo pip3 install cmake-format
2237
2338
- name: Test formatting
2439
run: |

.shellcheckrc

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# .shellcheckrc for CMake templates
2+
# Allow @placeholder@ sourcing
3+
disable=SC1090,SC1091
4+
# Allow sed patterns with @ symbols
5+
disable=SC2001
6+
# Allow @VAR@ unquoted (will be replaced)
7+
disable=SC2086
8+
disable=SC2050
9+
disable=SC2155
10+
11+
# Enforce style
12+
# Use [[ ]] consistently
13+
enable=require-double-brackets
14+
# Use ${var} consistently
15+
enable=require-variable-braces

0 commit comments

Comments
 (0)