Skip to content

Commit

Permalink
ci: enable super-linter
Browse files Browse the repository at this point in the history
- clang-format (.clang-format)
- commitlint   (.commitlintrc.yml)
- markdownlint (.markdown-lint.yml)
- yamllint     (.yaml-lint.yml)

Signed-off-by: Yi Huang <[email protected]>
  • Loading branch information
0yi0 committed Dec 5, 2024
1 parent ef6e145 commit 9a1eee4
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
BasedOnStyle: LLVM
IndentWidth: 2
3 changes: 3 additions & 0 deletions .github/linters/.commitlintrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
extends:
- '@commitlint/config-conventional'
7 changes: 7 additions & 0 deletions .github/linters/.markdown-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
MD007: # Unordered list indentation
indent: 2 # Consider disable MD005 if things fail on ordered list
MD013: # Line length 80 is far to short
line_length: 999 # We allow soft wrapped paragraphs and raw code outputs
MD029: false # Ordered list item prefix
MD033: false # Allow inline HTML
7 changes: 7 additions & 0 deletions .github/linters/.yaml-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
extends: relaxed

rules:
indentation:
spaces: 2
indent-sequences: true
45 changes: 45 additions & 0 deletions .github/workflows/super-linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
name: super-linter

on:
pull_request:
branches: [main]

jobs:
lint:
name: Lint
runs-on: ubuntu-latest

permissions:
contents: read

steps:
- name: Checkout with history
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Work around super-linter
shell: bash
run: |
# Work-around for config file detection
cp .github/linters/.commitlintrc.yml .commitlintrc.yml
- name: Run super-linter
uses: super-linter/super-linter/[email protected]
env:
VALIDATE_ALL_CODEBASE: false # only check new or edited files
# language configurations
VALIDATE_CLANG_FORMAT: true
VALIDATE_GIT_COMMITLINT: true
VALIDATE_MARKDOWN: true
VALIDATE_YAML: true
# misc configurations
ENFORCE_COMMITLINT_CONFIGURATION_CHECK: true
MULTI_STATUS: false # disable status report
SUPPRESS_POSSUM: true
VALIDATE_GITHUB_ACTIONS: true
VALIDATE_GITLEAKS: true
# Work-around for SHA detection
# https://github.com/super-linter/super-linter/issues/6316#issuecomment-2510205626
GITHUB_BEFORE_SHA: ${{ github.event.pull_request.base.sha }}

0 comments on commit 9a1eee4

Please sign in to comment.