Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
8856f8b
UseStatements/KeywordSpacing: add missing "fixed" test file
jrfnl Feb 16, 2024
a82cb4d
Merge pull request #303 from PHPCSStandards/feature/tests-update-for-…
jrfnl Feb 16, 2024
f323022
GH Actions: minor tweaks
jrfnl Feb 11, 2024
71ce087
Merge pull request #304 from PHPCSStandards/feature/ghactions-minor-t…
jrfnl Feb 16, 2024
bd7b8c9
GH Actions: Bump ramsey/composer-install from 2 to 3
dependabot[bot] Mar 4, 2024
7384703
Merge pull request #305 from PHPCSStandards/dependabot/github_actions…
jrfnl Mar 4, 2024
622223e
GH Actions: Bump mondeja/remove-labels-gh-action from 1 to 2
dependabot[bot] Mar 18, 2024
253d018
Merge pull request #306 from PHPCSStandards/dependabot/github_actions…
jrfnl Mar 18, 2024
cf5f8b4
Bug report template: tweak markdown
jrfnl Apr 19, 2024
6609627
Merge pull request #308 from PHPCSStandards/feature/bug-report-fix-ma…
jrfnl Apr 19, 2024
cd881d3
Composer: avoid writing a lock file (#307)
fredden Apr 21, 2024
fd2752e
GH Actions: work around intermittent apt-get errors
jrfnl Apr 24, 2024
6dcc443
Merge pull request #309 from PHPCSStandards/feature/ghactions-xmllint…
jrfnl Apr 24, 2024
3e5ce25
Documentation: minor consistency fixes
jrfnl Jul 22, 2024
7eb3aa3
Merge pull request #311 from PHPCSStandards/feature/docs-minor-consis…
jrfnl Jul 23, 2024
007d8fa
Release checklist: minor update
jrfnl Jul 15, 2024
de3789a
Merge pull request #312 from PHPCSStandards/feature/release-checklist…
jrfnl Jul 23, 2024
a04689a
GH Actions/Basics: use reusable workflow
jrfnl Oct 3, 2024
f0f9421
README/Changelog: fix a few URLs which have changed
jrfnl Oct 3, 2024
6f99815
Merge pull request #317 from PHPCSStandards/feature/ghactions-use-reu…
jrfnl Oct 3, 2024
50ef6a6
GH Actions: always quote variables
jrfnl Oct 13, 2024
dc888e7
Merge pull request #318 from PHPCSStandards/feature/ghactions-quote-vars
jrfnl Oct 13, 2024
deba277
Partially revert "README/Changelog: fix a few URLs which have changed"
jrfnl Oct 13, 2024
d030420
Merge pull request #319 from PHPCSStandards/feature/docs-revert-some-…
jrfnl Oct 14, 2024
4523f4e
Universal/DisallowInlineTabs: handle more tokens
jrfnl Oct 23, 2024
82c468b
Merge pull request #320 from PHPCSStandards/feature/universal-disallo…
jrfnl Oct 23, 2024
a3ef964
Universal/DisallowInlineTabs: minor tweak to the tests
jrfnl Oct 23, 2024
2bd085a
Merge pull request #321 from PHPCSStandards/feature/universal-disallo…
jrfnl Nov 8, 2024
7b88c12
Universal/SeparateFunctionsFromOO: simplify skipping the rest of the …
jrfnl Nov 8, 2024
de21892
Merge pull request #322 from PHPCSStandards/feature/universal-separat…
jrfnl Nov 9, 2024
bc5b3b3
GH Actions: use explicit PHPStan major
jrfnl Nov 8, 2024
c938bd8
Merge pull request #323 from PHPCSStandards/feature/ghactions-use-php…
jrfnl Nov 9, 2024
9455319
Various minor doc fixes
jrfnl Apr 24, 2024
4257e46
Merge pull request #324 from PHPCSStandards/feature/various-minor-fixes
jrfnl Nov 9, 2024
62898eb
PHPStan 2.0: update configuration
jrfnl Nov 11, 2024
e32f4a4
Merge pull request #325 from PHPCSStandards/feature/phpstan-2.0-tweaks_
jrfnl Nov 11, 2024
3e73121
GH Actions: update for the release of PHP 8.4
jrfnl Nov 11, 2024
31ef149
Merge pull request #326 from PHPCSStandards/feature/ghactions-dont-fa…
jrfnl Nov 11, 2024
793494e
GH Actions: split XML code style check off from "Basic QA"check
jrfnl Mar 3, 2025
8e5edbf
GH Actions: use the xmllint-validate action runner
jrfnl Mar 3, 2025
ce13c97
GH Actions: add some additional XML validation checks
jrfnl Mar 3, 2025
cf28c84
Merge pull request #328 from PHPCSStandards/feature/ghactions-change-…
jrfnl Mar 3, 2025
53fa0b6
:sparkles: New Universal.PHP.NoFQNTrueFalseNull sniff
jrfnl Mar 1, 2025
c3c5741
Merge pull request #327 from PHPCSStandards/feature/forbid-fqn-true-f…
jrfnl Mar 20, 2025
eeaa1fe
Composer: raise the minimum supported PHPCS version to 3.12.1
jrfnl Apr 20, 2025
4ddfa44
Merge pull request #330 from PHPCSStandards/feature/composer-raise-ph…
jrfnl Apr 20, 2025
b031559
Universal/TypeSeparatorSpacing: add support for PHP 8.2 DNF types
jrfnl Apr 20, 2025
359ed4d
Merge pull request #329 from PHPCSStandards/feature/universal-typeope…
jrfnl Apr 20, 2025
721cd89
Changelog and readme updates for PHPCSExtra 1.3.0
jrfnl Apr 20, 2025
e21ab3d
Merge pull request #331 from PHPCSStandards/feature/changelog-1.3.0
jrfnl Apr 20, 2025
9f45e31
Docs: fix typo
jrfnl Apr 20, 2025
cb73c4b
Merge pull request #333 from PHPCSStandards/feature/changelog-fix-typo
jrfnl Apr 20, 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
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ You should be able to get the version numbers using the `composer info` command.
-->

| Environment | Answer |
|-------------------------|--------------------------------------------------------------------------------|
| ----------------------- | ------------------------------------------------------------------------------ |
| PHP version | x.y.z |
| PHP_CodeSniffer version | x.y.z |
| PHPCSExtra version | x.y.z |
Expand Down
1 change: 1 addition & 0 deletions .github/release-checklist.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ PR for tracking changes for the x.x.x release. Target release date: **DOW MONTH
- [ ] Fast-forward `develop` to be equal to `stable`

### Publicize
- [ ] Toot about the release.
- [ ] Tweet about the release.
175 changes: 61 additions & 114 deletions .github/workflows/basics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ jobs:
runs-on: ubuntu-latest

env:
XMLLINT_INDENT: ' '
# - COMPOSER_ROOT_VERSION is needed to get round the recursive dependency when using CI.
COMPOSER_ROOT_VERSION: '1.99.99'

Expand Down Expand Up @@ -48,36 +47,41 @@ jobs:
# Install dependencies and handle caching in one go.
# @link https://github.com/marketplace/actions/install-php-dependencies-with-composer
- name: Install Composer dependencies
uses: "ramsey/composer-install@v2"
uses: "ramsey/composer-install@v3"
with:
# Bust the cache at least once a month - output format: YYYY-MM.
custom-cache-suffix: $(date -u "+%Y-%m")

- name: Install xmllint
run: |
sudo apt-get update
sudo apt-get install --no-install-recommends -y libxml2-utils
# Validate XML files against schema.
- name: Validate XML rulesets against schema
uses: phpcsstandards/xmllint-validate@v1
with:
pattern: "./*/ruleset.xml"
xsd-file: "vendor/squizlabs/php_codesniffer/phpcs.xsd"

# Show XML violations inline in the file diff.
# @link https://github.com/marketplace/actions/xmllint-problem-matcher
- name: Enable showing XML issues inline
uses: korelstar/xmllint-problem-matcher@v1
- name: Validate documentation XML against schema
uses: phpcsstandards/xmllint-validate@v1
with:
pattern: "./*/Docs/*/*Standard.xml"
xsd-file: "vendor/phpcsstandards/phpcsdevtools/DocsXsd/phpcsdocs.xsd"

# Validate the Ruleset XML file.
# @link http://xmlsoft.org/xmllint.html
- name: Validate rulesets against schema
run: xmllint --noout --schema vendor/squizlabs/php_codesniffer/phpcs.xsd ./*/ruleset.xml
- name: Validate Project PHPCS ruleset against schema
uses: phpcsstandards/xmllint-validate@v1
with:
pattern: "phpcs.xml.dist"
xsd-file: "vendor/squizlabs/php_codesniffer/phpcs.xsd"

# Check the code-style consistency of the XML ruleset files.
- name: Check XML code style
run: |
diff -B ./Modernize/ruleset.xml <(xmllint --format "./Modernize/ruleset.xml")
diff -B ./NormalizedArrays/ruleset.xml <(xmllint --format "./NormalizedArrays/ruleset.xml")
diff -B ./Universal/ruleset.xml <(xmllint --format "./Universal/ruleset.xml")
- name: "Validate PHPUnit config for use with PHPUnit 8"
uses: phpcsstandards/xmllint-validate@v1
with:
pattern: "phpunit.xml.dist"
xsd-file: "vendor/phpunit/phpunit/schema/8.5.xsd"

# Validate the Documentation XML files.
- name: Validate documentation against schema
run: xmllint --noout --schema vendor/phpcsstandards/phpcsdevtools/DocsXsd/phpcsdocs.xsd ./*/Docs/*/*Standard.xml
- name: "Validate PHPUnit config for use with PHPUnit 9"
uses: phpcsstandards/xmllint-validate@v1
with:
pattern: "phpunit.xml.dist"
xsd-file: "vendor/phpunit/phpunit/schema/9.2.xsd"

# Check the code-style consistency of the PHP files.
- name: Check PHP code style
Expand All @@ -94,107 +98,50 @@ jobs:
- name: Check sniff feature completeness
run: composer check-complete

phpstan:
name: "PHPStan"
runs-on: "ubuntu-latest"
xml-cs:
name: 'XML Code style'
runs-on: ubuntu-latest

env:
XMLLINT_INDENT: ' '

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: 'latest'
coverage: none
tools: phpstan
# Updating the lists can fail intermittently, typically after Microsoft has released a new package.
# This should not be blocking for this job, so ignore any errors from this step.
# Ref: https://github.com/dotnet/core/issues/4167
- name: Update the available packages list
continue-on-error: true
run: sudo apt-get update

# Install dependencies and handle caching in one go.
# Dependencies need to be installed to make sure the PHPCS and PHPUnit classes are recognized.
# @link https://github.com/marketplace/actions/install-php-dependencies-with-composer
- name: Install Composer dependencies
uses: "ramsey/composer-install@v2"
with:
# Bust the cache at least once a month - output format: YYYY-MM.
custom-cache-suffix: $(date -u "+%Y-%m")
- name: Install xmllint
run: sudo apt-get install --no-install-recommends -y libxml2-utils

- name: Run PHPStan
run: phpstan analyse
# Show XML violations inline in the file diff.
- name: Enable showing XML issues inline
uses: korelstar/xmllint-problem-matcher@v1

remark:
name: 'QA Markdown'
runs-on: ubuntu-latest
# Check the code-style consistency of the XML ruleset files.
- name: Check XML code style
run: |
diff -B ./Modernize/ruleset.xml <(xmllint --format "./Modernize/ruleset.xml")
diff -B ./NormalizedArrays/ruleset.xml <(xmllint --format "./NormalizedArrays/ruleset.xml")
diff -B ./Universal/ruleset.xml <(xmllint --format "./Universal/ruleset.xml")

steps:
- name: Checkout code
uses: actions/checkout@v4
phpstan:
name: "PHPStan"
uses: PHPCSStandards/.github/.github/workflows/reusable-phpstan.yml@main
with:
phpstanVersion: '2.x'

- name: Set up node and enable caching of dependencies
uses: actions/setup-node@v4
with:
node-version: '16'

# To make the command available on CLI, it needs to be installed globally.
- name: Install Remark CLI globally
run: npm install --global remark-cli --foreground-scripts true --fund false

# To allow for creating a custom config which references rules which are included
# in the presets, without having to install all rules individually, a local install
# works best (and installing the presets in the first place, of course).
#
# Note: the first group of packages are all part of the mono "Remark lint" repo.
# The second group of packages (heading-whitespace and down) are additional
# "external" rules/plugins.
- name: Install Remark rules locally
run: >
npm install --foreground-scripts true --fund false
remark-lint
remark-gfm
remark-preset-lint-consistent
remark-preset-lint-recommended
remark-preset-lint-markdown-style-guide
remark-lint-checkbox-content-indent
remark-lint-linebreak-style
remark-lint-no-duplicate-defined-urls
remark-lint-no-empty-url
remark-lint-no-heading-like-paragraph
remark-lint-no-reference-like-url
remark-lint-no-unneeded-full-reference-image
remark-lint-no-unneeded-full-reference-link
remark-lint-strikethrough-marker
remark-lint-heading-whitespace
remark-lint-list-item-punctuation
remark-lint-match-punctuation
remark-lint-no-dead-urls
remark-lint-no-hr-after-heading
remark-lint-are-links-valid-duplicate
remark-validate-links

- name: Run Remark-lint
run: remark . --frail

# @link https://github.com/reviewdog/action-remark-lint
- name: Show Remark-lint annotations in PR
if: ${{ failure() && github.event_name == 'pull_request' }}
uses: reviewdog/action-remark-lint@v5
with:
fail_on_error: true
install_deps: false
level: info
reporter: github-pr-check
remark:
name: 'QA Markdown'
uses: PHPCSStandards/.github/.github/workflows/reusable-remark.yml@main

yamllint:
name: 'Lint Yaml'
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

# Ref: https://yamllint.readthedocs.io/en/stable/
- name: Run Yamllint on all yaml files in repo
run: yamllint . --format colored

- name: Pipe Yamllint results on to GH for inline display
if: ${{ failure() }}
run: yamllint . --format github
uses: PHPCSStandards/.github/.github/workflows/reusable-yamllint.yml@main
with:
strict: true
6 changes: 3 additions & 3 deletions .github/workflows/label-remove-outdated.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
name: Clean up labels on issue close

steps:
- uses: mondeja/remove-labels-gh-action@v1
- uses: mondeja/remove-labels-gh-action@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
labels: |
Expand All @@ -31,7 +31,7 @@ jobs:
name: Clean up labels on PR merge

steps:
- uses: mondeja/remove-labels-gh-action@v1
- uses: mondeja/remove-labels-gh-action@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
labels: |
Expand All @@ -45,7 +45,7 @@ jobs:
name: Clean up labels on PR close

steps:
- uses: mondeja/remove-labels-gh-action@v1
- uses: mondeja/remove-labels-gh-action@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
labels: |
Expand Down
15 changes: 10 additions & 5 deletions .github/workflows/quicktest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ jobs:
id: set_ini
run: |
if [ "${{ matrix.phpcs_version }}" != "dev-master" ]; then
echo 'PHP_INI=error_reporting=E_ALL & ~E_DEPRECATED, display_errors=On' >> $GITHUB_OUTPUT
echo 'PHP_INI=error_reporting=E_ALL & ~E_DEPRECATED, display_errors=On' >> "$GITHUB_OUTPUT"
else
echo 'PHP_INI=error_reporting=-1, display_errors=On' >> $GITHUB_OUTPUT
echo 'PHP_INI=error_reporting=-1, display_errors=On' >> "$GITHUB_OUTPUT"
fi

- name: Install PHP
Expand All @@ -59,19 +59,24 @@ jobs:
if: ${{ matrix.phpcs_version != 'lowest' }}
run: composer require squizlabs/php_codesniffer:"${{ matrix.phpcs_version }}" --no-update --no-scripts --no-interaction

- name: "Composer: use lock file when necessary"
if: ${{ matrix.phpcs_version == 'lowest' }}
run: composer config --unset lock

# Install dependencies and handle caching in one go.
# @link https://github.com/marketplace/actions/install-php-dependencies-with-composer
- name: Install Composer dependencies
uses: "ramsey/composer-install@v2"
uses: "ramsey/composer-install@v3"
with:
# Bust the cache at least once a month - output format: YYYY-MM.
custom-cache-suffix: $(date -u "+%Y-%m")

- name: "Composer: set PHPCS/PHPCSUtils version for tests (lowest)"
if: ${{ matrix.phpcs_version == 'lowest' }}
run: >
composer update squizlabs/php_codesniffer phpcsstandards/phpcsutils
--prefer-lowest --ignore-platform-req=php+ --no-scripts --no-interaction
composer update --prefer-lowest --no-scripts --no-interaction
squizlabs/php_codesniffer
phpcsstandards/phpcsutils

- name: Lint against parse errors
if: matrix.phpcs_version == 'dev-master'
Expand Down
36 changes: 23 additions & 13 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ jobs:
# @link https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstrategymatrix
#
# The matrix is set up so as not to duplicate the builds which are run for code coverage.
php: ['5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.4']
php: ['5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.5']
phpcs_version: ['lowest', 'dev-master']

name: "Test${{ matrix.phpcs_version == 'dev-master' && ' + Lint' || '' }}: PHP ${{ matrix.php }} - PHPCS ${{ matrix.phpcs_version }}"

continue-on-error: ${{ matrix.php == '8.4' }}
continue-on-error: ${{ matrix.php == '8.5' }}

steps:
- name: Checkout code
Expand All @@ -49,9 +49,9 @@ jobs:
id: set_ini
run: |
if [[ "${{ matrix.phpcs_version }}" != "dev-master" ]]; then
echo 'PHP_INI=error_reporting=E_ALL & ~E_DEPRECATED, display_errors=On' >> $GITHUB_OUTPUT
echo 'PHP_INI=error_reporting=E_ALL & ~E_DEPRECATED, display_errors=On' >> "$GITHUB_OUTPUT"
else
echo 'PHP_INI=error_reporting=-1, display_errors=On' >> $GITHUB_OUTPUT
echo 'PHP_INI=error_reporting=-1, display_errors=On' >> "$GITHUB_OUTPUT"
fi

- name: Install PHP
Expand All @@ -65,19 +65,24 @@ jobs:
if: ${{ matrix.phpcs_version != 'lowest' }}
run: composer require squizlabs/php_codesniffer:"${{ matrix.phpcs_version }}" --no-update --no-scripts --no-interaction

- name: "Composer: use lock file when necessary"
if: ${{ matrix.phpcs_version == 'lowest' }}
run: composer config --unset lock

# Install dependencies and handle caching in one go.
# @link https://github.com/marketplace/actions/install-php-dependencies-with-composer
- name: Install Composer dependencies
uses: "ramsey/composer-install@v2"
uses: "ramsey/composer-install@v3"
with:
# Bust the cache at least once a month - output format: YYYY-MM.
custom-cache-suffix: $(date -u "+%Y-%m")

- name: "Composer: set PHPCS/PHPCSUtils version for tests (lowest)"
if: ${{ matrix.phpcs_version == 'lowest' }}
run: >
composer update squizlabs/php_codesniffer phpcsstandards/phpcsutils
--prefer-lowest --ignore-platform-req=php+ --no-scripts --no-interaction
composer update --prefer-lowest --no-scripts --no-interaction
squizlabs/php_codesniffer
phpcsstandards/phpcsutils

- name: Lint against parse errors
if: matrix.phpcs_version == 'dev-master'
Expand All @@ -100,7 +105,7 @@ jobs:

strategy:
matrix:
php: ['5.4', '8.3']
php: ['5.4', '8.4']
phpcs_version: ['lowest', 'dev-master']

name: "Coverage${{ matrix.phpcs_version == 'dev-master' && ' + Lint' || '' }}: PHP ${{ matrix.php }} - PHPCS ${{ matrix.phpcs_version }}"
Expand All @@ -115,9 +120,9 @@ jobs:
id: set_ini
run: |
if [ "${{ matrix.phpcs_version }}" != "dev-master" ]; then
echo 'PHP_INI=error_reporting=E_ALL & ~E_DEPRECATED, display_errors=On' >> $GITHUB_OUTPUT
echo 'PHP_INI=error_reporting=E_ALL & ~E_DEPRECATED, display_errors=On' >> "$GITHUB_OUTPUT"
else
echo 'PHP_INI=error_reporting=-1, display_errors=On' >> $GITHUB_OUTPUT
echo 'PHP_INI=error_reporting=-1, display_errors=On' >> "$GITHUB_OUTPUT"
fi

- name: Install PHP
Expand All @@ -132,19 +137,24 @@ jobs:
if: ${{ matrix.phpcs_version != 'lowest' }}
run: composer require squizlabs/php_codesniffer:"${{ matrix.phpcs_version }}" --no-update --no-scripts --no-interaction

- name: "Composer: use lock file when necessary"
if: ${{ matrix.phpcs_version == 'lowest' }}
run: composer config --unset lock

# Install dependencies and handle caching in one go.
# @link https://github.com/marketplace/actions/install-php-dependencies-with-composer
- name: Install Composer dependencies
uses: "ramsey/composer-install@v2"
uses: "ramsey/composer-install@v3"
with:
# Bust the cache at least once a month - output format: YYYY-MM.
custom-cache-suffix: $(date -u "+%Y-%m")

- name: "Composer: set PHPCS/PHPCSUtils version for tests (lowest)"
if: ${{ matrix.phpcs_version == 'lowest' }}
run: >
composer update squizlabs/php_codesniffer phpcsstandards/phpcsutils
--prefer-lowest --ignore-platform-req=php+ --no-scripts --no-interaction
composer update --prefer-lowest --no-scripts --no-interaction
squizlabs/php_codesniffer
phpcsstandards/phpcsutils

- name: Lint against parse errors
if: matrix.phpcs_version == 'dev-master'
Expand Down
Loading