make bash8 take a -v flag
this ensures that we actually know we are processing all the files we believe we are. Change-Id: I8e99b5f9dc987c946586475f374f7040ca63a478
This commit is contained in:
parent
d7e38ebd05
commit
b93ee25b64
@ -26,4 +26,4 @@ fi
|
||||
|
||||
echo "Running bash8..."
|
||||
|
||||
./tools/bash8.py $FILES
|
||||
./tools/bash8.py -v $FILES
|
||||
|
@ -110,11 +110,13 @@ def end_of_multiline(line, token):
|
||||
return False
|
||||
|
||||
|
||||
def check_files(files):
|
||||
def check_files(files, verbose):
|
||||
in_multiline = False
|
||||
logical_line = ""
|
||||
token = False
|
||||
for line in fileinput.input(files):
|
||||
if verbose and fileinput.isfirstline():
|
||||
print "Running bash8 on %s" % fileinput.filename()
|
||||
# NOTE(sdague): multiline processing of heredocs is interesting
|
||||
if not in_multiline:
|
||||
logical_line = line
|
||||
@ -141,13 +143,14 @@ def get_options():
|
||||
parser.add_argument('files', metavar='file', nargs='+',
|
||||
help='files to scan for errors')
|
||||
parser.add_argument('-i', '--ignore', help='Rules to ignore')
|
||||
parser.add_argument('-v', '--verbose', action='store_true', default=False)
|
||||
return parser.parse_args()
|
||||
|
||||
|
||||
def main():
|
||||
opts = get_options()
|
||||
register_ignores(opts.ignore)
|
||||
check_files(opts.files)
|
||||
check_files(opts.files, opts.verbose)
|
||||
|
||||
if ERRORS > 0:
|
||||
print("%d bash8 error(s) found" % ERRORS)
|
||||
|
Loading…
Reference in New Issue
Block a user