"Format before committing" should only format files edited in current commit

Right now, “Format Before Committing” is useful but causes issues in shared repos.

  1. If one user uses “Format Before Committing” while others are have written unformatted code, then the formatted commit will reformat all other users’ code. This greatly muddies the git blame and makes the resulting PR harder to review.
  2. The commit itself takes longer to run when it has to check every single file to format, instead of just edited files.
  3. The user is never warned that their commit is editing files other than the ones shown in “Selected changes”.

Making “Format Before Committing” only update edited and added files is more intuitive, collaboration friendly, and performant than the global check it’s currently doing.

1 Like