Skip to content

Commit 9a1eee4

Browse files
committed
ci: enable super-linter
- clang-format (.clang-format) - commitlint (.commitlintrc.yml) - markdownlint (.markdown-lint.yml) - yamllint (.yaml-lint.yml) Signed-off-by: Yi Huang <yi@secondstate.io>
1 parent ef6e145 commit 9a1eee4

5 files changed

Lines changed: 64 additions & 0 deletions

File tree

.clang-format

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
BasedOnStyle: LLVM
2+
IndentWidth: 2

.github/linters/.commitlintrc.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
extends:
3+
- '@commitlint/config-conventional'

.github/linters/.markdown-lint.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
MD007: # Unordered list indentation
3+
indent: 2 # Consider disable MD005 if things fail on ordered list
4+
MD013: # Line length 80 is far to short
5+
line_length: 999 # We allow soft wrapped paragraphs and raw code outputs
6+
MD029: false # Ordered list item prefix
7+
MD033: false # Allow inline HTML

.github/linters/.yaml-lint.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
extends: relaxed
3+
4+
rules:
5+
indentation:
6+
spaces: 2
7+
indent-sequences: true

.github/workflows/super-linter.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
name: super-linter
3+
4+
on:
5+
pull_request:
6+
branches: [main]
7+
8+
jobs:
9+
lint:
10+
name: Lint
11+
runs-on: ubuntu-latest
12+
13+
permissions:
14+
contents: read
15+
16+
steps:
17+
- name: Checkout with history
18+
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
22+
- name: Work around super-linter
23+
shell: bash
24+
run: |
25+
# Work-around for config file detection
26+
cp .github/linters/.commitlintrc.yml .commitlintrc.yml
27+
28+
- name: Run super-linter
29+
uses: super-linter/super-linter/slim@v7.2.0
30+
env:
31+
VALIDATE_ALL_CODEBASE: false # only check new or edited files
32+
# language configurations
33+
VALIDATE_CLANG_FORMAT: true
34+
VALIDATE_GIT_COMMITLINT: true
35+
VALIDATE_MARKDOWN: true
36+
VALIDATE_YAML: true
37+
# misc configurations
38+
ENFORCE_COMMITLINT_CONFIGURATION_CHECK: true
39+
MULTI_STATUS: false # disable status report
40+
SUPPRESS_POSSUM: true
41+
VALIDATE_GITHUB_ACTIONS: true
42+
VALIDATE_GITLEAKS: true
43+
# Work-around for SHA detection
44+
# https://github.com/super-linter/super-linter/issues/6316#issuecomment-2510205626
45+
GITHUB_BEFORE_SHA: ${{ github.event.pull_request.base.sha }}

0 commit comments

Comments
 (0)