Skip to content

Commit

Permalink
doclinter: Fix files are ignored.
Browse files Browse the repository at this point in the history
  • Loading branch information
tk0miya committed May 26, 2019
1 parent c4b20a8 commit 439f329
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions utils/doclinter.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,15 @@ def lint(path: str) -> int:

def main(args: List[str]) -> int:
errors = 0
for directory in args:
for root, dirs, files in os.walk(directory):
for filename in files:
if filename.endswith('.rst'):
path = os.path.join(root, filename)
errors += lint(path)
for path in args:
if os.path.isfile(path):
errors += lint(path)
elif os.path.isdir(path):
for root, dirs, files in os.walk(path):
for filename in files:
if filename.endswith('.rst'):
path = os.path.join(root, filename)
errors += lint(path)

if errors:
return 1
Expand Down

0 comments on commit 439f329

Please sign in to comment.