Skip to content
This repository has been archived by the owner on Jun 25, 2020. It is now read-only.

Commit

Permalink
Merge a306ce2 into 12d9715
Browse files Browse the repository at this point in the history
  • Loading branch information
lhutton1 committed Jan 18, 2020
2 parents 12d9715 + a306ce2 commit 088cc76
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 10 additions & 1 deletion html_linter.py
Expand Up @@ -41,6 +41,7 @@
import os
import re
import sys
import fnmatch

import template_remover

Expand Down Expand Up @@ -1087,7 +1088,15 @@ def main(options):

exclude = [_DISABLE_MAP[d] for d in disable if d in _DISABLE_MAP]

filenames = options.get('FILENAME', [])
filenames = []

if options.get('--recursive'):
directory = options.get('DIRECTORY')
for root, dirnames, names in os.walk(directory):
filenames.extend([os.path.join(root, name) \
for name in names if name.endswith('.html')])
else:
filenames = options.get('FILENAME', [])

results = False
for filename in filenames:
Expand Down
2 changes: 2 additions & 0 deletions scripts/html_lint.py
Expand Up @@ -26,6 +26,7 @@
Usage:
html5_lint.py [--disable=DISABLE] [--printfilename] FILENAME...
html5_lint.py [--disable=DISABLE] [--printfilename] [-r | --recursive] DIRECTORY
html5_lint.py (-h | --help)
html5_lint.py --version
Expand All @@ -40,6 +41,7 @@
boolean_attribute, invalid_attribute, void_zero,
invalid_handler, http_equiv, extra_whitespace.
--printfilename Include the filename when printing the results
-r --recursive Specify a directory to lint .html files.
"""

Expand Down

0 comments on commit 088cc76

Please sign in to comment.