-
Notifications
You must be signed in to change notification settings - Fork 3
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
YoastCS: check YoastCS native files for codestyle compliance #52
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possible small optimization change for cloning/checking out PHPCS.
@@ -42,12 +42,24 @@ before_install: | |||
- export XMLLINT_INDENT=" " | |||
- export PHPCS_DIR=/tmp/phpcs | |||
- export PHPCS_BIN=$PHPCS_DIR/bin/phpcs | |||
- export WPCS_DIR=/tmp/wpcs | |||
- export PHPCOMPAT_DIR=/tmp/phpcompatibility | |||
- mkdir -p $PHPCS_DIR && git clone --depth 1 https://github.com/squizlabs/PHP_CodeSniffer.git -b $PHPCS_BRANCH $PHPCS_DIR | |||
- $PHPCS_BIN --config-set installed_paths $(pwd) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this line still needed? It seems like the configuration is set twice when $SNIFF
is configured.
When not sniffing, this does not need to be cloned or configured right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When not sniffing, the unit tests are run using the PHPCS unit test framework. For that to only test the YoastCS native sniffs, the YoastCS standard needs to be registered, so yes, this is still needed, though it could possibly be combined with the version of it below with an if/then/else syntax. You know how to do those in Travis scripts ?
.phpcs.xml.dist
Outdated
<description>The Coding standard for the Yoast Coding Standard itself.</description> | ||
|
||
<!-- Scan all files. --> | ||
<file>.</file> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation seems off.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed up.
Includes addition of a fully documented `.phpcs.xml.dist` file specifically for YoastCS itself.
1ac787f
to
f15ba0b
Compare
Includes addition of a fully documented
.phpcs.xml.dist
file specifically for YoastCS itself and fixes to the IfElseDeclaration sniff to comply.