Conversation
Rationale behind each of the changes: * `fix = true`: autofix now changed to whether the fixes are automatically applied and commited, which then next line then defines: `fail_on_fix = !autofix` * Removing `stash = "git"`: That option, together with (implicit) `stage = true` had the effect that the autofix changes were directly staged to the commit. The stash, however seemed to be empty when testing locally, making it hard to verify what the autofix actually did. Therefore I changed it to the recommended behavior (by deleting this line and adding) * `stage = false`: This seems to me the most intuitive behavior. Now, no changes are made to the staged code. Changes by autofix are directly visible to with `git diff` and need to be added manually (but I'd argue that should simply be part of the workflow).
|
Trying to understand what effect the changes will have: Default workflow New default workflow would be to apply fixes, but fail the commit so the changes can be reviewed. If you have unstaged changes when committing, the fixes will also run on these, meaning compared to before changes that are not intended to be committed yet are processed, including potential work in progress. The previous behavior though is similar if there is a check failing that requires running the fix. Running TLDR: It should be tested if checks run on unstaged changes and can present commits. I'll try that out to check the behavior. Autofix workflow Automatically apply fixes and commit. I think for this we would still want |
Yes.
That's true.
From my test that I just did this seems true. Unfortunately, it seems that the combination of
After further investigating, I find case 2 to be the worst case: It can prevent commits even though the code to be commited is fine. |
Stashing does not seem to work with fail on fix. To avoid commits being rejected, this change stashes unstaged changes and then stages the fixes.
|
What speaks against
but I did not find any hint that the |
That's definitely a fourth possibility I missed mentioning. I dislike this configuration because then again, unstaged changes could prevent a commit. |
Ok, tested this now and this basically results in the fix not being applied, so no difference really to the current default. Option 1 would be the safe option, where the fixes are applied manually (e.g. Option 3 for me is very much like the current "autofix" option with the only difference being that the commit is not created in case a fix is applied, but there is also no possibility to see what was changed exactly. So I would not see an advantage in it over the current "autofix" approach. I think all-in-all I would tend to stick with the current behavior due to the transparency. In my experience so far it was OK to need to run What do you think @movabo ? |
Rationale behind each of the changes:
fix = true: autofix now changed to whether the fixes are automatically applied and commited, which then next line then defines:fail_on_fix = !autofixstash = "git": That option, together with (implicit)stage = truehad the effect that the autofix changes were directly staged to the commit. The stash, however seemed to be empty when testing locally, making it hard to verify what the autofix actually did. Therefore I changed it to the recommended behavior (by deleting this line and adding)stage = false: This seems to me the most intuitive behavior. Now, no changes are made to the staged code. Changes by autofix are directly visible to withgit diffand need to be added manually (but I'd argue that should simply be part of the workflow).