Skip to content
This repository has been archived by the owner on Sep 16, 2019. It is now read-only.

PHPCS gives different results than Travis CI when run locally with codesniffer ruleset #352

Closed
Larzans opened this issue May 27, 2015 · 2 comments

Comments

@Larzans
Copy link
Contributor

Larzans commented May 27, 2015

I have been trying for a while now to get PHPCS to behave exactly the same as the Travis CI version to be able to correct the 'errors' automatically.
Somehow when i run the command

> wpcs\vendor\bin\phpcs.bat -p -s -v -n --standard="FoundationPress\codesniffer.ruleset.xml" "FoundationPress\library\navigation.php"

It shows me different 'errors' than the one run by Travis.

On startup it tells me

Registering sniffs in the FoundationPress Theme, WordPress Coding Standards Configuration standard
DONE (42 sniffs registered)

While the Travis CI one gives us

Registering sniffs in the WordPress Theme Coding Standards standard
DONE (75 sniffs registered)

So it somehow loads different configurations. Now i don't know if this is due to my setup or some configuration problem (Win 7 64-bit, FoundationPress and WPCS called in subdirs).

Can somebody shed some light on this?

To me it looks as if Travis CI does not use the FoundationPress xml because the name of the standard is given as WordPress Theme Coding Standards and not FoundationPress Theme, WordPress Coding Standards Configuration as it is written in the FoundationPress\codesniffer.ruleset.xml.

@Aetles
Copy link
Contributor

Aetles commented May 27, 2015

To me it looks like it only says WordPress Theme Coding Standards in https://github.com/olefredrik/FoundationPress/blob/master/codesniffer.ruleset.xml (since the change made in ce2b529).

@Larzans
Copy link
Contributor Author

Larzans commented May 27, 2015

Yes, you are absolutely right. It looks like he changed the settings a couple of hours after i did my fork, i didn't notice that.

Now it looks more like the errors i am seeing on Travis bit i am not a hundred percent sure, i will see what happens with future changes :)

Thanks

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

No branches or pull requests

3 participants