diff options
author | David Brazdil <dbrazdil@google.com> | 2015-01-16 23:31:11 +0000 |
---|---|---|
committer | David Brazdil <dbrazdil@google.com> | 2015-01-16 23:31:11 +0000 |
commit | 3f7dce808c35ba41c6d7d0ee5466bbd199ce7249 (patch) | |
tree | 0b264ae63f824b05f045da0727a2e516655a3570 /tools/checker.py | |
parent | 2bd68b77b5bf43e77304ef97e9d096b0ad0cab32 (diff) | |
download | art-3f7dce808c35ba41c6d7d0ee5466bbd199ce7249.zip art-3f7dce808c35ba41c6d7d0ee5466bbd199ce7249.tar.gz art-3f7dce808c35ba41c6d7d0ee5466bbd199ce7249.tar.bz2 |
Checker cleanup
Added a comment, removed unused temp directory code.
Change-Id: I3df87e801e72ccd5a87c7dbc67335e9936623560
Diffstat (limited to 'tools/checker.py')
-rwxr-xr-x | tools/checker.py | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/tools/checker.py b/tools/checker.py index 24784ce..b71eac6 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) |