diff options
author | Anthony Ramine <n.oxyde@gmail.com> | 2017-05-23 15:55:03 +0200 |
---|---|---|
committer | Anthony Ramine <n.oxyde@gmail.com> | 2017-05-23 16:05:03 +0200 |
commit | bb45b667a9b7d20d5f06c3aed9d3ed0245346e0a (patch) | |
tree | 6a4fb00f690365a0d2ed56a5e4f5ac1265cf7186 /python/tidy | |
parent | 78e99459086b89aae7cdd2e448c217a1328ecaf2 (diff) | |
download | servo-bb45b667a9b7d20d5f06c3aed9d3ed0245346e0a.tar.gz servo-bb45b667a9b7d20d5f06c3aed9d3ed0245346e0a.zip |
Don't lint commit messages anymore
This lint cannot cope with rollup merges and didn't do its job correctly anyway
Diffstat (limited to 'python/tidy')
-rw-r--r-- | python/tidy/servo_tidy/tidy.py | 32 |
1 files changed, 1 insertions, 31 deletions
diff --git a/python/tidy/servo_tidy/tidy.py b/python/tidy/servo_tidy/tidy.py index 610ac20d624..8d7e6c07b72 100644 --- a/python/tidy/servo_tidy/tidy.py +++ b/python/tidy/servo_tidy/tidy.py @@ -1072,34 +1072,6 @@ def run_lint_scripts(only_changed_files=False, progress=True, stylo=False): yield error -def check_commits(path='.'): - """ Checks if the test is being run under Travis CI environment - This is necessary since, after travis clones the branch for a PR, it merges - the branch against master, creating a merge commit. Hence, as a workaround, - we have to check if the second last merge commit is done by the author of - the pull request. - """ - is_travis = os.environ.get('TRAVIS') == 'true' - number_commits = '-n2' if is_travis else '-n1' - - """Gets all commits since the last merge.""" - args = ['git', 'log', number_commits, '--merges', '--format=%H:%an'] - # last_merge stores both the commit hash and the author name of the last merge in the output - last_merge_hash, last_merge_author = subprocess.check_output(args, cwd=path).strip().splitlines()[-1].split(':') - args = ['git', 'log', '{}..HEAD'.format(last_merge_hash), '--format=%s'] - commits = subprocess.check_output(args, cwd=path).lower().splitlines() - - for commit in commits: - # .split() to only match entire words - if 'wip' in commit.split(): - yield (':', ':', 'no commits should contain WIP') - - if last_merge_author != 'bors-servo': - yield (':', ':', 'no merge commits allowed, please rebase your commits over the upstream master branch') - - raise StopIteration - - def scan(only_changed_files=False, progress=True, stylo=False): # check config file for errors config_errors = check_config_file(CONFIG_FILE_PATH) @@ -1115,11 +1087,9 @@ def scan(only_changed_files=False, progress=True, stylo=False): dep_license_errors = check_dep_license_errors(get_dep_toml_files(only_changed_files), progress) # other lint checks lint_errors = run_lint_scripts(only_changed_files, progress, stylo=stylo) - # check commits for WIP - commit_errors = [] if stylo else check_commits() # chain all the iterators errors = itertools.chain(config_errors, directory_errors, lint_errors, - file_errors, dep_license_errors, commit_errors) + file_errors, dep_license_errors) error = None for error in errors: |