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

Fix/phpcs #223

Merged
merged 9 commits into from
Mar 19, 2024
Merged

Fix/phpcs #223

merged 9 commits into from
Mar 19, 2024

Conversation

darylldoyle
Copy link
Collaborator

Description of the Change

This PR does a couple of things:

  • Fixes an issue where PHPCS was not running when changes were made in the theme or plugin
  • Upgrades the 10up PHPCS to the latest version
  • Fixes current PHPCS issues
  • Adds a PHPCS check to Github Actions within the scaffold

Closes #219
Closes #216
Closes #198

How to test the Change

  • Run PHPCS

Credits

Props @darylldoyle @Jamesking56

Checklist:

  • I agree to follow this project's Code of Conduct.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests pass.

Copy link
Member

@fabiankaegy fabiankaegy left a comment

Choose a reason for hiding this comment

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

Left two suggestions / questions. But this is great :)

Comment on lines +2 to +15
/**
* Plugin Name: 10up Plugin Scaffold
* Description: A brief description of the plugin.
* Version: 0.1.0
* Requires at least: 4.9
* Requires PHP: 7.2
* Author: 10up
* Author URI: https://10up.com
* License: GPL v2 or later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Text Domain: tenup-plugin
* Domain Path: /languages
* Update URI: https://github.com/10up/wp-scaffold
*
Copy link
Member

Choose a reason for hiding this comment

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

Isn't all this metadata that never actually shows anywhere since mu-plugins are using the plugin loader approach?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Correct, though it's not uncommon for someone to copy-paste the mu-plugin as a scaffold for a standard plugin, in which case it's helpful to have this in place.

phpcs.xml Outdated
Comment on lines 5 to 11
<!-- Scan these directories -->
<file>./themes/*</file>
<file>./mu-plugins/*</file>

<!-- Don't scan these directories -->
<exclude-pattern>dist/</exclude-pattern>
<exclude-pattern>plugins/*</exclude-pattern>
<exclude-pattern>./plugins/*</exclude-pattern>
Copy link
Member

Choose a reason for hiding this comment

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

I feel like this will cause issues pretty soon. To me there are valid reasons why I may need to add custom plugins to the plugins directory and 3rd party plugins to the mu-plugins folder.

Maybe it makes more sense to not use any wildcards but explicitly specify the folders we want?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm happy with that. Updated to exclude node_modules and vendor but include plugins by default

@fabiankaegy fabiankaegy added the bug Something isn't working label Mar 19, 2024
@darylldoyle darylldoyle merged commit 625ebce into trunk Mar 19, 2024
3 checks passed
@darylldoyle darylldoyle deleted the fix/phpcs branch March 19, 2024 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PHPCS Broken PHPCS does not scan mu-plugins folder
3 participants