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

PHPCS support #541

Closed
wants to merge 315 commits into from
Closed

Conversation

paulschreiber
Copy link
Contributor

  • add phpcs.xml
  • update composer.json
  • gitignore vendor folder
  • run PHPCBF to fix spacing problems

Rebecca Hum and others added 30 commits May 30, 2017 12:09
Script was stopping after no co-authors was find. Now script will
display an error message and continue to the next post.
Script was stopping after no co-authors was find. Now script will
display an error message and continue to the next post.
Resolves Automattic#417

* Removed duplicate left join for optimization
…r-posts

Fixed WP CLI create-terms-for-posts if no co-authors found
…uthor

Replace hardcoded 'author' with $this->$coauthor_taxonomy
Fixes warning: `Warning: sprintf(): Too few arguments in /path/wp-content/plugins/co-authors-plus/php/class-coauthors-guest-authors.php on line 487`

Warning surfaces when deleting a guest author that is mapped to a WP user
Move parenthesis to fix esc_html and sprintf
@paulschreiber
Copy link
Contributor Author

Tests are passing. Failure was a travis error for WP4.8:

The "https://getcomposer.org/download/1.6.5/composer.phar.sig" file could not
be downloaded: failed to open stream: Connection timed out

mariovalney and others added 20 commits June 13, 2018 11:21
* [Style] Identation changed to tab

* [Feat] Added personal data exporter to guest authors

* [Feat] Added a filter to allow third part plugins add guest author data

* [Style] WPCS fixes

* [Fix] Filter name changed

* [Style] WPCS fixes

* [Fix] Filter name changed
…ests

Re-enable disabled Test_Author_Queries tests
Add post type parameter to the Mine link, so it works for Pages
🐛Only filter author template for title
…repancy

Fix possible discrepancy in author search with ignored authors
…ing-for-irrelevant-caps

Skip irrelevant capabilities filtering in filter_user_has_cap() with whitelist
…ry-queries-on-multisite-test

Removed Test_Author_Queried_Object setUp function
…linked-account

column_posts() should use user_login when querying for linked_account
…count-guest-authors

Fixing double posts counts for users with linked accounts
$ignored_authors in search should use user_nicename, not login.
@GaryJones GaryJones mentioned this pull request Aug 6, 2018
@@ -22,6 +22,8 @@
"forum": "http://wordpress.org/support/plugin/co-authors-plus"
},
"require": {
"composer/installers": "~1.0"
"composer/installers": "~1.0",
"wp-coding-standards/wpcs": "^0.14.0",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should now be ^1.0.

@@ -0,0 +1,14 @@
<?xml version="1.0"?>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be named .phpcs.xml.dist or phpcs.xml.dist, and then add .phpcs.xml and phpcs.xml to the .gitignore, so that folks can override it locally if they wish.

<?xml version="1.0"?>
<ruleset name="WordPress Coding Standards for Co-Authors Plus">

<rule ref="WordPress-VIP" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't include WordPress-VIP here. See #579

<rule ref="WordPress-Docs" />
<rule ref="WordPress-Extra" />

<arg value="s"/>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding flags to show progress, use shorter basepath, adding colors etc. The exact args available depends on what PHPCS version is installed, and that depends on what minimum PHP version should be supported.


<exclude-pattern>*/node_modules/*</exclude-pattern>
<exclude-pattern>*/vendor/*</exclude-pattern>
</ruleset>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By enabling some custom properties (see https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/wiki/Customizable-sniff-properties#properties-strongly-recommended-to-be-set) then extra checks, such as textdomains and deprecations will also be run.

@GaryJones
Copy link
Contributor

Some of the config changes have been handled more recently, and some of the changes are now redundant. There is a lot of PHPCS to tidy up, but it's going to be needed to be done in smaller chunks.

@GaryJones GaryJones closed this Jul 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.