comparison doc/check-seclevel.py @ 43094:e8cf9ad52a78

formatting: run black on all file again Apparently, since the blackgnarok, we divergence from the expected formatting. Formatted using:: grey.py -S $(hg files 'set:**.py - mercurial/thirdparty/** - "contrib/python-zstandard/**" - hgext/fsmonitor/pywatchman/** - contrib/grey.py') # skip-blame mass-reformatting only # no-check-commit reformats foo_bar functions
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Mon, 07 Oct 2019 10:58:51 -0400
parents 86e4daa2d54c
children c102b704edb5
comparison
equal deleted inserted replaced
43093:9002f4a3dde6 43094:e8cf9ad52a78
68 showavailables(ui, initlevel) 68 showavailables(ui, initlevel)
69 errorcnt += 1 69 errorcnt += 1
70 continue 70 continue
71 nextlevel = mark2level[mark] 71 nextlevel = mark2level[mark]
72 if curlevel < nextlevel and curlevel + 1 != nextlevel: 72 if curlevel < nextlevel and curlevel + 1 != nextlevel:
73 ui.warnnoi18n('gap of section level at "%s" of %s\n' % (title, name)) 73 ui.warnnoi18n(
74 'gap of section level at "%s" of %s\n' % (title, name)
75 )
74 showavailables(ui, initlevel) 76 showavailables(ui, initlevel)
75 errorcnt += 1 77 errorcnt += 1
76 continue 78 continue
77 ui.notenoi18n( 79 ui.notenoi18n(
78 'appropriate section level for "%s %s"\n' 80 'appropriate section level for "%s %s"\n'
86 def checkcmdtable(ui, cmdtable, namefmt, initlevel): 88 def checkcmdtable(ui, cmdtable, namefmt, initlevel):
87 errorcnt = 0 89 errorcnt = 0
88 for k, entry in cmdtable.items(): 90 for k, entry in cmdtable.items():
89 name = k.split(b"|")[0].lstrip(b"^") 91 name = k.split(b"|")[0].lstrip(b"^")
90 if not entry[0].__doc__: 92 if not entry[0].__doc__:
91 ui.notenoi18n('skip checking %s: no help document\n' % (namefmt % name)) 93 ui.notenoi18n(
94 'skip checking %s: no help document\n' % (namefmt % name)
95 )
92 continue 96 continue
93 errorcnt += checkseclevel( 97 errorcnt += checkseclevel(
94 ui, entry[0].__doc__, namefmt % name, initlevel 98 ui, entry[0].__doc__, namefmt % name, initlevel
95 ) 99 )
96 return errorcnt 100 return errorcnt
111 for name in sorted( 115 for name in sorted(
112 list(extensions.enabled()) + list(extensions.disabled()) 116 list(extensions.enabled()) + list(extensions.disabled())
113 ): 117 ):
114 mod = extensions.load(ui, name, None) 118 mod = extensions.load(ui, name, None)
115 if not mod.__doc__: 119 if not mod.__doc__:
116 ui.notenoi18n('skip checking %s extension: no help document\n' % name) 120 ui.notenoi18n(
121 'skip checking %s extension: no help document\n' % name
122 )
117 continue 123 continue
118 errorcnt += checkseclevel( 124 errorcnt += checkseclevel(
119 ui, mod.__doc__, '%s extension' % name, initlevel_ext 125 ui, mod.__doc__, '%s extension' % name, initlevel_ext
120 ) 126 )
121 127