Skip to content
Snippets Groups Projects
Commit e470f12d authored by Ryan McElroy's avatar Ryan McElroy
Browse files

check-config: mention the file and line of the error

I used this to more quickly track down a failing test-check-config.t issue
in another repo. I thought it might be useful more generally, so I'm sending
it out in case others think it's a worthwhile change.
parent d341677d
No related branches found
No related tags found
No related merge requests found
......@@ -48,4 +48,5 @@
prevname = ''
confsect = ''
carryover = ''
linenum = 0
for l in open(f):
......@@ -51,4 +52,5 @@
for l in open(f):
linenum += 1
# check topic-like bits
m = re.match('\s*``(\S+)``', l)
......@@ -110,6 +112,6 @@
default = '<variable>'
if (name in foundopts and (ctype, default) != foundopts[name]
and name not in allowinconsistent):
print(l)
print(l.rstrip())
print("conflict on %s: %r != %r" % (name, (ctype, default),
foundopts[name]))
......@@ -114,5 +116,6 @@
print("conflict on %s: %r != %r" % (name, (ctype, default),
foundopts[name]))
print("at %s:%d:" % (f, linenum))
foundopts[name] = (ctype, default)
carryover = ''
else:
......
......@@ -32,5 +32,4 @@
$ $PYTHON contrib/check-config.py < $TESTTMP/files
foo = ui.configint('ui', 'intdefault', default=42)
conflict on ui.intdefault: ('int', '42') != ('int', '1')
......@@ -36,4 +35,5 @@
conflict on ui.intdefault: ('int', '42') != ('int', '1')
at $TESTTMP/testfile.py:12: (glob)
undocumented: ui.doesnotexist (str)
undocumented: ui.intdefault (int) [42]
undocumented: ui.intdefault2 (int) [42]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment