[compiler-rt] r208826 - migrate litlint from argparse to optparse. reenabled
Greg Fitzgerald
gregf at codeaurora.org
Wed May 14 16:31:21 PDT 2014
Author: garious
Date: Wed May 14 18:31:20 2014
New Revision: 208826
URL: http://llvm.org/viewvc/llvm-project?rev=208826&view=rev
Log:
migrate litlint from argparse to optparse. reenabled
Modified:
compiler-rt/trunk/lib/sanitizer_common/scripts/check_lint.sh
compiler-rt/trunk/lib/sanitizer_common/scripts/litlint.py
Modified: compiler-rt/trunk/lib/sanitizer_common/scripts/check_lint.sh
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/scripts/check_lint.sh?rev=208826&r1=208825&r2=208826&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/scripts/check_lint.sh (original)
+++ compiler-rt/trunk/lib/sanitizer_common/scripts/check_lint.sh Wed May 14 18:31:20 2014
@@ -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} \
Modified: compiler-rt/trunk/lib/sanitizer_common/scripts/litlint.py
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/scripts/litlint.py?rev=208826&r1=208825&r2=208826&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/scripts/litlint.py (original)
+++ compiler-rt/trunk/lib/sanitizer_common/scripts/litlint.py Wed May 14 18:31:20 2014
@@ -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)
More information about the llvm-commits
mailing list