OLD | NEW |
1 #!/usr/bin/python2.4 | 1 #!/usr/bin/python2.4 |
2 # | 2 # |
3 # cpplint.py is Copyright (C) 2009 Google Inc. | 3 # Copyright (c) 2009 Google Inc. All rights reserved. |
4 # | 4 # |
5 # It is free software; you can redistribute it and/or modify it under the | 5 # Redistribution and use in source and binary forms, with or without |
6 # terms of either: | 6 # modification, are permitted provided that the following conditions are |
| 7 # met: |
7 # | 8 # |
8 # a) the GNU General Public License as published by the Free Software | 9 # * Redistributions of source code must retain the above copyright |
9 # Foundation; either version 1, or (at your option) any later version, or | 10 # notice, this list of conditions and the following disclaimer. |
| 11 # * Redistributions in binary form must reproduce the above |
| 12 # copyright notice, this list of conditions and the following disclaimer |
| 13 # in the documentation and/or other materials provided with the |
| 14 # distribution. |
| 15 # * Neither the name of Google Inc. nor the names of its |
| 16 # contributors may be used to endorse or promote products derived from |
| 17 # this software without specific prior written permission. |
10 # | 18 # |
11 # b) the "Artistic License". | 19 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 20 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 21 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
| 22 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 23 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 24 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 25 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 26 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 27 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 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. |
12 | 30 |
13 # Here are some issues that I've had people identify in my code during reviews, | 31 # Here are some issues that I've had people identify in my code during reviews, |
14 # that I think are possible to flag automatically in a lint tool. If these were | 32 # that I think are possible to flag automatically in a lint tool. If these were |
15 # caught by lint, it would save time both for myself and that of my reviewers. | 33 # caught by lint, it would save time both for myself and that of my reviewers. |
16 # Most likely, some of these are beyond the scope of the current lint framework, | 34 # Most likely, some of these are beyond the scope of the current lint framework, |
17 # but I think it is valuable to retain these wish-list items even if they cannot | 35 # but I think it is valuable to retain these wish-list items even if they cannot |
18 # be immediately implemented. | 36 # be immediately implemented. |
19 # | 37 # |
20 # Suggestions | 38 # Suggestions |
21 # ----------- | 39 # ----------- |
(...skipping 2883 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2905 | 2923 |
2906 _cpplint_state.ResetErrorCount() | 2924 _cpplint_state.ResetErrorCount() |
2907 for filename in filenames: | 2925 for filename in filenames: |
2908 ProcessFile(filename, _cpplint_state.verbose_level) | 2926 ProcessFile(filename, _cpplint_state.verbose_level) |
2909 sys.stderr.write('Total errors found: %d\n' % _cpplint_state.error_count) | 2927 sys.stderr.write('Total errors found: %d\n' % _cpplint_state.error_count) |
2910 sys.exit(_cpplint_state.error_count > 0) | 2928 sys.exit(_cpplint_state.error_count > 0) |
2911 | 2929 |
2912 | 2930 |
2913 if __name__ == '__main__': | 2931 if __name__ == '__main__': |
2914 main() | 2932 main() |
OLD | NEW |