Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(819)

Side by Side Diff: cpplint.py

Issue 1919483002: Revert of Convert cpplint.py to work with nested git repositories. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 996 matching lines...) Expand 10 before | Expand all | Expand 10 after
1007 one_up_dir = os.path.dirname(root_dir) 1007 one_up_dir = os.path.dirname(root_dir)
1008 while os.path.exists(os.path.join(one_up_dir, ".svn")): 1008 while os.path.exists(os.path.join(one_up_dir, ".svn")):
1009 root_dir = os.path.dirname(root_dir) 1009 root_dir = os.path.dirname(root_dir)
1010 one_up_dir = os.path.dirname(one_up_dir) 1010 one_up_dir = os.path.dirname(one_up_dir)
1011 1011
1012 prefix = os.path.commonprefix([root_dir, project_dir]) 1012 prefix = os.path.commonprefix([root_dir, project_dir])
1013 return fullname[len(prefix) + 1:] 1013 return fullname[len(prefix) + 1:]
1014 1014
1015 # Not SVN <= 1.6? Try to find a git, hg, or svn top level directory by 1015 # Not SVN <= 1.6? Try to find a git, hg, or svn top level directory by
1016 # searching up from the current path. 1016 # searching up from the current path.
1017 root_dir = current_dir = os.path.dirname(fullname) 1017 root_dir = os.path.dirname(fullname)
1018 while current_dir != os.path.dirname(current_dir): 1018 while (root_dir != os.path.dirname(root_dir) and
1019 if (os.path.exists(os.path.join(current_dir, ".git")) or 1019 not os.path.exists(os.path.join(root_dir, ".git")) and
1020 os.path.exists(os.path.join(current_dir, ".hg")) or 1020 not os.path.exists(os.path.join(root_dir, ".hg")) and
1021 os.path.exists(os.path.join(current_dir, ".svn"))): 1021 not os.path.exists(os.path.join(root_dir, ".svn"))):
1022 root_dir = current_dir 1022 root_dir = os.path.dirname(root_dir)
1023 current_dir = os.path.dirname(current_dir)
1024 1023
1025 if (os.path.exists(os.path.join(root_dir, ".git")) or 1024 if (os.path.exists(os.path.join(root_dir, ".git")) or
1026 os.path.exists(os.path.join(root_dir, ".hg")) or 1025 os.path.exists(os.path.join(root_dir, ".hg")) or
1027 os.path.exists(os.path.join(root_dir, ".svn"))): 1026 os.path.exists(os.path.join(root_dir, ".svn"))):
1028 prefix = os.path.commonprefix([root_dir, project_dir]) 1027 prefix = os.path.commonprefix([root_dir, project_dir])
1029 return fullname[len(prefix) + 1:] 1028 return fullname[len(prefix) + 1:]
1030 1029
1031 # Don't know what to do; header guard warnings may be wrong... 1030 # Don't know what to do; header guard warnings may be wrong...
1032 return fullname 1031 return fullname
1033 1032
(...skipping 5289 matching lines...) Expand 10 before | Expand all | Expand 10 after
6323 _cpplint_state.ResetErrorCounts() 6322 _cpplint_state.ResetErrorCounts()
6324 for filename in filenames: 6323 for filename in filenames:
6325 ProcessFile(filename, _cpplint_state.verbose_level) 6324 ProcessFile(filename, _cpplint_state.verbose_level)
6326 _cpplint_state.PrintErrorCounts() 6325 _cpplint_state.PrintErrorCounts()
6327 6326
6328 sys.exit(_cpplint_state.error_count > 0) 6327 sys.exit(_cpplint_state.error_count > 0)
6329 6328
6330 6329
6331 if __name__ == '__main__': 6330 if __name__ == '__main__':
6332 main() 6331 main()
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698