-
Notifications
You must be signed in to change notification settings - Fork 396
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
Require blt validate:phpcbf #977
Comments
Yeah I agree, I've wanted to create this feature for some time. |
@grasmash, @jayakrishnanj I'd be happy to take this on if you'd like. |
@dooleymatt Yes please! |
I, too, would like to see this command. @dooleymatt, I merely request that 1) it doesn't go under |
@TravisCarden sounds good. Thanks for the input. I've been struggling to figure out which files should be fixed with this function. So far, my thinking has been that the most common use of this function is probably going to be to fix files that are flagged with PHPCS violations in the pre-commit hook. Which, to me means that the files that are fixed should probably default to the files that are staged for commit. I agree that it shouldn't run automatically, however, I feel like there should either be an interactive prompt to the user asking if they want to automatically fix violations when they are found, or a message that just says run Additionally, I think that there should be PHPCBF tasks that would mirror the PHPCS tasks. So, one that would fix all custom code (with the same filters as are used in the PHPCS task), one that would fix a specific fileset, and one that would fix a single file. But, I feel like the default behavior should be to only fix staged files. @TravisCarden, @grasmash, @jayakrishnanj do you guys agree, or do you have any other thoughts on this? |
In the spirit of the Unix philosophy, I would argue for the primary use case being to run on an arbitrary list of files and directories provided by command line argument. That way it has the most generic interface possible, which supports both developer use and piping out-of-the-box. From there it would be easy to write integrations that, for example, pipe in a list of uncommitted files on a given hook. If you wanted to, you could default the scope if no arguments are provided, and cover more or less all your bases. |
@TravisCarden I think I agree completely, but, could you explain what you mean by this? Are you saying that the files argument should default to the list of staged files? Also, if the command is not |
@dooleymatt I incline to say the default behavior (given no command line arguments) should be to test not just changed or staged files but all custom directories. On CI, that's what you would want to do, and as a TA I can imagine good use cases for it. You could add one or more flags like I would suggest a new |
Dig it! Thanks @TravisCarden! |
Merged in #1019 |
Its not a bug, requesting an enhancement.
Now we have blt validate:phpcs for validating, which we can use locally to validate the Code. Similarly if we have blt validate:phpcbf to fix the CS issue, it would help us all.
The text was updated successfully, but these errors were encountered: