summaryrefslogtreecommitdiff
path: root/lib/sanitizer_common/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sanitizer_common/scripts')
-rwxr-xr-xlib/sanitizer_common/scripts/check_lint.sh3
-rwxr-xr-xlib/sanitizer_common/scripts/litlint.py11
2 files changed, 6 insertions, 8 deletions
diff --git a/lib/sanitizer_common/scripts/check_lint.sh b/lib/sanitizer_common/scripts/check_lint.sh
index 45d61cbd1..0b7aea1ae 100755
--- a/lib/sanitizer_common/scripts/check_lint.sh
+++ b/lib/sanitizer_common/scripts/check_lint.sh
@@ -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} \
diff --git a/lib/sanitizer_common/scripts/litlint.py b/lib/sanitizer_common/scripts/litlint.py
index 15b496ff4..b82eec290 100755
--- a/lib/sanitizer_common/scripts/litlint.py
+++ b/lib/sanitizer_common/scripts/litlint.py
@@ -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)