| @@ 6452-6471 (lines=20) @@ | ||
| 6449 | exclude_paths = [os.path.abspath(f) for f in _excludes] |
|
| 6450 | return [f for f in filenames if os.path.abspath(f) not in exclude_paths] |
|
| 6451 | ||
| 6452 | def main(): |
|
| 6453 | filenames = ParseArguments(sys.argv[1:]) |
|
| 6454 | backup_err = sys.stderr |
|
| 6455 | try: |
|
| 6456 | # Change stderr to write with replacement characters so we don't die |
|
| 6457 | # if we try to print something containing non-ASCII characters. |
|
| 6458 | sys.stderr = codecs.StreamReader(sys.stderr, 'replace') |
|
| 6459 | ||
| 6460 | _cpplint_state.ResetErrorCounts() |
|
| 6461 | for filename in filenames: |
|
| 6462 | ProcessFile(filename, _cpplint_state.verbose_level) |
|
| 6463 | _cpplint_state.PrintErrorCounts() |
|
| 6464 | ||
| 6465 | if _cpplint_state.output_format == 'junit': |
|
| 6466 | sys.stderr.write(_cpplint_state.FormatJUnitXML()) |
|
| 6467 | ||
| 6468 | finally: |
|
| 6469 | sys.stderr = backup_err |
|
| 6470 | ||
| 6471 | sys.exit(_cpplint_state.error_count > 0) |
|
| 6472 | ||
| 6473 | ||
| 6474 | if __name__ == '__main__': |
|
| @@ 6452-6471 (lines=20) @@ | ||
| 6449 | exclude_paths = [os.path.abspath(f) for f in _excludes] |
|
| 6450 | return [f for f in filenames if os.path.abspath(f) not in exclude_paths] |
|
| 6451 | ||
| 6452 | def main(): |
|
| 6453 | filenames = ParseArguments(sys.argv[1:]) |
|
| 6454 | backup_err = sys.stderr |
|
| 6455 | try: |
|
| 6456 | # Change stderr to write with replacement characters so we don't die |
|
| 6457 | # if we try to print something containing non-ASCII characters. |
|
| 6458 | sys.stderr = codecs.StreamReader(sys.stderr, 'replace') |
|
| 6459 | ||
| 6460 | _cpplint_state.ResetErrorCounts() |
|
| 6461 | for filename in filenames: |
|
| 6462 | ProcessFile(filename, _cpplint_state.verbose_level) |
|
| 6463 | _cpplint_state.PrintErrorCounts() |
|
| 6464 | ||
| 6465 | if _cpplint_state.output_format == 'junit': |
|
| 6466 | sys.stderr.write(_cpplint_state.FormatJUnitXML()) |
|
| 6467 | ||
| 6468 | finally: |
|
| 6469 | sys.stderr = backup_err |
|
| 6470 | ||
| 6471 | sys.exit(_cpplint_state.error_count > 0) |
|
| 6472 | ||
| 6473 | ||
| 6474 | if __name__ == '__main__': |
|