migrate litlint from argparse to optparse. reenabled
llvm-svn: 208826
This commit is contained in:
parent
082b0035b9
commit
ceae1fbafd
|
@ -50,8 +50,7 @@ run_lint() {
|
|||
if [[ "${SILENT}" != "1" ]]; then
|
||||
cat $TASK_LOG
|
||||
fi
|
||||
# litlint disabled because it requires Python 2.7 or later
|
||||
# ${LITLINT} "$@" 2>>$ERROR_LOG
|
||||
${LITLINT} "$@" 2>>$ERROR_LOG
|
||||
}
|
||||
|
||||
run_lint ${LLVM_LINT_FILTER} --filter=${LLVM_LINT_FILTER} \
|
||||
|
|
|
@ -5,14 +5,13 @@
|
|||
# Check that the RUN commands in lit tests can be executed with an emulator.
|
||||
#
|
||||
|
||||
import argparse
|
||||
import optparse
|
||||
import re
|
||||
import sys
|
||||
|
||||
parser = argparse.ArgumentParser(description='lint lit tests')
|
||||
parser.add_argument('filenames', nargs='+')
|
||||
parser.add_argument('--filter') # ignored
|
||||
args = parser.parse_args()
|
||||
parser = optparse.OptionParser()
|
||||
parser.add_option('--filter') # ignored
|
||||
(options, filenames) = parser.parse_args()
|
||||
|
||||
runRegex = re.compile(r'(?<!-o)(?<!%run) %t\s')
|
||||
errorMsg = "litlint: {}:{}: error: missing %run before %t.\n\t{}"
|
||||
|
@ -23,5 +22,5 @@ def LintFile(p):
|
|||
if runRegex.search(s):
|
||||
sys.stderr.write(errorMsg.format(p, i, s))
|
||||
|
||||
for p in args.filenames:
|
||||
for p in filenames:
|
||||
LintFile(p)
|
||||
|
|
Loading…
Reference in New Issue