diff options
author | Michaƫl Zasso <mic.besace@gmail.com> | 2015-10-06 08:42:38 +0200 |
---|---|---|
committer | Ali Ijaz Sheikh <ofrobots@google.com> | 2015-10-14 11:20:34 -0700 |
commit | d8011d1683fe0d977de2bea1147f5213d4490c5a (patch) | |
tree | 54967df8dc1732e59eef39e5c5b39fe99ad88977 /deps/v8/PRESUBMIT.py | |
parent | d1a2e5357ef0357cec9b516fa9ac78cc38a984aa (diff) | |
download | android-node-v8-d8011d1683fe0d977de2bea1147f5213d4490c5a.tar.gz android-node-v8-d8011d1683fe0d977de2bea1147f5213d4490c5a.tar.bz2 android-node-v8-d8011d1683fe0d977de2bea1147f5213d4490c5a.zip |
deps: upgrade V8 to 4.6.85.23
PR-URL: https://github.com/nodejs/node/pull/3351
Reviewed-By: indutny - Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: bnoordhuis - Ben Noordhuis <info@bnoordhuis.nl>
Diffstat (limited to 'deps/v8/PRESUBMIT.py')
-rw-r--r-- | deps/v8/PRESUBMIT.py | 55 |
1 files changed, 47 insertions, 8 deletions
diff --git a/deps/v8/PRESUBMIT.py b/deps/v8/PRESUBMIT.py index 34e09b8ec5..1bcd9922c5 100644 --- a/deps/v8/PRESUBMIT.py +++ b/deps/v8/PRESUBMIT.py @@ -141,6 +141,39 @@ def _CheckUnwantedDependencies(input_api, output_api): return results +def _CheckNoInlineHeaderIncludesInNormalHeaders(input_api, output_api): + """Attempts to prevent inclusion of inline headers into normal header + files. This tries to establish a layering where inline headers can be + included by other inline headers or compilation units only.""" + file_inclusion_pattern = r'(?!.+-inl\.h).+\.h' + include_directive_pattern = input_api.re.compile(r'#include ".+-inl.h"') + include_warning = ( + 'You might be including an inline header (e.g. foo-inl.h) within a\n' + 'normal header (e.g. bar.h) file. Can you avoid introducing the\n' + '#include? The commit queue will not block on this warning.') + + def FilterFile(affected_file): + black_list = (_EXCLUDED_PATHS + + input_api.DEFAULT_BLACK_LIST) + return input_api.FilterSourceFile( + affected_file, + white_list=(file_inclusion_pattern, ), + black_list=black_list) + + problems = [] + for f in input_api.AffectedSourceFiles(FilterFile): + local_path = f.LocalPath() + for line_number, line in f.ChangedContents(): + if (include_directive_pattern.search(line)): + problems.append( + '%s:%d\n %s' % (local_path, line_number, line.strip())) + + if problems: + return [output_api.PresubmitPromptOrNotify(include_warning, problems)] + else: + return [] + + def _CheckNoProductionCodeUsingTestOnlyFunctions(input_api, output_api): """Attempts to prevent use of functions intended only for testing in non-testing code. For now this is just a best-effort implementation @@ -195,6 +228,8 @@ def _CommonChecks(input_api, output_api): results.extend(_CheckUnwantedDependencies(input_api, output_api)) results.extend( _CheckNoProductionCodeUsingTestOnlyFunctions(input_api, output_api)) + results.extend( + _CheckNoInlineHeaderIncludesInNormalHeaders(input_api, output_api)) return results @@ -209,28 +244,32 @@ def _SkipTreeCheck(input_api, output_api): return input_api.environ.get('PRESUBMIT_TREE_CHECK') == 'skip' -def _CheckChangeLogFlag(input_api, output_api): +def _CheckChangeLogFlag(input_api, output_api, warn): """Checks usage of LOG= flag in the commit message.""" results = [] - if input_api.change.BUG and not 'LOG' in input_api.change.tags: - results.append(output_api.PresubmitError( - 'An issue reference (BUG=) requires a change log flag (LOG=). ' - 'Use LOG=Y for including this commit message in the change log. ' - 'Use LOG=N or leave blank otherwise.')) + if (input_api.change.BUG and input_api.change.BUG != 'none' and + not 'LOG' in input_api.change.tags): + text = ('An issue reference (BUG=) requires a change log flag (LOG=). ' + 'Use LOG=Y for including this commit message in the change log. ' + 'Use LOG=N or leave blank otherwise.') + if warn: + results.append(output_api.PresubmitPromptWarning(text)) + else: + results.append(output_api.PresubmitError(text)) return results def CheckChangeOnUpload(input_api, output_api): results = [] results.extend(_CommonChecks(input_api, output_api)) - results.extend(_CheckChangeLogFlag(input_api, output_api)) + results.extend(_CheckChangeLogFlag(input_api, output_api, True)) return results def CheckChangeOnCommit(input_api, output_api): results = [] results.extend(_CommonChecks(input_api, output_api)) - results.extend(_CheckChangeLogFlag(input_api, output_api)) + results.extend(_CheckChangeLogFlag(input_api, output_api, False)) results.extend(input_api.canned_checks.CheckChangeHasDescription( input_api, output_api)) if not _SkipTreeCheck(input_api, output_api): |