Commit fe1211ae authored by maruel@chromium.org's avatar maruel@chromium.org

Improve the sources regexp to be more correct.

R=dpranke@chromium.org
BUG=
TEST=

Review URL: http://codereview.chromium.org/7030023

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@87185 0039d316-1c4b-4281-b951-d872f2087c98
parent e8829d3d
......@@ -886,8 +886,8 @@ def PanProjectChecks(input_api, output_api,
"""
excluded_paths = excluded_paths or tuple()
text_files = text_files or (
r'.*\.txt',
r'.*\.json',
r'.+\.txt$',
r'.+\.json$',
)
project_name = project_name or 'Chromium'
license_header = license_header or (
......@@ -909,9 +909,8 @@ def PanProjectChecks(input_api, output_api,
black_list = input_api.DEFAULT_BLACK_LIST + excluded_paths
white_list = input_api.DEFAULT_WHITE_LIST + text_files
sources = lambda x: input_api.FilterSourceFile(x, black_list=black_list)
text_files = lambda x: input_api.FilterSourceFile(x, black_list=black_list,
white_list=white_list)
text_files = lambda x: input_api.FilterSourceFile(
x, black_list=black_list, white_list=white_list)
snapshot_memory = []
def snapshot(msg):
......
......@@ -187,15 +187,15 @@ class InputApi(object):
# perspective. Don't modify this list from a presubmit script!
DEFAULT_WHITE_LIST = (
# C++ and friends
r".*\.c$", r".*\.cc$", r".*\.cpp$", r".*\.h$", r".*\.m$", r".*\.mm$",
r".*\.inl$", r".*\.asm$", r".*\.hxx$", r".*\.hpp$", r".*\.s$", r".*\.S$",
r".+\.c$", r".+\.cc$", r".+\.cpp$", r".+\.h$", r".+\.m$", r".+\.mm$",
r".+\.inl$", r".+\.asm$", r".+\.hxx$", r".+\.hpp$", r".+\.s$", r".+\.S$",
# Scripts
r".*\.js$", r".*\.py$", r".*\.sh$", r".*\.rb$", r".*\.pl$", r".*\.pm$",
r".+\.js$", r".+\.py$", r".+\.sh$", r".+\.rb$", r".+\.pl$", r".+\.pm$",
# No extension at all, note that ALL CAPS files are black listed in
# DEFAULT_BLACK_LIST below.
r"(^|.*?[\\\/])[^.]+$",
# Other
r".*\.java$", r".*\.mk$", r".*\.am$",
r".+\.java$", r".+\.mk$", r".+\.am$",
)
# Path regexp that should be excluded from being considered containing source
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment