Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use codespell to test a project's incoming PRs via Continuous Integration (ex. TravisCI) #139

Closed
luzpaz opened this issue Oct 1, 2017 · 10 comments

Comments

@luzpaz
Copy link
Collaborator

luzpaz commented Oct 1, 2017

Has anyone seen or used codespell as a unit test that gets triggered in TravisCI when a new PR submitted ?

Downstream ticket: https://freecadweb.org/tracker/view.php?id=3205

@luzpaz luzpaz changed the title How to use Codespell to test a project's incoming PRs via Continuous Integration (ex. TravisCI) How to use codespell to test a project's incoming PRs via Continuous Integration (ex. TravisCI) Oct 1, 2017
@luzpaz
Copy link
Collaborator Author

luzpaz commented Oct 1, 2017

Found https://blog.eleven-labs.com/en/how-to-check-the-spelling-of-your-docs-from-travis-ci/

@larsoner
Copy link
Member

larsoner commented Oct 1, 2017

We use it here:

https://github.com/mne-tools/mne-python/blob/master/.travis.yml#L173

And the Makefile (make codespell for interactive mode and make codespell-error for CI):

https://github.com/mne-tools/mne-python/blob/master/Makefile#L99

@luzpaz
Copy link
Collaborator Author

luzpaz commented Oct 1, 2017

Cool! Perhaps we can flesh this out in to a guide on the wiki ?

@luzpaz
Copy link
Collaborator Author

luzpaz commented Oct 1, 2017

@larsoner Looks like it's possible to notify submitter of the results using a github token. Does mne-tools/mne-python do this ?

curl -i -H "Authorization: token $GITHUB_TOKEN" \
    -H "Content-Type: application/json" \
    -X POST -d "{\"body\":\"$ASPELL_RESULTS\"}" \
    https://api.github.com/repos/eleven-labs/eleven-labs.github.io/issues/$TRAVIS_PULL_REQUEST/comments

@larsoner
Copy link
Member

larsoner commented Oct 1, 2017

No we don't bother, just let the red CI status lead them to check. But it sounds potentially useful.

@luzpaz
Copy link
Collaborator Author

luzpaz commented Oct 11, 2017

Lets keep this is open while I study this, larsoner. Then I'll write a short tut on how to integrate it and add it to the README.

@luzpaz
Copy link
Collaborator Author

luzpaz commented Oct 13, 2017

@luzpaz
Copy link
Collaborator Author

luzpaz commented Oct 23, 2017

Here is how you tell codespell to run on all changed files in a submitted PR:

mapfile -t files < <(git diff --name-only $TRAVIS_COMMIT_RANGE); codespell -d -q 3 -S "$CODESPELL_SKIPS" -I ./whitelist.txt  "${files[@]}"

@larsoner
Copy link
Member

Closing as solved

@luzpaz
Copy link
Collaborator Author

luzpaz commented Jun 3, 2019

Folks over at numpy have another solution: numpy/numpy#13694

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants