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

Add initial support for phpcs and php lint #507

Merged
merged 2 commits into from
Aug 18, 2017
Merged

Conversation

craig-davis
Copy link
Contributor

This addresses #292 to add PHP commit hooks - a much belated contribution!

This PR adds two new linters:

  • PHP Lint via the php -l command to check for valid php syntax and confirms that the file will compile
  • PHP Code Sniffer via phpcs to check for style problems

This can later be followed by other php tooling, but these are the most common and I believe are a good starting point.

This may not be entirely idiomatic Ruby, please feel free to critique and suggest improvements. I've added a collection of specs that should cover the most common cases.

Add two new linters:
  * PHP Lint via the 'php -l' command to check for valid php syntax
    and confirm that the file will compile
  * PHP Code Sniffer via 'phpcs' to check for style problems

This can later be followed by other php tooling, but these are the
most common and are a good starting point.
@sds sds merged commit 09f0550 into sds:master Aug 18, 2017
@sds
Copy link
Owner

sds commented Aug 18, 2017

Thanks for the contribution, @craig-davis!

@craig-davis
Copy link
Contributor Author

@sds Thank you!

We use Overcommit at my employer Help Scout in many of our projects and it's been a valuable tool. I hope this contribution will be the start of adding some other PHP tools by the community.

@craig-davis craig-davis deleted the php-hooks branch August 19, 2017 19:19
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.

2 participants