Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
b442ea4
Add reusable phplinter-workflow
tvdijen Mar 10, 2025
35a59d4
Add reusable yamllinter workflow
tvdijen Mar 11, 2025
e6c590a
Add JSON linter
tvdijen Mar 11, 2025
979ae1c
Add eslinter
tvdijen Mar 11, 2025
994c3ac
Add stylelinter
tvdijen Mar 12, 2025
4df3c5f
stylelint config
tvdijen Mar 12, 2025
a3eb066
Refactor stylelinter
tvdijen Mar 12, 2025
1e1875c
Add xmllinter
tvdijen Mar 12, 2025
3431846
xmllinter
tvdijen Mar 17, 2025
67aa069
xmllinter
tvdijen Mar 17, 2025
88e78ec
xmllinter
tvdijen Mar 17, 2025
0ae693b
bump
tvdijen Mar 17, 2025
ce0f11c
bump
tvdijen Mar 17, 2025
6669865
bump
tvdijen Mar 17, 2025
8787252
bump
tvdijen Mar 17, 2025
3a6dd0a
bump
tvdijen Mar 17, 2025
117c1c3
bump
tvdijen Mar 17, 2025
b86fc1a
bump
tvdijen Mar 17, 2025
bd7e946
bump
tvdijen Mar 17, 2025
2883091
bump
tvdijen Mar 17, 2025
4d94716
bump
tvdijen Mar 17, 2025
02742c1
bump
tvdijen Mar 17, 2025
14e8b58
bump
tvdijen Mar 17, 2025
f3472f8
bump
tvdijen Mar 17, 2025
1dad989
bump
tvdijen Mar 17, 2025
fb97e0c
bump
tvdijen Mar 17, 2025
2216544
bump
tvdijen Mar 17, 2025
ac9d21a
bump
tvdijen Mar 17, 2025
4f16202
bump
tvdijen Mar 17, 2025
d9d1756
bump
tvdijen Mar 17, 2025
c3d2a9b
bump
tvdijen Mar 17, 2025
37e1709
bump
tvdijen Mar 17, 2025
bc48fa3
bump
tvdijen Mar 17, 2025
219138a
bump
tvdijen Mar 17, 2025
30b0af3
bump
tvdijen Mar 17, 2025
ba5a909
bump
tvdijen Mar 17, 2025
50db388
bump
tvdijen Mar 17, 2025
1924c8a
bump
tvdijen Mar 17, 2025
dec929a
bump
tvdijen Mar 17, 2025
1fd7231
bump
tvdijen Mar 17, 2025
73dcf82
bump
tvdijen Mar 17, 2025
bd603d1
bump
tvdijen Mar 17, 2025
ad625be
bump
tvdijen Mar 17, 2025
f38df69
bump
tvdijen Mar 17, 2025
4aef55e
bump
tvdijen Mar 17, 2025
575267f
bump
tvdijen Mar 17, 2025
b230db4
bump
tvdijen Mar 17, 2025
09f8109
bump
tvdijen Mar 17, 2025
d2a0548
bump
tvdijen Mar 17, 2025
a3c79a8
bump
tvdijen Mar 17, 2025
eb0b19c
bump
tvdijen Mar 17, 2025
6de2df7
Fix linter-issues
tvdijen Mar 23, 2025
e571d8d
fix linter
tvdijen Mar 24, 2025
2f8980a
Drop xmllinter, rename to reusable_*
tvdijen Mar 27, 2025
3d8f866
Refactor: merge reusable workflows
tvdijen Apr 2, 2025
5bf3ffe
Refactor
tvdijen Apr 4, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
144 changes: 144 additions & 0 deletions .github/workflows/reusable_linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
---

on: # yamllint disable-line rule:truthy
workflow_call:
inputs:
enable_eslinter:
description: 'Enable the ES-Linter for this repository'
type: boolean
required: false
default: false
eslinter-config:
description: 'The location of the configuration file'
type: string
required: false
default: './tools/linters/eslint.config.js'

enable_jsonlinter:
description: 'Enable the JSON-Linter for this repository'
type: boolean
required: false
default: false

enable_yamllinter:
description: 'Enable the YAML-Linter for this repository'
type: boolean
required: false
default: false
yamllinter-config:
description: 'The location of the linter-configuration'
type: string
required: false
default: './tools/linters/.yaml-lint.yml'

