Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
22 changes: 22 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.php]
indent_style = space
indent_size = 2
Comment on lines +9 to +11
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

# Find and examine phpcs.xml
fd phpcs.xml --exec cat {}

Repository: jpjuliao/multi-step-form-builder

Length of output: 1217


🏁 Script executed:

# Also check for any other PHPCS or linting configurations
fd -e xml -e json -e yml -e yaml | grep -E '(phpcs|phpstan|coding|standards)' | head -20

Repository: jpjuliao/multi-step-form-builder

Length of output: 85


🏁 Script executed:

# Get context on .editorconfig file itself
cat -n .editorconfig

Repository: jpjuliao/multi-step-form-builder

Length of output: 544


PHP indentation in .editorconfig conflicts with WordPress Coding Standards — CI lint will fail.

phpcs.xml uses WordPress Coding Standards, which mandate tab indentation for PHP files. However, .editorconfig specifies 2-space indentation for PHP. Any code written by contributors following the editor config will fail composer lint in CI.

Change PHP indentation in .editorconfig to tabs:

🔧 Fix
[*.php]
-indent_style = space
-indent_size = 2
+indent_style = tab
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
[*.php]
indent_style = space
indent_size = 2
[*.php]
indent_style = tab
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.editorconfig around lines 9 - 11, .editorconfig currently sets PHP files to
2-space indentation which conflicts with WordPress Coding Standards used by
phpcs.xml; update the [*.php] section by changing indent_style from "space" to
"tab" and remove or unset indent_size so PHP files use tabs (i.e., modify the
settings under the [*.php] header where indent_style and indent_size are
declared).


[*.{js,jsx,ts,tsx,json,css,scss}]
indent_style = space
indent_size = 2

[*.xml]
indent_style = space
indent_size = 2

[*.md]
trim_trailing_whitespace = false
35 changes: 35 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Lint

on:
push:
pull_request:

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
coverage: none

- name: Get Composer Cache Directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache Composer dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

- name: Install Composer dependencies
run: composer install --prefer-dist --no-progress
Comment on lines +28 to +32
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Add --no-interaction to composer install and commit composer.lock.

Two related CI reliability issues:

  1. Without --no-interaction, Composer can prompt for input and hang the CI runner if an unexpected interactive question arises.
  2. hashFiles('**/composer.lock') produces an empty hash when composer.lock is not committed, making the cache key degenerate to the restore-key prefix — all CI runs will share the same cache slot and dependency versions will silently drift between runs. For a plugin (application), composer.lock should be committed.
🔧 Proposed fix
-        run: composer install --prefer-dist --no-progress
+        run: composer install --prefer-dist --no-progress --no-interaction
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/lint.yml around lines 28 - 32, Update the "Install
Composer dependencies" step to run composer install with the --no-interaction
flag to prevent CI hangs (modify the step named "Install Composer
dependencies"); also ensure composer.lock is committed to the repo so the cache
key using hashFiles('**/composer.lock') produces a stable hash instead of an
empty value — commit the lockfile and then leave the existing cache key logic
intact so each commit gets its own cache slot.


- name: Run composer lint
run: composer lint
10 changes: 10 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"[php]": {
"editor.defaultFormatter": "ValeryanM.vscode-phpsab",
"editor.formatOnSave": true
},
"phpsab.executablePathCBF": "./vendor/bin/phpcbf",
"phpsab.executablePathCS": "./vendor/bin/phpcs",
"phpsab.standard": "PSR12",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

phpsab.standard is set to PSR12 but the repo enforces WordPress coding standards via phpcs.xml.

While phpsab.autoRulesetSearch: true will find phpcs.xml when VS Code is opened from the repo root, the explicit "PSR12" acts as a fallback for any other workspace root and is actively misleading to contributors reading this file. Set it to WordPress to match the repo standard:

🔧 Proposed fix
-  "phpsab.standard": "PSR12",
+  "phpsab.standard": "WordPress",
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"phpsab.standard": "PSR12",
"phpsab.standard": "WordPress",
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.vscode/settings.json at line 8, The "phpsab.standard" setting currently
hardcodes "PSR12" which conflicts with the repo's PHP coding standard defined in
phpcs.xml (WordPress); update the setting value from "PSR12" to "WordPress" and
ensure "phpsab.autoRulesetSearch" remains enabled so the workspace can still
detect phpcs.xml, i.e., change the phpsab.standard entry to "WordPress" to align
VS Code defaults with the repository standard.

"phpsab.autoRulesetSearch": true
}
2 changes: 1 addition & 1 deletion build/166.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build/174.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/280.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build/304.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build/33.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/351.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build/399.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading