| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # | 2 # |
| 3 # Copyright (c) 2009 Google Inc. All rights reserved. | 3 # Copyright (c) 2009 Google Inc. All rights reserved. |
| 4 # | 4 # |
| 5 # Redistribution and use in source and binary forms, with or without | 5 # Redistribution and use in source and binary forms, with or without |
| 6 # modification, are permitted provided that the following conditions are | 6 # modification, are permitted provided that the following conditions are |
| 7 # met: | 7 # met: |
| 8 # | 8 # |
| 9 # * Redistributions of source code must retain the above copyright | 9 # * Redistributions of source code must retain the above copyright |
| 10 # notice, this list of conditions and the following disclaimer. | 10 # notice, this list of conditions and the following disclaimer. |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | 21 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
| 22 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | 22 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 23 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | 23 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 24 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 24 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 25 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 25 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 26 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 26 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 27 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 27 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 28 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 28 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 29 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 29 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 30 | 30 |
| 31 # pylint: skip-file |
| 32 |
| 31 """Does google-lint on c++ files. | 33 """Does google-lint on c++ files. |
| 32 | 34 |
| 33 The goal of this script is to identify places in the code that *may* | 35 The goal of this script is to identify places in the code that *may* |
| 34 be in non-compliance with google style. It does not attempt to fix | 36 be in non-compliance with google style. It does not attempt to fix |
| 35 up these problems -- the point is to educate. It does also not | 37 up these problems -- the point is to educate. It does also not |
| 36 attempt to find all problems, or to ensure that everything it does | 38 attempt to find all problems, or to ensure that everything it does |
| 37 find is legitimately a problem. | 39 find is legitimately a problem. |
| 38 | 40 |
| 39 In particular, we can get very confused by /* and // inside strings! | 41 In particular, we can get very confused by /* and // inside strings! |
| 40 We do a small hack, which is to ignore //'s with "'s after them on the | 42 We do a small hack, which is to ignore //'s with "'s after them on the |
| (...skipping 6064 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6105 _cpplint_state.ResetErrorCounts() | 6107 _cpplint_state.ResetErrorCounts() |
| 6106 for filename in filenames: | 6108 for filename in filenames: |
| 6107 ProcessFile(filename, _cpplint_state.verbose_level) | 6109 ProcessFile(filename, _cpplint_state.verbose_level) |
| 6108 _cpplint_state.PrintErrorCounts() | 6110 _cpplint_state.PrintErrorCounts() |
| 6109 | 6111 |
| 6110 sys.exit(_cpplint_state.error_count > 0) | 6112 sys.exit(_cpplint_state.error_count > 0) |
| 6111 | 6113 |
| 6112 | 6114 |
| 6113 if __name__ == '__main__': | 6115 if __name__ == '__main__': |
| 6114 main() | 6116 main() |
| OLD | NEW |