Repository navigation
fix(ci): pass only lintable files to Stylelint and PHPCS - #40
Merged
Merged
Conversation
…e manifests ci-detect-changes lists package.json and package-lock.json in css-files so a dependency change re-runs Stylelint, but ci-lint-css passed them straight to Stylelint, which failed with CssSyntaxError. Lint changed stylesheets file by file only when nothing else is in the list; otherwise run lint-command over the whole project, since a dependency change can affect every stylesheet.
ci-detect-changes lists composer.json, composer.lock and the PHPStan config in php-files, and a change that deletes PHP files lists those too. ci-lint-php passed the whole list to PHPCS, which failed with 'does not exist' for deleted files and 'Start tag expected' for the config files, as on rtCamp/theme-elementary#692. Lint changed PHP files that still exist file by file only when nothing else is in the list; otherwise lint the whole project, since a dependency or ruleset change can affect every file.
AnuragVasanwala
approved these changes
Oct 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ci-detect-changesputs more than source files into the changed-file lists:css-filesincludespackage.jsonandpackage-lock.json, andphp-filesincludescomposer.json,composer.lockand the PHPStan config, so that a dependency or config change re-runs the lint jobs. A change that deletes files lists those too. The lint jobs passed these lists straight to the linters:Stylelint failed on the npm manifests with
CssSyntaxError(chore: use the published @rtcamp and rtcamp packages, rename to rtcamp/theme-elementary theme-elementary#789):PHPCS failed on deleted files and the PHPStan config (release: theme-elementary v2 🚀 theme-elementary#692):
Changes
ci-lint-css.yml: changed stylesheets are linted file by file only when nothing else is in the list. Otherwise, or with an empty list,lint-commandruns over the whole project.ci-lint-php.yml: changed PHP files that still exist are linted file by file only when nothing else is in the list. Otherwise PHPCS lints the whole project. PHPStan is unchanged (always whole-project).Linting the whole project when a manifest or config changed is also the right behaviour on its own: a new
@rtcamp/stylelint-configorrtcamp/wp-phpcscan change the result for every file.Testing
actionlint: cleanbash -e -o pipefailwith the linters stubbed:changed-files