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 a --commit option to automatically commit fixes #233

Conversation

caendesilva
Copy link

@caendesilva caendesilva commented Nov 28, 2023

Abstract

This pull request adds a --commit option to the Pint command, making it easy to commit style changes to Git!

Development

I tried to match the output formatting and code style to the rest of the codebase, as best I could. The implementation could probably be simplified, instead of using the new action class.

Tests

I have not yet added tests, as I first want to know if this is of interest to the maintainers. When given the go-ahead I'm more than happy to add them.

Screenshots

Success:

image

Nothing to change:

image

Error:

image

app/Actions/GitCommitter.php Outdated Show resolved Hide resolved
app/Actions/GitCommitter.php Outdated Show resolved Hide resolved
app/Actions/GitCommitter.php Outdated Show resolved Hide resolved
app/Actions/GitCommitter.php Outdated Show resolved Hide resolved
app/Actions/GitCommitter.php Outdated Show resolved Hide resolved
@caendesilva
Copy link
Author

caendesilva commented Nov 29, 2023

Thanks for reviewing @nunomaduro, I really appreciate it! I'm a bit busy today but will fix everything as soon as I can! 🚀

Edit: Making changes incrementally when I have time, I'll mark the PR as ready for review when I'm done :)

Rename makeCommit to commit

Type array key

Normalize clean working tree message with Git
@caendesilva caendesilva force-pushed the add-option-to-automatically-commit-fixes branch from de20c9d to 8e87228 Compare November 30, 2023 21:32
@caendesilva caendesilva force-pushed the add-option-to-automatically-commit-fixes branch from 8e87228 to 3d6f3c7 Compare November 30, 2023 21:34
Example: `1 file changed, 2 insertions(+)` instead of `Changes committed successfully!`

laravel#233 (comment)
@caendesilva caendesilva marked this pull request as ready for review November 30, 2023 22:08
@caendesilva
Copy link
Author

Okay, all issues you brought up should be resolved, along with added tests!

@taylorotwell taylorotwell marked this pull request as draft November 30, 2023 22:19
@taylorotwell
Copy link
Member

Drafting pending @nunomaduro final review.

@nunomaduro
Copy link
Member

@taylorotwell @caendesilva I've reviewed and applied a few changes. Wondering if we should also push the changes?

@caendesilva
Copy link
Author

@taylorotwell @caendesilva I've reviewed and applied a few changes. Wondering if we should also push the changes?

By adding another --push flag, or should --commit also push? Because I'm not sure the latter is good as it may violate the principle of least astonishment, though I could also be reading your message wrong?

@taylorotwell
Copy link
Member

Personally don't think we need this flag at the moment. I'm not a big fan of these types of things as they do tend to lead to feature creep.

@caendesilva
Copy link
Author

Personally don't think we need this flag at the moment. I'm not a big fan of these types of things as they do tend to lead to feature creep.

@nunomaduro What do you think? I fully understand Taylor's hesitation regarding feature creep, though I would personally argue that the feature is quite light (and could be simplified further), but adds a lot of value as it speeds up workflows even more.

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

Successfully merging this pull request may close these issues.

3 participants