From 6ff852fe1b49518b4f6419792c9381b43d3e1f7c Mon Sep 17 00:00:00 2001 From: Greg Fitzgerald Date: Wed, 14 May 2014 23:31:20 +0000 Subject: migrate litlint from argparse to optparse. reenabled git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@208826 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/sanitizer_common/scripts/check_lint.sh | 3 +-- lib/sanitizer_common/scripts/litlint.py | 11 +++++------ 2 files changed, 6 insertions(+), 8 deletions(-) (limited to 'lib/sanitizer_common/scripts') 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'(?