Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Add codespell support #1770
Conversation
| @@ -51,7 +51,7 @@ snapcraft (2.35) xenial; urgency=medium | ||
| * many: account for python shebang args in rewrite | ||
| [ Leo Arias ] | ||
| - * typo: replace occured with occurred | ||
| + * typo: replace occurred with occurred |
daniellimws
added some commits
Nov 29, 2017
|
Hi there, thanks for your contribution. The current implementation is running codespell for every job. I think that moving the
to
And put your code in
And make the script executable Does that sounds reasonable? |
| @@ -0,0 +1,3 @@ | ||
| +#!/bin/sh | ||
| +sudo pip install codespell |
sergiusens
Nov 29, 2017
Collaborator
Ah, I forgot one thing, might want to add set -e so we don't have hidden errors.
| @@ -0,0 +1,3 @@ | ||
| +#!/bin/sh | ||
| +sudo pip install codespell | ||
| +codespell -S "*.xz,*.zip,*.bz2,*.7z,*.gz,*.deb,*.rpm,*.snap,*.gpg,*.pyc,*.png,*.ico,*.jar,./.git" -w || true |
sergiusens
Nov 29, 2017
Collaborator
the || true at the end of this will hide errors, I suggest we remove it.
daniellimws
Nov 29, 2017
Contributor
however the return value is the number of typos found, which will be non-zero and cause the build to fail
sergiusens
Nov 29, 2017
Collaborator
Making it 0 should be ideal
If we don't make it fail, then we will never detect any new issues.
daniellimws
Nov 29, 2017
Contributor
As seen here https://travis-ci.org/snapcore/snapcraft/jobs/308985647, the build fails because codespell returns the number of typos found.
daniellimws
added some commits
Nov 29, 2017
| @@ -15,6 +15,8 @@ jobs: | ||
| - stage: static | ||
| if: type != cron | ||
| script: sudo ./tools/travis/run_tests.sh static | ||
| + if: type != cron |
sergiusens
Nov 29, 2017
Collaborator
a dash (-) is missing here, as a block it should look like:
- stage: static
if: type != cron
script: sudo ./tools/travis/run_tests.sh static
- if: type != cron
script: sudo ./tools/travis/run_codespell.sh
| +#!/bin/sh | ||
| +set -e | ||
| +sudo pip install codespell | ||
| +codespell -S "*.xz,*.zip,*.bz2,*.7z,*.gz,*.deb,*.rpm,*.snap,*.gpg,*.pyc,*.png,*.ico,*.jar,./.git" -w |
|
I would fix './snapcraft/tests/integration/snaps/waf-with-configflags/shlib/test_shlib.c' and change 'gonna' to 'going to' |
| +#!/bin/sh | ||
| +set -e | ||
| +sudo pip install codespell | ||
| +codespell -S "*.xz,*.zip,*.bz2,*.7z,*.gz,*.deb,*.rpm,*.snap,*.gpg,*.pyc,*.png,*.ico,*.jar,./.git" |
sergiusens
Nov 29, 2017
Collaborator
I've been looking at the help and we want to add -q 4 to this line
|
What about the "iff"? |
|
|
|
Here's the progression
|
|
Oh no, I misread and removed the typo instead of excluding debian/changelog |
sergiusens
approved these changes
Nov 29, 2017
Great, the first step passed so it should most likely end up being green. I am approving this and will merge given the travis run ends up being green
sergiusens
merged commit 7956282
into
snapcore:master
Nov 29, 2017
1 check passed
sergiusens
added this to the 2.37 milestone
Nov 29, 2017
|
I want to take the opportunity to call out your commit messages, here: they are outstanding. I love how they're phrased as commands. Since GCI is a learning experience, I have a single suggestion to improve further: the commit messages should complete the sentence "If applied, this commit will ", not actually include the phrase "If applied, this commit will". So for example, your first commit would be "Fix all spelling errors in the current [...]". Wonderful job, keep up the good work. |
|
Ah haha I may have misunderstood that statement. Thanks a lot. |
daniellimws commentedNov 29, 2017
If applied, this commit will fix all spelling errors in the current
state of the repository. Furthermore, add a test in .travis.yaml to do
so on pull requests.
Based on Google Code-in task
https://codein.withgoogle.com/dashboard/task-instances/5347598271512576/