From 3f7dce808c35ba41c6d7d0ee5466bbd199ce7249 Mon Sep 17 00:00:00 2001 From: David Brazdil Date: Fri, 16 Jan 2015 23:31:11 +0000 Subject: [PATCH] Checker cleanup Added a comment, removed unused temp directory code. Change-Id: I3df87e801e72ccd5a87c7dbc67335e9936623560 --- tools/checker.py | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/tools/checker.py b/tools/checker.py index 24784cec6..b71eac6e2 100755 --- a/tools/checker.py +++ b/tools/checker.py @@ -700,8 +700,6 @@ def ParseArguments(): help="print the contents of an output group") parser.add_argument("-q", "--quiet", action="store_true", help="print only errors") - parser.add_argument("--no-clean", dest="no_clean", action="store_true", - help="don't clean up generated files") return parser.parse_args() @@ -725,6 +723,9 @@ def DumpGroup(outputFilename, groupName): Logger.fail("Group \"" + groupName + "\" not found in the output") +# Returns a list of files to scan for check annotations in the given path. Path +# to a file is returned as a single-element list, directories are recursively +# traversed and all '.java' files returned. def FindCheckFiles(path): if not path: Logger.fail("No source path provided") @@ -753,19 +754,13 @@ def RunChecks(checkPrefix, checkPath, outputFilename): if __name__ == "__main__": args = ParseArguments() + if args.quiet: Logger.Verbosity = Logger.Level.Error - tempFolder = tempfile.mkdtemp() - try: - if args.list_groups: - ListGroups(args.tested_file) - elif args.dump_group: - DumpGroup(args.tested_file, args.dump_group) - else: - RunChecks(args.check_prefix, args.source_path, args.tested_file) - finally: - if args.no_clean: - print("Files left in %s" % tempFolder) - else: - shutil.rmtree(tempFolder) + if args.list_groups: + ListGroups(args.tested_file) + elif args.dump_group: + DumpGroup(args.tested_file, args.dump_group) + else: + RunChecks(args.check_prefix, args.source_path, args.tested_file) -- 2.11.0