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

Checker prevents adding image files to repo #44

Open
morganestes opened this issue Aug 28, 2017 · 1 comment
Open

Checker prevents adding image files to repo #44

morganestes opened this issue Aug 28, 2017 · 1 comment
Assignees
Labels

Comments

@morganestes
Copy link

Possibly related to #12, when I have WP Enforcer enabled, I'm prevented from adding images to my Git repo. PHPCS reports multiple errors, most noticeably "mixed line endings" and "ASP style opening tags" in the files. I have theInternal.NoCodeFound rule added but unless I also add an exclude-pattern for those files it still tries to check them, which is super frustrating.

This happens in my theme with screenshot.png and some JPEG images bundled with it.

@stevegrunwell stevegrunwell self-assigned this Sep 18, 2017
@stevegrunwell
Copy link
Owner

Something I've found lately has been that the logic surrounding "only check the files that are being staged for commit" is then causing files that would otherwise be ignored to be processed.

For example, pretend we're committing the following files:

  • index.php
  • functions.php
  • screenshot.png

Rather than running against the entire codebase, WP Enforcer would then pass those files to PHP_CodeSniffer, which can have some strange effects. Definitely something that can (and should) be addressed via the phpcs.xml file.

I'll dig into this, thanks for the report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants