Meinersbur added inline comments.

================
Comment at: docs/CodingStandards.rst:514-516
+line of code. Some common editors will automatically remove trailing whitespace
+when saving a file which causes unrelated changes to appear in diffs and
+commits.
----------------
JDevlieghere wrote:
> chandlerc wrote:
> > Meinersbur wrote:
> > > Just to note that this policy will prohibit the use of remove 
> > > trailing-whitespace feature in editors since it makes it impossible to 
> > > edit the file without also 'editing' any unrelated whitespace. At the 
> > > same time, since not being able to use the feature, I risk committing 
> > > trailing whitespace myself (that is, some additional steps are necessary: 
> > > I use 'git clang-format' which should remove traling whitespace only on 
> > > edited lines and 'git diff' shows trailing whitespace in red; these are 
> > > still additional steps that are easy to miss)
> > I also have editor settings that risk violating this, but I just reduce my 
> > patdh before submitting. This is a touch annoying with svn, but with got it 
> > is pretty simple to use `git add -p` and ignore the unnecessary removals if 
> > trailing whitespace 
> I had the same workflow as Chandler but that became rather tedious for the 
> LLDB repo where there's a lot of trailing whitespace. I ended up adding an 
> alias to my git config that only stages non-whitespace changes: `anw = !sh -c 
> 'git diff -U0 -w --no-color "$@" | git apply --cached --ignore-whitespace 
> --unidiff-zero -'`. It's far from optimal but it works pretty well. 
Thank you for sharing.


https://reviews.llvm.org/D50055



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to