[PATCH] D108765: [docs] Fix documentation of clang-format BasedOnStyle type

MyDeveloperDay via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 31 01:23:16 PDT 2021


MyDeveloperDay added inline comments.


================
Comment at: clang/docs/tools/dump_format_style.py:9
 import re
+import inspect
+import subprocess
----------------
FederAndInk wrote:
> HazardyKnusperkeks wrote:
> > I think these should be sorted.
> ok, it will be done
are these standard imports or are we going to have to pip install something?


================
Comment at: clang/docs/tools/dump_format_style.py:18
+PLURAL_FILE = os.path.join(os.path.dirname(__file__), 'plurals.txt')
+subprocess.check_call(['git', 'checkout', '--', PLURAL_FILE])
+plurals = set(open(PLURAL_FILE).read().splitlines())
----------------
FederAndInk wrote:
> HazardyKnusperkeks wrote:
> > So you would add a plurals.txt in git and make the change visible through git diff? What about just reordering? I.e. `Strings` is on line 2, but after a change in line 1. Maybe sort the output?
> > 
> > I'm not against this procedure, but also not in favor. :)
> This line is used to restore the version of plurals.txt to HEAD, so when calling the script multiple times, it keeps showing new plurals until plurals.txt gets committed.
> 
> > So you would add a plurals.txt in git and make the change visible through git diff?
> 
> yes, that's it
> 
> > What about just reordering?
> 
> I don't think we want ordering, it is ordered from first plural generated to last/new one, so git diff will only show new plurals
I'm personally not in favour of this script calling back to git


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D108765/new/

https://reviews.llvm.org/D108765



More information about the cfe-commits mailing list