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

Remove files without an extension from the presubmit checks.

This may include Makefile but it's saner to not include it by default

R=dpranke@chromium.org
BUG=
TEST=updated

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@90403 0039d316-1c4b-4281-b951-d872f2087c98
parent 004fb718
...@@ -186,15 +186,16 @@ class InputApi(object): ...@@ -186,15 +186,16 @@ class InputApi(object):
# File extensions that are considered source files from a style guide # File extensions that are considered source files from a style guide
# perspective. Don't modify this list from a presubmit script! # perspective. Don't modify this list from a presubmit script!
#
# Files without an extension aren't included in the list. If you want to
# filter them as source files, add r"(^|.*?[\\\/])[^.]+$" to the white list.
# Note that ALL CAPS files are black listed in DEFAULT_BLACK_LIST below.
DEFAULT_WHITE_LIST = ( DEFAULT_WHITE_LIST = (
# C++ and friends # C++ and friends
r".+\.c$", r".+\.cc$", r".+\.cpp$", r".+\.h$", r".+\.m$", r".+\.mm$", 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".+\.inl$", r".+\.asm$", r".+\.hxx$", r".+\.hpp$", r".+\.s$", r".+\.S$",
# Scripts # 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 # Other
r".+\.java$", r".+\.mk$", r".+\.am$", r".+\.java$", r".+\.mk$", r".+\.am$",
) )
......
...@@ -945,7 +945,6 @@ class InputApiUnittest(PresubmitTestsBase): ...@@ -945,7 +945,6 @@ class InputApiUnittest(PresubmitTestsBase):
], ],
[ [
# Expected. # Expected.
'a/experimental',
'a/experimental.cc', 'a/experimental.cc',
'a/experimental.S', 'a/experimental.S',
], ],
...@@ -960,7 +959,6 @@ class InputApiUnittest(PresubmitTestsBase): ...@@ -960,7 +959,6 @@ class InputApiUnittest(PresubmitTestsBase):
], ],
[ [
# Expected. # Expected.
'a/third_party',
'a/third_party.cc', 'a/third_party.cc',
], ],
), ),
...@@ -970,11 +968,13 @@ class InputApiUnittest(PresubmitTestsBase): ...@@ -970,11 +968,13 @@ class InputApiUnittest(PresubmitTestsBase):
f('a/LOL_FILE/b'), f('a/LOL_FILE/b'),
f('b.c/LOL_FILE'), f('b.c/LOL_FILE'),
f('a/PRESUBMIT.py'), f('a/PRESUBMIT.py'),
f('a/FOO.json'),
f('a/FOO.java'),
], ],
[ [
# Expected. # Expected.
'a/LOL_FILE/b',
'a/PRESUBMIT.py', 'a/PRESUBMIT.py',
'a/FOO.java',
], ],
), ),
( (
...@@ -995,7 +995,7 @@ class InputApiUnittest(PresubmitTestsBase): ...@@ -995,7 +995,7 @@ class InputApiUnittest(PresubmitTestsBase):
False, None, False) False, None, False)
self.mox.ReplayAll() self.mox.ReplayAll()
self.assertEqual(len(input_api.DEFAULT_WHITE_LIST), 22) self.assertEqual(len(input_api.DEFAULT_WHITE_LIST), 21)
self.assertEqual(len(input_api.DEFAULT_BLACK_LIST), 9) self.assertEqual(len(input_api.DEFAULT_BLACK_LIST), 9)
for item in files: for item in files:
results = filter(input_api.FilterSourceFile, item[0]) results = filter(input_api.FilterSourceFile, item[0])
......
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