Skip to content

Commit

Permalink
Merge pull request #287 from PHPCSStandards/feature/ghactions-various…
Browse files Browse the repository at this point in the history
…-tweaks

GH Actions: various tweaks
  • Loading branch information
jrfnl authored Nov 12, 2023
2 parents 8b59c9d + eb325bd commit a36e2d6
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 19 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/basics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
composer require --no-update squizlabs/php_codesniffer:"dev-master" --no-interaction
# Install dependencies and handle caching in one go.
# @link https://github.com/marketplace/actions/install-composer-dependencies
# @link https://github.com/marketplace/actions/install-php-dependencies-with-composer
- name: Install Composer dependencies
uses: "ramsey/composer-install@v2"
with:
Expand All @@ -62,7 +62,8 @@ jobs:
# Show XML violations inline in the file diff.
# @link https://github.com/marketplace/actions/xmllint-problem-matcher
- uses: korelstar/xmllint-problem-matcher@v1
- name: Enable showing XML issues inline
uses: korelstar/xmllint-problem-matcher@v1

# Validate the Ruleset XML file.
# @link http://xmlsoft.org/xmllint.html
Expand Down Expand Up @@ -112,7 +113,7 @@ jobs:

# 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-composer-dependencies
# @link https://github.com/marketplace/actions/install-php-dependencies-with-composer
- name: Install Composer dependencies
uses: "ramsey/composer-install@v2"
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/quicktest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
run: composer require squizlabs/php_codesniffer:"${{ matrix.phpcs_version }}" --no-update --no-scripts --no-interaction

# Install dependencies and handle caching in one go.
# @link https://github.com/marketplace/actions/install-composer-dependencies
# @link https://github.com/marketplace/actions/install-php-dependencies-with-composer
- name: Install Composer dependencies - normal
if: matrix.php != 'latest'
uses: "ramsey/composer-install@v2"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
run: composer require squizlabs/php_codesniffer:"${{ matrix.phpcs_version }}" --no-update --no-scripts --no-interaction

# Install dependencies and handle caching in one go.
# @link https://github.com/marketplace/actions/install-composer-dependencies
# @link https://github.com/marketplace/actions/install-php-dependencies-with-composer
- name: Install Composer dependencies - normal
if: ${{ startsWith( matrix.php, '8' ) == false }}
uses: "ramsey/composer-install@v2"
Expand Down Expand Up @@ -148,7 +148,7 @@ jobs:
run: composer require squizlabs/php_codesniffer:"${{ matrix.phpcs_version }}" --no-update --no-scripts --no-interaction

# Install dependencies and handle caching in one go.
# @link https://github.com/marketplace/actions/install-composer-dependencies
# @link https://github.com/marketplace/actions/install-php-dependencies-with-composer
- name: Install Composer dependencies
uses: "ramsey/composer-install@v2"
with:
Expand Down
1 change: 1 addition & 0 deletions .yamllint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ yaml-files:
- '*.yaml'
- '*.yml'
- '.yamllint'
- 'phpstan.neon*'

# Rule documentation: https://yamllint.readthedocs.io/en/stable/rules.html
rules:
Expand Down
30 changes: 17 additions & 13 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
parameters:
#phpVersion: 50400 # Needs to be 70100 or higher... sigh...
# phpVersion: 50400 # Needs to be 70100 or higher... sigh...
level: 6
paths:
- Modernize
Expand All @@ -10,6 +10,8 @@ parameters:
treatPhpDocTypesAsCertain: false

ignoreErrors:
# yamllint disable rule:line-length

# Level 1
# Keep to stay in line with parent class.
-
Expand All @@ -22,21 +24,21 @@ parameters:
-
message: '`^Property \S+Sniff::\$(phpVersion|tabWidth) \(int\) in isset\(\) is not nullable\.$`'
paths:
- Modernize\Sniffs\FunctionCalls\DirnameSniff.php
- Universal\Sniffs\Arrays\DuplicateArrayKeySniff.php
- Universal\Sniffs\CodeAnalysis\ConstructorDestructorReturnSniff.php
- Universal\Sniffs\WhiteSpace\CommaSpacingSniff.php
- Universal\Sniffs\WhiteSpace\DisallowInlineTabsSniff.php
- Universal\Sniffs\WhiteSpace\PrecisionAlignmentSniff.php
- Modernize\Sniffs\FunctionCalls\DirnameSniff.php
- Universal\Sniffs\Arrays\DuplicateArrayKeySniff.php
- Universal\Sniffs\CodeAnalysis\ConstructorDestructorReturnSniff.php
- Universal\Sniffs\WhiteSpace\CommaSpacingSniff.php
- Universal\Sniffs\WhiteSpace\DisallowInlineTabsSniff.php
- Universal\Sniffs\WhiteSpace\PrecisionAlignmentSniff.php
-
message: '`^Strict comparison using === between true and false will always evaluate to false\.$`'
paths:
- Modernize\Sniffs\FunctionCalls\DirnameSniff.php
- Universal\Sniffs\Arrays\DuplicateArrayKeySniff.php
- Universal\Sniffs\CodeAnalysis\ConstructorDestructorReturnSniff.php
- Universal\Sniffs\WhiteSpace\CommaSpacingSniff.php
- Universal\Sniffs\WhiteSpace\DisallowInlineTabsSniff.php
- Universal\Sniffs\WhiteSpace\PrecisionAlignmentSniff.php
- Modernize\Sniffs\FunctionCalls\DirnameSniff.php
- Universal\Sniffs\Arrays\DuplicateArrayKeySniff.php
- Universal\Sniffs\CodeAnalysis\ConstructorDestructorReturnSniff.php
- Universal\Sniffs\WhiteSpace\CommaSpacingSniff.php
- Universal\Sniffs\WhiteSpace\DisallowInlineTabsSniff.php
- Universal\Sniffs\WhiteSpace\PrecisionAlignmentSniff.php
-
message: '`^Property PHPCSExtra\\Universal\\Sniffs\\Arrays\\DuplicateArrayKeySniff\:\:\$currentMaxIntKey[GL]t8 \(int\) in isset\(\) is not nullable\.$`'
path: Universal\Sniffs\Arrays\DuplicateArrayKeySniff.php
Expand All @@ -50,3 +52,5 @@ parameters:
# We're not using strict types, so this will be juggled without any issues.
- '#^Parameter \#3 \$value of method \S+File::recordMetric\(\) expects string, \(?(float|int|bool)(<[^>]+>)?(\|(float|int|bool)(<[^>]+>)?)*\)? given\.$#'
- '#^Parameter \#2 \$content of method \S+Fixer::replaceToken\(\) expects string, \(?(float|int|bool)(<[^>]+>)?(\|(float|int|bool)(<[^>]+>)?)*\)? given\.$#'

# yamllint enable rule:line-length

0 comments on commit a36e2d6

Please sign in to comment.