()
| 7857 | |
| 7858 | |
| 7859 | def main(): |
| 7860 | filenames = ParseArguments(sys.argv[1:]) |
| 7861 | backup_err = sys.stderr |
| 7862 | try: |
| 7863 | # Change stderr to write with replacement characters so we don't die |
| 7864 | # if we try to print something containing non-ASCII characters. |
| 7865 | sys.stderr = codecs.StreamReader(sys.stderr, "replace") |
| 7866 | |
| 7867 | _cpplint_state.ResetErrorCounts() |
| 7868 | for filename in filenames: |
| 7869 | ProcessFile(filename, _cpplint_state.verbose_level) |
| 7870 | # If --quiet is passed, suppress printing error count unless there are errors. |
| 7871 | if not _cpplint_state.quiet or _cpplint_state.error_count > 0: |
| 7872 | _cpplint_state.PrintErrorCounts() |
| 7873 | |
| 7874 | if _cpplint_state.output_format == "junit": |
| 7875 | sys.stderr.write(_cpplint_state.FormatJUnitXML()) |
| 7876 | |
| 7877 | finally: |
| 7878 | sys.stderr = backup_err |
| 7879 | |
| 7880 | sys.exit(_cpplint_state.error_count > 0) |
| 7881 | |
| 7882 | |
| 7883 | if __name__ == "__main__": |
no test coverage detected