Skip to content
Snippets Groups Projects
Commit c00f67c1 authored by Katsunori FUJIWARA's avatar Katsunori FUJIWARA
Browse files

docchecker: use indentation of 4 spaces

This is fixing for 'must indent 4 spaces' check-code rule.

check-code has overlooked this, because a file isn't recognized as one
to be checked (this problem is fixed by subsequent patch).
parent 72b02b49
No related branches found
No related tags found
No related merge requests found
......@@ -14,11 +14,11 @@
hg_cramped = re.compile(r'\w:hg:`')
def check(line):
if hg_backtick.search(line):
print(line)
print("""warning: please avoid nesting ' in :hg:`...`""")
if hg_cramped.search(line):
print(line)
print('warning: please have a space before :hg:')
if hg_backtick.search(line):
print(line)
print("""warning: please avoid nesting ' in :hg:`...`""")
if hg_cramped.search(line):
print(line)
print('warning: please have a space before :hg:')
def work(file):
......@@ -23,4 +23,4 @@
def work(file):
(llead, lline) = ('', '')
(llead, lline) = ('', '')
......@@ -26,9 +26,9 @@
for line in file:
# this section unwraps lines
match = leadingline.match(line)
if not match:
check(lline)
(llead, lline) = ('', '')
continue
for line in file:
# this section unwraps lines
match = leadingline.match(line)
if not match:
check(lline)
(llead, lline) = ('', '')
continue
......@@ -34,13 +34,13 @@
lead, line = match.group(1), match.group(2)
if (lead == llead):
if (lline != ''):
lline += ' ' + line
else:
lline = line
else:
check(lline)
(llead, lline) = (lead, line)
check(lline)
lead, line = match.group(1), match.group(2)
if (lead == llead):
if (lline != ''):
lline += ' ' + line
else:
lline = line
else:
check(lline)
(llead, lline) = (lead, line)
check(lline)
def main():
......@@ -45,10 +45,10 @@
def main():
for f in sys.argv[1:]:
try:
with open(f) as file:
work(file)
except BaseException as e:
print("failed to process %s: %s" % (f, e))
for f in sys.argv[1:]:
try:
with open(f) as file:
work(file)
except BaseException as e:
print("failed to process %s: %s" % (f, e))
main()
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