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

Run phpinsights, returning a boolean value (true/false) if all checks pass #681

Open
kirkbushell opened this issue May 21, 2024 · 3 comments

Comments

@kirkbushell
Copy link

Q A
Bug report? no
Feature request? yes
Library version 2.11.0

We're looking to run phpinsights on a git commit prehook, so that if there are issues with a file about to be committed, the commit is prevented. This is currently not possible, so ideally adding an additional format could be a way of doing this - adding a new format called "boolean" which when run in the console and exits with an error. This can then be picked up in scripts and prevent the commit from occurring.

It is our view that this is quite important in order to prevent issues before they even reach the codebase. --fix is not an option here, as we're also looking to help educate our team, not just sweep any issues under the rug (it would also be quite odd for engineers to see that their code had changed once they viewed it on github).

@kirkbushell
Copy link
Author

Or better yet, just have a parameter that allows the code to exit with an error if a check doesn't pass minimum requirements.

@fkandus
Copy link

fkandus commented May 25, 2024

@kirkbushell I think this is already possible. I'm using the following parameters:

--no-interaction --min-quality=$min_quality --min-complexity=$min_complexity --min-architecture=$min_architecture --min-style=$min_style

@kirkbushell
Copy link
Author

@fkandus oooh, okay I'll give that a go - ty! :)

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

No branches or pull requests

2 participants