()
| 6877 | return child == os.path.join(prefix, child_suffix) |
| 6878 | |
| 6879 | def main(): |
| 6880 | filenames = ParseArguments(sys.argv[1:]) |
| 6881 | backup_err = sys.stderr |
| 6882 | try: |
| 6883 | # Change stderr to write with replacement characters so we don't die |
| 6884 | # if we try to print something containing non-ASCII characters. |
| 6885 | sys.stderr = codecs.StreamReader(sys.stderr, 'replace') |
| 6886 | |
| 6887 | _cpplint_state.ResetErrorCounts() |
| 6888 | for filename in filenames: |
| 6889 | ProcessFile(filename, _cpplint_state.verbose_level) |
| 6890 | # If --quiet is passed, suppress printing error count unless there are errors. |
| 6891 | if not _cpplint_state.quiet or _cpplint_state.error_count > 0: |
| 6892 | _cpplint_state.PrintErrorCounts() |
| 6893 | |
| 6894 | if _cpplint_state.output_format == 'junit': |
| 6895 | sys.stderr.write(_cpplint_state.FormatJUnitXML()) |
| 6896 | |
| 6897 | finally: |
| 6898 | sys.stderr = backup_err |
| 6899 | |
| 6900 | sys.exit(_cpplint_state.error_count > 0) |
| 6901 | |
| 6902 | |
| 6903 | if __name__ == '__main__': |
no test coverage detected