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

Side by Side Diff: PRESUBMIT.py

Issue 964513002: Check more file types for Win-style line endings in PRESUBMIT.py (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """Top-level presubmit script for Chromium. 5 """Top-level presubmit script for Chromium.
6 6
7 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts 7 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
8 for more details about the presubmit API built into depot_tools. 8 for more details about the presubmit API built into depot_tools.
9 """ 9 """
10 10
(...skipping 1625 matching lines...) Expand 10 before | Expand all | Expand 10 after
1636 return [output_api.PresubmitPromptWarning( 1636 return [output_api.PresubmitPromptWarning(
1637 _IPC_ENUM_TRAITS_DEPRECATED, problems)] 1637 _IPC_ENUM_TRAITS_DEPRECATED, problems)]
1638 else: 1638 else:
1639 return [] 1639 return []
1640 1640
1641 1641
1642 def _CheckForWindowsLineEndings(input_api, output_api): 1642 def _CheckForWindowsLineEndings(input_api, output_api):
1643 """Check source code and known ascii text files for Windows style line 1643 """Check source code and known ascii text files for Windows style line
1644 endings. 1644 endings.
1645 """ 1645 """
1646 known_text_files = r'.*\.(txt|html|htm|mhtml|py)$' 1646 known_text_files = r'.*\.(txt|html|htm|mhtml|py|gyp|gypi|gn|isolate)$'
1647 1647
1648 file_inclusion_pattern = ( 1648 file_inclusion_pattern = (
1649 known_text_files, 1649 known_text_files,
1650 r'.+%s' % _IMPLEMENTATION_EXTENSIONS 1650 r'.+%s' % _IMPLEMENTATION_EXTENSIONS
1651 ) 1651 )
1652 1652
1653 filter = lambda f: input_api.FilterSourceFile( 1653 filter = lambda f: input_api.FilterSourceFile(
1654 f, white_list=file_inclusion_pattern, black_list=None) 1654 f, white_list=file_inclusion_pattern, black_list=None)
1655 files = [f.LocalPath() for f in 1655 files = [f.LocalPath() for f in
1656 input_api.AffectedSourceFiles(filter)] 1656 input_api.AffectedSourceFiles(filter)]
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
1757 # Explicitly iterate over copies of dicts since we mutate them. 1757 # Explicitly iterate over copies of dicts since we mutate them.
1758 for master in builders.keys(): 1758 for master in builders.keys():
1759 for builder in builders[master].keys(): 1759 for builder in builders[master].keys():
1760 # Do not trigger presubmit builders, since they're likely to fail 1760 # Do not trigger presubmit builders, since they're likely to fail
1761 # (e.g. OWNERS checks before finished code review), and we're 1761 # (e.g. OWNERS checks before finished code review), and we're
1762 # running local presubmit anyway. 1762 # running local presubmit anyway.
1763 if 'presubmit' in builder: 1763 if 'presubmit' in builder:
1764 builders[master].pop(builder) 1764 builders[master].pop(builder)
1765 1765
1766 return builders 1766 return builders
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