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

Unified Diff: PRESUBMIT.py

Issue 1163893003: Don't include <stdint.h> from within <machine/_types.h> (Closed) Base URL: https://chromium.googlesource.com/native_client/src/native_client.git@master
Patch Set: Created 5 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/include/win/port_win.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: PRESUBMIT.py
diff --git a/PRESUBMIT.py b/PRESUBMIT.py
index 01a0444f590d77430a7d3118bafee5eb2221aefb..cea31e95d3f3c75b74c8d5678d33a5fea2c946f3 100644
--- a/PRESUBMIT.py
+++ b/PRESUBMIT.py
@@ -11,23 +11,28 @@ import sys
# List of directories to not apply presubmit project checks, relative
# to the NaCl top directory
-EXCLUDE_PROJECT_CHECKS_DIRS = [
+EXCLUDE_PROJECT_CHECKS = [
# The following contain test data (including automatically generated),
# and do not follow our conventions.
- 'src/trusted/validator_ragel/testdata/32',
- 'src/trusted/validator_ragel/testdata/64',
- 'src/trusted/validator_x86/testdata/32',
- 'src/trusted/validator_x86/testdata/64',
- 'src/trusted/validator/x86/decoder/generator/testdata/32',
- 'src/trusted/validator/x86/decoder/generator/testdata/64',
+ 'src/trusted/validator_ragel/testdata/32/',
+ 'src/trusted/validator_ragel/testdata/64/',
+ 'src/trusted/validator_x86/testdata/32/',
+ 'src/trusted/validator_x86/testdata/64/',
+ 'src/trusted/validator/x86/decoder/generator/testdata/32/',
+ 'src/trusted/validator/x86/decoder/generator/testdata/64/',
# The following directories contains automatically generated source,
# which may not follow our conventions.
- 'src/trusted/validator_x86/gen',
- 'src/trusted/validator/x86/decoder/gen',
- 'src/trusted/validator/x86/decoder/generator/gen',
- 'src/trusted/validator/x86/ncval_seg_sfi/gen',
- 'src/trusted/validator_arm/gen',
- 'src/trusted/validator_ragel/gen',
+ 'src/trusted/validator_x86/gen/',
+ 'src/trusted/validator/x86/decoder/gen/',
+ 'src/trusted/validator/x86/decoder/generator/gen/',
+ 'src/trusted/validator/x86/ncval_seg_sfi/gen/',
+ 'src/trusted/validator_arm/gen/',
+ 'src/trusted/validator_ragel/gen/',
+ # The following files contain code from outside native_client (e.g. newlib)
+ # or are known the contain style violations.
+ 'src/trusted/service_runtime/include/sys/',
+ 'src/include/win/port_win.h',
+ 'src/trusted/service_runtime/include/machine/_types.h'
]
NACL_TOP_DIR = os.getcwd()
@@ -35,6 +40,7 @@ while not os.path.isfile(os.path.join(NACL_TOP_DIR, 'PRESUBMIT.py')):
NACL_TOP_DIR = os.path.dirname(NACL_TOP_DIR)
assert len(NACL_TOP_DIR) >= 3, "Could not find NaClTopDir"
+
def CheckGitBranch():
p = subprocess.Popen("git branch -vv", shell=True,
stdout=subprocess.PIPE)
@@ -57,24 +63,27 @@ def CheckGitBranch():
print 'Warning: presubmit check could not determine local git branch'
return None
+
def _CommonChecks(input_api, output_api):
"""Checks for both upload and commit."""
results = []
results.extend(input_api.canned_checks.PanProjectChecks(
input_api, output_api, project_name='Native Client',
- excluded_paths=tuple(EXCLUDE_PROJECT_CHECKS_DIRS)))
+ excluded_paths=tuple(EXCLUDE_PROJECT_CHECKS)))
branch_warning = CheckGitBranch()
if branch_warning:
results.append(output_api.PresubmitPromptWarning(branch_warning))
return results
+
def IsFileInDirectories(f, dirs):
""" Returns true if f is in list of directories"""
for d in dirs:
- if d is os.path.commonprefix([f , d]):
+ if d is os.path.commonprefix([f, d]):
return True
return False
+
def CheckChangeOnUpload(input_api, output_api):
"""Verifies all changes in all files.
Args:
@@ -97,10 +106,11 @@ def CheckChangeOnUpload(input_api, output_api):
del old_sys_path
affected_files = input_api.AffectedFiles(include_deletes=False)
- exclude_dirs = [ NACL_TOP_DIR + '/' + x + '/'
- for x in EXCLUDE_PROJECT_CHECKS_DIRS ]
+ exclude_dirs = [ NACL_TOP_DIR + '/' + x for x in EXCLUDE_PROJECT_CHECKS ]
for filename in affected_files:
filename = filename.AbsoluteLocalPath()
+ if filename in exclude_dirs:
+ continue
if not IsFileInDirectories(filename, exclude_dirs):
errors, warnings = code_hygiene.CheckFile(filename, False)
for e in errors:
« no previous file with comments | « no previous file | src/include/win/port_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698