Skip to content

Check PRs for whitespace #3

Closed
Closed

Description

@brettcannon

See https://hg.python.org/hooks/file/tip/checkwhitespace.py for the hg.python.org solution. Need to check both code and docs. Could either set up a bot to do the check on the diff directly or somehow use Travis and its TRAVIS_PULL_REQUEST environment variable to check whitespace only on the changing code.

Activity

  1. brettcannon commented on Dec 10, 2016

    @brettcannon
    MemberAuthor

    Looks like there is a GitHub API for getting files involved in a PR. Probably can't query GitHub w/o authentication, else you run the risk of reaching their quota.

  2. brettcannon commented on Jun 23, 2017

    @brettcannon
    MemberAuthor

    I wonder if there is something we can borrow from scripts/Tools/patchcheck.py for this? That way we can keep it entirely on Travis. Maybe add a --travis file to patchcheck that only does the whitespace checks?

    Otherwise I'm thinking that to solve this we may want to provide an endpoint on Bedevere that returns the list of files in a PR as a JSON list of strings. We then have a script in Tools/scripts/ that will call Bedevere for the file list based on TRAVIS_PULL_REQUEST (and a secret to validate the caller), and then run the appropriate scripts much like https://hg.python.org/hooks/file/tip/checkwhitespace.py. Then the return value of the script will flag whether a PR has any whitespace that needs normalization.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions