Skip to content

Commit

Permalink
Improve Linter
Browse files Browse the repository at this point in the history
* linter for pr, which only lints new and edited files
* linter for whole code base, representing the current linting
  state of the project
* use the same base settings (enabled/disabled linters) for both
  jobs
  • Loading branch information
xx4h committed Apr 13, 2024
1 parent 0ef9f83 commit f0351aa
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 14 deletions.
25 changes: 11 additions & 14 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
name: Lint Code Base

on:
workflow_dispatch:
push:
branches: main
paths-ignore:
- '**/*.md'
pull_request:
branches: main
paths-ignore:
- '**/*.md'
workflow_call:
inputs:
name:
required: true
type: string
all:
required: true
type: boolean

permissions: { }

jobs:
build:
name: Lint Code Base
lint_pr:
name: ${{ inputs.name }}
runs-on: ubuntu-latest
permissions:
contents: read
Expand All @@ -32,7 +29,7 @@ jobs:
uses: super-linter/[email protected]
env:
# only validate new or edited files
VALIDATE_ALL_CODEBASE: false
VALIDATE_ALL_CODEBASE: ${{ inputs.all }}
VALIDATE_BASH_EXEC: false
VALIDATE_CPP: false
VALIDATE_CLANG_FORMAT: false
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/linter_code_base.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Lint Code Base

on:
workflow_dispatch:
push:
branches: main

jobs:
call-workflow:
linter.yml
call-workflow-passing-data:
with:
name: Lint Code Base
all: true
14 changes: 14 additions & 0 deletions .github/workflows/linter_pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Lint Pull Request

on:
workflow_dispatch:
pull_request:
branches: main

jobs:
call-workflow:
linter.yml
call-workflow-passing-data:
with:
name: Lint Pull Request
all: false

0 comments on commit f0351aa

Please sign in to comment.