enable_stylelinter:
description: 'Enable the Style-Linter for this repository'
type: boolean
required: false
default: false
stylelinter-pattern:
description: 'The file-pattern to match files that are being linted'
type: string
required: false
default: '**/*.{css,scss,sass}'
stylelinter-config:
description: 'The location of the linter-configuration'
type: string
required: false
default: 'tools/linters/.stylelintrc.json'

repository:
description: 'The repository that needs linting'
type: string
default: ${{ github.repository }}
required: false
ref:
description: 'The branch, tag or SHA that needs linting'
type: string
required: false
default: ${{ github.ref }}

jobs:
ecmascript-linter:
if: inputs.enable_eslinter == true
runs-on: ubuntu-latest

steps:
- name: Install NodeJS
uses: actions/setup-node@v4
with:
node-version: latest

- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
repository: ${{ inputs.repository }}
ref: ${{ inputs.ref }}

- name: Install ESLint
run: |
npm install eslint eslint-config

- name: Lint JavaScript
run: ./node_modules/.bin/eslint --config=${{ inputs.eslinter-config }}
env:
DEBUG: eslint:languages:js

json-linter:
if: inputs.enable_jsonlinter == true
runs-on: ubuntu-latest

steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
repository: ${{ inputs.repository }}
ref: ${{ inputs.ref }}

- name: Lint JSON
uses: limitusus/json-syntax-check@v2

style-linter:
if: inputs.enable_stylelinter == true
runs-on: ubuntu-latest

steps:
- name: Install NodeJS
uses: actions/setup-node@v4
with:
node-version: latest

- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
repository: ${{ inputs.repository }}
ref: ${{ inputs.ref }}

- name: Install StyleLint
run: npm install stylelint stylelint-config-standard

- name: Lint stylesheets
run: |
./node_modules/.bin/stylelint \
-f verbose \
-c=${{ inputs.stylelinter-config }} ${{ inputs.stylelinter-pattern }}

yaml-linter:
if: inputs.enable_yamllinter == true
runs-on: ubuntu-latest

steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
repository: ${{ inputs.repository }}
ref: ${{ inputs.ref }}

- name: Lint YAML
uses: ibiqlik/action-yamllint@v3.1.1
with:
config_file: ${{ inputs.yamllinter-config }}
69 changes: 69 additions & 0 deletions .github/workflows/reusable_phplinter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
---

on: # yamllint disable-line rule:truthy
workflow_call:
inputs:
php-version:
description: 'The PHP-version to use for linting'
type: string
required: true
repository:
description: 'The repository that needs linting'
type: string
required: false
default: ${{ github.repository }}
ref:
description: 'The branch, tag or SHA that needs linting'
type: string
required: false
default: ${{ github.ref }}

env:
supported: '["7.4", "8.0", "8.1", "8.2", "8.3", "8.4"]'

jobs:
linter:
runs-on: ubuntu-latest

steps:
- name: Supported version check
if: contains(fromJSON(env.supported), inputs.php-version) == false
run: exit 1

- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
repository: ${{ inputs.repository }}
ref: ${{ inputs.ref }}

- name: Setup PHP runtime
uses: shivammathur/setup-php@v2
with:
tools: phive
php-version: ${{ inputs.php-version }}
coverage: "none"

- name: Install overtrue/phplint (v3.4)
if: inputs.php-version == '7.4'
run: |
phive install overtrue/phplint@~3.4.0 --force-accept-unsigned --target ./bin

- name: Install overtrue/phplint (v4.5)
if: inputs.php-version == '8.0'
run: |
phive install overtrue/phplint@~4.5.0 --force-accept-unsigned --target ./bin

- name: Install overtrue/phplint (v9.4)
if: inputs.php-version == '8.1'
run: |
phive install overtrue/phplint@~9.4.0 --force-accept-unsigned --target ./bin

- name: Install overtrue/phplint (v9.5)
if: inputs.php-version != '7.4' && inputs.php-version != '8.0' && inputs.php-version != '8.1'
run: |
phive install overtrue/phplint@~9.5.0 --force-accept-unsigned --target ./bin

- name: Lint PHP files
run: |
./bin/phplint --no-cache --no-progress -v