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

Travis/QA: always check that all sniffs are feature complete #195

Merged
merged 1 commit into from
Feb 13, 2020

Conversation

jrfnl
Copy link
Collaborator

@jrfnl jrfnl commented Feb 12, 2020

The new phpcsstandards/phpcsdevtools package includes a script which can check whether sniffs are feature complete, i.e. whether all sniffs have unit tests and documentation.

By adding this check to the Travis script, we prevent untested and/or undocumented sniffs from entering the repo.

Ref: https://github.com/PHPCSStandards/PHPCSDevTools#checking-whether-all-sniffs-in-a-phpcs-standard-are-feature-complete

P.S.: the PHPCSDevTools package contains a few more goodies, have a look at the readme for more information.

The new `phpcsstandards/phpcsdevtools` package includes a script which can check whether sniffs are feature complete, i.e. whether all sniffs have unit tests and documentation.

By adding this check to the Travis script, we prevent untested and/or undocumented sniffs from entering the repo.

P.S.: the `PHPCSDevTools` package contains a few more goodies, have a look at the [readme](https://github.com/PHPCSStandards/PHPCSDevTools) for more information.
@jrfnl jrfnl added this to the 2.x Next Release milestone Feb 12, 2020
@hansjovis hansjovis self-requested a review February 13, 2020 13:19
@hansjovis hansjovis self-assigned this Feb 13, 2020
Copy link
Contributor

@hansjovis hansjovis left a comment

Choose a reason for hiding this comment

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

Code Review: 👍

This is actually very meta: sniffs for checking sniffs 😄.

@hansjovis
Copy link
Contributor

Acceptance test: ✅

  • The Travis build passes and the check-complete composer command is executed.
  • Running the check-complete composer command locally works as well.
    • I get 13 results, which is consistent with the number of Yoast sniffs we have.
    • Manually removing a unit test for a Yoast sniff correctly gives an error:
      ERROR: Unit tests missing for /Yoast/Sniffs/Files/FileNameSniff.php.

@hansjovis hansjovis merged commit f22d90a into develop Feb 13, 2020
@hansjovis hansjovis deleted the JRF/add-sniff-completeness-check branch February 13, 2020 13:55
@hansjovis hansjovis removed their assignment Feb 13, 2020
@jrfnl
Copy link
Collaborator Author

jrfnl commented Feb 13, 2020

This is actually very meta: sniffs for checking sniffs

It's not actually a sniff, but a simple command-line PHP script. I actually wrote it for PHPCS itself, but set it up so it can also be used by external standards 😉

If we're talking meta:
For WPCS we'll be creating some dev sniffs to be run over WP Core to generate the lists with deprecated functions and such for the user-facing sniffs. 😎
Sniffs are good at retrieving that kind of info and it can help prevent (the user-facing) sniffs from going out-of-date because lists aren't (manually) updated regularly enough.

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

Successfully merging this pull request may close these issues.

None yet

2 participants