check if --dirty flag is passed for pint and pass files changed as argument for pint #572
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR relates to laravel/pint#169
Currently, when running pint from sail with
--dirty
flag, the pint doesn't work as the container is not a git repo.In this PR, I have checked if the
--dirty
argument is passed and if it's passed, the list of files changed will be passed as an argument to pint rather.Without the flag
![image](https://user-images.githubusercontent.com/26411488/231379093-0919b9b6-5464-4adc-af52-7d7f26fb8946.png)
--dirty
it works without any change.With the flag
![image](https://user-images.githubusercontent.com/26411488/231379204-4ebb2c47-d5c7-4aec-b123-ebfaa5ce8a66.png)
--dirty
it will update the files only those that are modified.These are the files changed shown by
![image](https://user-images.githubusercontent.com/26411488/231379409-05e664ea-1b89-492f-a66d-9637830720d2.png)
git status --short -- '**.php'
In the previous script, passing
![image](https://user-images.githubusercontent.com/26411488/231379813-81602ed7-282b-4da3-a6a8-33b795b7914b.png)
--dirty
flag make no changes in the filesNOTE⚠️
The excluding files config of
pint.json
will not be respected for now because pint ignores these configs when a file path argument is passed.