-
-
Notifications
You must be signed in to change notification settings - Fork 8
Release PHPCSExtra 1.3.0 #332
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
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
The `Universal.UseStatement.KeywordSpacing` sniff has a difference in behaviour between PHP < 8.0 and PHP 8.0+ due to the change in how namespaced name tokens are tokenized in PHP 8.0+. For that reason, the `KeywordSpacingUnitTest.2.inc` did not have a ".fixed" file as whether or not a fix would be made depends on which PHP version the tests are being run on. As of PHPCS 3.9.0, PHPCS will throw a PHPUnit warning for missing "fixed" files and as of PHPCS 4.0.0, this will become an error. With that in mind, this commit adds the missing "fixed" file, but excludes that test from being run on PHP 8.0+ by overloading the `getTestFiles()` method and selectively removing the test case file from the list of files to test.
…phpcs-3.9.0 UseStatements/KeywordSpacing: add missing "fixed" test file
* The `--ignore-platform-req=php+` is no longer needed now PHPUnit 8 and 9 are supported (since PR 299 / PHPCS 3.8.0). * Minor readability improvement of the script snippet.
…weaks GH Actions: minor tweaks
Bumps [ramsey/composer-install](https://github.com/ramsey/composer-install) from 2 to 3. - [Release notes](https://github.com/ramsey/composer-install/releases) - [Commits](ramsey/composer-install@v2...v3) --- updated-dependencies: - dependency-name: ramsey/composer-install dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]>
…/ramsey/composer-install-3 GH Actions: Bump ramsey/composer-install from 2 to 3
Bumps [mondeja/remove-labels-gh-action](https://github.com/mondeja/remove-labels-gh-action) from 1 to 2. - [Release notes](https://github.com/mondeja/remove-labels-gh-action/releases) - [Commits](mondeja/remove-labels-gh-action@v1...v2) --- updated-dependencies: - dependency-name: mondeja/remove-labels-gh-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]>
…/mondeja/remove-labels-gh-action-2 GH Actions: Bump mondeja/remove-labels-gh-action from 1 to 2
... to comply with changes in Remark. _sigh_
…rkdown Bug report template: tweak markdown
* Composer: avoid writing a lock file * Allow use of Composer lock file in some tests
Okay, so apparently, there is a long-standing bug in the Microsoft package deploy process which caused `apt-get update` to fail in the first half hour after Microsoft has deployed a package. The failure looks like this: ``` E: Failed to fetch https://packages.microsoft.com/ubuntu/22.04/prod/dists/jammy/InRelease Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?) ``` As this only happens intermittently (after a MS package deploy), the chance of running into this bug are slim, but guess what: today I ran into it. This change to the workflow is intended to prevent the next person running into this issue from having to waste time on figuring this out. By splitting the "Install xmllint" step into two steps: one doing the `apt-get update` and one doing the actual install and making the first step one which is allowed to `continue-on-error`, this issue should hopefully not crop up anymore. Any errors in the `apt-get update` step will now be ignored and as most errors which could potentially come from that step are irrelevant for the rest of the job anyway, this is fine. If a relevant error would be surfaced, the next step (the xmllint install), will fail the job anyway. Refs: * actions/runner-images#3410 * dotnet/core#4167
…-bypass-apt-get-update GH Actions: work around intermittent apt-get errors
* Double checked that all existing XML docs have the `xsi` attributes and schema reference on the `<documentation>` element. * Verified that the contents of `<standard>` elements is consistently indented (with four spaces). * Verified that all `<code>` `title` attributes use proper capitalization and punctuation.
…tency-fixes Documentation: minor consistency fixes
…-minor-update Release checklist: minor update
A number of reusable workflows have been introduced in the `PHPCSStandards/.github` repository for workflows used in multiple repos in this organisation, for which the steps are basically the same everywhere. This will make maintenance of these workflows more straight-forward. This commit switches a number of the basic QA workflows over to start using the reusable workflows.
Fix a few URLs which were being redirected. Includes: * Replacing badges from poser.pugx.org with badges using img.shields.io.
…sable-workflows GH Actions/Basics: use reusable workflow & fix some URLs
... to satisfy shellcheck rule SC2086: "Double quote to prevent globbing and word splitting". Ref: https://www.shellcheck.net/wiki/SC2086
GH Actions: always quote variables
This partially reverts commit f0f9421 (PR 317) after improvements upstream in the Remark no-dead-urls module. Ref: remarkjs/remark-lint-no-dead-urls 54
…url-changes Partially revert "README/Changelog: fix a few URLs which have changed"
While likely to be edge cases, there are a couple more tokens in which inline, non-indentation tabs can exist: * `T_START_HEREDOC` and `T_START_NOWDOC` - between the `<<<` and the identifiers. * `T_YIELD_FROM` - between the `yield` and the `from` keywords. This updates the sniff to also handle those tokens. Includes additional unit tests. Loosely related to upstream changes which start doing tab replacement in these tokens too. Note: this PR is _not_ dependent on the upstream changes and does not warrant raising the minimum supported PHPCS version.
…winlinetabs-handle-yield-from Universal/DisallowInlineTabs: handle more tokens
Follow up on 320 The Tokenizer changes related to `yield from` with comments, which were expected to go into PHPCS 3.11.0, have been merged. This updates the condition used in the tests to reflect the upstream change.
…winlinetabs-update-for-upstream-merge Universal/DisallowInlineTabs: minor tweak to the tests
…file This commit updates the sniff to use `return $phpcsFile->numTokens` instead of `return ($phpcsFile->numTokens + 1)`. If a sniff file contains 50 tokens, the last `$stackPtr` will be 49, so returning `50` will already get us passed the end of the token stack and the `+ 1` is redundant. Includes minor fix to the return type as the method never returns `void`.
…efunctionsfromoo-minor-fix Universal/SeparateFunctionsFromOO: simplify skipping the rest of the file
This Monday, [PHPStan 2.0 will be released](https://phpc.social/@OndrejMirtes/113441109253809720). I've done some preliminary scans with PHPStan 2.0-dev to check if this would have an impact on this codebase and as things are, this would mean the build would start to fail. For now, I'm proposing to make a small change in the GH Actions workflow to explicitly use PHPStan 1.x. This buys us some time to evaluate PHPStan 2.0 properly and to make any changes needed to make the codebase compatible with PHPStan 2.x when we're ready for it. Note: At least one of the new issues reported has been identified as a bug and reported to PHPStan: phpstan/phpstan#11980
…stan-1.0 GH Actions: use explicit PHPStan major
Various minor doc fixes
PHPStan 2.0 has been released 🎉 This commit makes the necessary updates to switch to PHPStan 2.0. Includes normalizing slashes in path references in the PHPStan config file. Refs: * https://phpstan.org/blog/phpstan-2-0-released-level-10-elephpants * https://github.com/phpstan/phpstan/blob/2.0.x/UPGRADING.md * https://github.com/phpstan/phpstan/releases/tag/2.0.0
PHPStan 2.0: update configuration
... which is expected later this month. * Builds against PHP 8.4 are no longer allowed to fail. * Update PHP version on which code coverage is run (high should now be 8.4). * Add _allowed to fail_ build against PHP 8.5. * Update the "tested against" badge in the README.
…il-on-8.4 GH Actions: update for the release of PHP 8.4
The intention is for there to be a dedicated action runner available at some point for XML code style checking, so let's move this to a separate job. Also see: PHPCSStandards/PHPCSDevTools#145
Instead of doing all the installation steps for xmllint validation in the workflow, use the ✨ new dedicated `phpcsstandards/xmllint-validate` action runner instead. Ref: https://github.com/marketplace/actions/xmllint-validate
... for dev tool files.
…xmllint-validation GH Actions: use the xmllint-validate action runner and enhance checks
... to forbid using `true`, `false` and `null` as fully qualified constants. Includes fixer. Includes unit tests. Includes documentation. Note: yes, there is a related tokenizer issue in PHPCS where these tokens are not tokenized the same PHP cross-version, however, the tokenization will change in PHPCS 4.0 as well, so there isn't much point addressing that now as it would just make things even more complicated for sniffs come PHPCS 4.0. And yes, this does mean that this sniff will need adjusting for PHPCS 4.0.
…alse-null ✨ New Universal.PHP.NoFQNTrueFalseNull sniff
... which is the latest release containing tokenizer changes. Includes removing some code which has become redundant after upstream PR PHPCSStandards/PHP_CodeSniffer 647 was merged (included in 3.11.0).
…pcs-version Composer: raise the minimum supported PHPCS version to 3.12.1
PHP 8.2 introduced DNF types, which use parenthesis. This commit adds support to the `Universal.Operators.TypeSeparatorSpacing` sniff to also check the spacing around the parenthesis for DNF types. Notes: * Allows for a new line before the start of a type for function parameters. * Expects one space before the type operator if the type starts with a DNF open parenthesis. * Expects one space after the type operator if the type ends on a DNF close parenthesis. * Includes protection against throwing two errors for the same issue, like when a DNF close parenthesis if followed by a union type operator and there is whitespace between these. Includes tests. Includes updated documentation.
…ratorspacing-support-dnf-types Universal/TypeSeparatorSpacing: add support for PHP 8.2 DNF types
Changelog and readme updates for PHPCSExtra 1.3.0
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.
Release checklist
General
composer.json
- PR Composer: raise the minimum supported PHPCS version to 3.12.1 #330✏️ Remember to add a release link at the bottom!
README
(if applicable) - PR Changelog and readme updates for PHPCSExtra 1.3.0 #331Release
develop
!) & copy & paste the changelog to it.✏️ Check if anything from the link collection at the bottom of the changelog needs to be copied in!
develop
to be equal tostable
Publicize