Skip to content
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

Update to YoastCS 1.3.0 #59

Merged
merged 8 commits into from
Dec 19, 2019
Merged

Update to YoastCS 1.3.0 #59

merged 8 commits into from
Dec 19, 2019

Conversation

jrfnl
Copy link
Contributor

@jrfnl jrfnl commented Dec 12, 2019

⚠️ The grunt phpcs command, or rather then whole shell command should be disabled, but it is unclear to me how to do this. Help appreciated.

The grunt shell command does linting of the PHP files + a PHPCS check. This should not be done via grunt and the Travis script already contains a PHP lint command and with this PR a PHPCS check.


This PR will be easiest to review by looking at each commit individually.

Composer: use YoastCS 1.3.0

... and update and add relevant Composer scripts.

Note: only the relevant PHPCS/YoastCS dependencies have been updated, the other dependencies have not been touched.

Travis: add CS check

CI/QA: rename PHPCS configuration file

Using a .dist extension allows for individual developers to overload the phpcs.xml.dist with a local phpcs.xml file. This file can include the dist file as a base ruleset using <rule ref="./.phpcs.xml.dist"/>.

To facilitate this, the typical file names for the overloaded PHPCS config file have been added to the .gitignore file.

Build/PHPCS: set up the PHPCS ruleset properly

  • Add XSD schema.
  • Set the command line arguments.
  • Remove exclude-patterns which are already set via YoastCS.
  • Add configuration for the WordPress.WP.I18n sniff.
  • Add configuration for the Yoast.Files.Filename sniff and remove the exclusion.
  • Add configuration for the WordPress.NamingConventions.PrefixAllGlobals sniff.

Build/PHPCS: add temporary exclusion

There is one type of issue remaining for which a technical debt issue has been created - #50 -.
For now, ignore these issues.

PHPCS: replace old-style ignore comment with new style

This code is only used when WP_DEBUG is on to display debugging information.

Includes reformatting the surrounding function call for readability.

PHPCS: whitelist a used parameter

PHPCS: add reason to whitelist comment

Testing

  • Check the detailed Travis script output for the build with the PHPCS=1 environment variable.
  • Locally
    • Check out this branch.
    • Run the following commands:
      • composer install
      • composer check-cs
      • See a clean run without any errors or warnings.

... and update and add relevant Composer scripts.
@jrfnl jrfnl added this to the Next release milestone Dec 12, 2019
jrfnl and others added 7 commits December 12, 2019 20:36
Using a `.dist` extension allows for individual developers to overload the  `phpcs.xml.dist` with a local `phpcs.xml` file. This file can include the `dist` file  as a base ruleset using `<rule ref="./.phpcs.xml.dist"/>`.

To facilitate this, the typical file names for the overloaded PHPCS config file have been added to the `.gitignore` file.
* Add XSD schema.
* Set the command line arguments.
* Remove `exclude-pattern`s which are already set via YoastCS.
* Add configuration for the `WordPress.WP.I18n` sniff.
* Add configuration for the `Yoast.Files.Filename` sniff and remove the exclusion.
* Add configuration for the `WordPress.NamingConventions.PrefixAllGlobals` sniff.
There is one issue remaining for which a technical debt issue has been created - 50 -.
For now, ignore these issues.
This code is only used when `WP_DEBUG` is on to display debugging information.

Includes reformatting the surrounding function call for readability.
@jrfnl jrfnl force-pushed the JRF/update-yoastcs branch from 43c4baf to c6422a7 Compare December 12, 2019 19:36
@andizer andizer self-assigned this Dec 19, 2019
@andizer
Copy link
Contributor

andizer commented Dec 19, 2019

The grunt phpcs command, or rather then whole shell command should be disabled, but it is unclear to me how to do this. Help appreciated.

@jrfnl I believe this command is set in the grunt-plugin-tasks. It should be removed from there because of the grunt configs are combined instead overwritten.

@andizer
Copy link
Contributor

andizer commented Dec 19, 2019

CR done 👍 Acceptance 👍

The failing build is related to your question I guess

@andizer andizer removed their assignment Dec 19, 2019
@andizer andizer merged commit 641fc28 into trunk Dec 19, 2019
@andizer andizer deleted the JRF/update-yoastcs branch December 19, 2019 13:19
@jrfnl
Copy link
Contributor Author

jrfnl commented Dec 19, 2019

The grunt phpcs command, or rather then whole shell command should be disabled, but it is unclear to me how to do this. Help appreciated.

@jrfnl I believe this command is set in the grunt-plugin-tasks. It should be removed from there because of the grunt configs are combined instead overwritten.

Something like that. I honestly searched everywhere in the local plugin grunt configuration and could not find a way to remove it from there. (but grunt isn't my area of expertise).

@jrfnl
Copy link
Contributor Author

jrfnl commented Dec 19, 2019

The failing build is related to your question I guess

Yes. That's it.

@karlijnbok karlijnbok modified the milestones: 1.6.0, 1.7.0 Apr 28, 2021
@karlijnbok karlijnbok added the changelog: non-user-facing Needs to be included in the 'Non-userfacing' category in the changelog label Apr 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog: non-user-facing Needs to be included in the 'Non-userfacing' category in the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants