From 3a979d4c8f78319d19c05f6e89806e76794b1c32 Mon Sep 17 00:00:00 2001 From: Steven Dufresne Date: Tue, 10 Dec 2024 07:25:49 +0900 Subject: [PATCH 1/5] Create linters.yml for linting css. --- .github/workflows/linters.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/linters.yml diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml new file mode 100644 index 00000000..2a9afbc9 --- /dev/null +++ b/.github/workflows/linters.yml @@ -0,0 +1,22 @@ +name: Static Analysis (Linting) + +# This workflow is triggered on pushes to trunk, and any PRs. +on: + push: + branches: [trunk] + pull_request: + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup + uses: WordPress/wporg-repo-tools/.github/actions/setup@trunk + with: + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Lint + uses: WordPress/wporg-repo-tools/.github/actions/lint@trunk From ad8b71dfa22d43cedd02d1a33798b3689dea6791 Mon Sep 17 00:00:00 2001 From: StevenDufresne Date: Tue, 10 Dec 2024 07:36:39 +0900 Subject: [PATCH 2/5] Try my branch. --- .github/workflows/linters.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml index 2a9afbc9..31ec3c2a 100644 --- a/.github/workflows/linters.yml +++ b/.github/workflows/linters.yml @@ -19,4 +19,4 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} - name: Lint - uses: WordPress/wporg-repo-tools/.github/actions/lint@trunk + uses: WordPress/wporg-repo-tools/.github/actions/lint@try/conditionally-run-php-check From 409aec71f59c0f4cf3acbb4552ac93b2392105bc Mon Sep 17 00:00:00 2001 From: StevenDufresne Date: Tue, 10 Dec 2024 08:18:56 +0900 Subject: [PATCH 3/5] Set it back to trunk. --- .github/workflows/linters.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml index 31ec3c2a..2a9afbc9 100644 --- a/.github/workflows/linters.yml +++ b/.github/workflows/linters.yml @@ -19,4 +19,4 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} - name: Lint - uses: WordPress/wporg-repo-tools/.github/actions/lint@try/conditionally-run-php-check + uses: WordPress/wporg-repo-tools/.github/actions/lint@trunk From 87e1de049a61224f930e37af8c26c5d6da20ac7d Mon Sep 17 00:00:00 2001 From: StevenDufresne Date: Mon, 16 Dec 2024 14:36:35 +0900 Subject: [PATCH 4/5] Add a noop php lint. --- source/wp-content/themes/wporg-parent-2021/package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/wp-content/themes/wporg-parent-2021/package.json b/source/wp-content/themes/wporg-parent-2021/package.json index 8972fa76..97e48a80 100644 --- a/source/wp-content/themes/wporg-parent-2021/package.json +++ b/source/wp-content/themes/wporg-parent-2021/package.json @@ -20,7 +20,8 @@ "build": "node build-styles.js", "start": "chokidar \"sass/**/*.scss\" -c \"node build-styles.js\" --initial", "lint:css": "wp-scripts lint-style sass", - "lint:js": "echo \"No JS.\"" + "lint:js": "echo \"No JS.\"", + "lint:php": "echo \"No PHP lint.\"" }, "browserslist": [ "extends @wordpress/browserslist-config" From 8dc409dcfa1186e9c86c2c901dc1060be557cd02 Mon Sep 17 00:00:00 2001 From: StevenDufresne Date: Mon, 16 Dec 2024 14:40:24 +0900 Subject: [PATCH 5/5] Move the lint up to root package.json --- package.json | 3 ++- source/wp-content/themes/wporg-parent-2021/package.json | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 21f2b020..80ea10e0 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,8 @@ "setup:tools": "yarn && composer install && TEXTDOMAIN=wporg composer exec update-configs", "setup:wp": "wp-env run cli bash env/setup.sh", "update:tools": "composer update && TEXTDOMAIN=wporg composer exec update-configs", - "wp-env": "wp-env" + "wp-env": "wp-env", + "lint:php": "echo \"No PHP lint.\"" }, "workspaces": [ "source/wp-content/themes/wporg-parent-2021" diff --git a/source/wp-content/themes/wporg-parent-2021/package.json b/source/wp-content/themes/wporg-parent-2021/package.json index 97e48a80..8972fa76 100644 --- a/source/wp-content/themes/wporg-parent-2021/package.json +++ b/source/wp-content/themes/wporg-parent-2021/package.json @@ -20,8 +20,7 @@ "build": "node build-styles.js", "start": "chokidar \"sass/**/*.scss\" -c \"node build-styles.js\" --initial", "lint:css": "wp-scripts lint-style sass", - "lint:js": "echo \"No JS.\"", - "lint:php": "echo \"No PHP lint.\"" + "lint:js": "echo \"No JS.\"" }, "browserslist": [ "extends @wordpress/browserslist-config"