Skip to content

Commit 6559298

Browse files
authored
Merge pull request #106 from Hans5958/layout/lint-ci
Fix lint issues and add fix workflow
2 parents bae57de + 78a8dff commit 6559298

3 files changed

Lines changed: 46 additions & 1 deletion

File tree

.github/workflows/lint-fix.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Auto-fix code quality problems
2+
on:
3+
workflow_dispatch:
4+
permissions:
5+
contents: write
6+
7+
jobs:
8+
lint:
9+
name: Run linters
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v6
14+
- name: Setup Node.js
15+
uses: actions/setup-node@v6
16+
with:
17+
node-version: 18
18+
- name: Get npm cache directory
19+
id: npm-cache-dir
20+
shell: bash
21+
run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT}
22+
- name: Cache dependencies
23+
uses: actions/cache@v5
24+
with:
25+
path: ${{ steps.npm-cache-dir.outputs.dir }}
26+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
27+
restore-keys: |
28+
${{ runner.os }}-node-
29+
- name: Install dependencies
30+
run: npm ci
31+
- name: Run ESLint
32+
run: npx eslint --fix .
33+
- name: Run Prettier
34+
run: npx prettier --write .
35+
- name: Commit changes
36+
uses: EndBug/add-and-commit@v9
37+
with:
38+
message: Auto-fix code quality problems
39+
author_name: ${{ github.actor }}
40+
author_email: ${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com
41+
committer_name: GitHub Actions
42+
committer_email: 41898282+github-actions[bot]@users.noreply.github.com

.github/workflows/lint.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ name: Check code quality
22
on:
33
push:
44
pull_request:
5+
workflow_dispatch:
6+
permissions:
7+
contents: read
58

69
jobs:
710
lint:

src/content/rules/song-source-required.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ automatically_fixed: "False"
2020
complete_validation: "True"
2121
---
2222

23-
Song entries require a PV *or* an external link *or* an attached album entry for proof of existence. A description may be set instead if the only applicable links are direct downloads or profile-less file sharing sites.
23+
Song entries require a PV _or_ an external link _or_ an attached album entry for proof of existence. A description may be set instead if the only applicable links are direct downloads or profile-less file sharing sites.

0 commit comments

Comments
 (0)