-
Couldn't load subscription status.
- Fork 216
GitHub Actions Lint: spellintian, codespell #1818
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
Merged
peternewman
merged 19 commits into
OpenLightingProject:0.10
from
DaAwesomeP:DaAwesomeP-GitHubActionsLint2
Feb 24, 2023
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
c35da8a
gh actions lint spellintian
DaAwesomeP 98767f7
gh actions lint spellintian and codespell
DaAwesomeP 66c662e
gh actions lint spelling python3
DaAwesomeP fb8a0f5
Merge branch 'DaAwesomeP-GitHubActionsLint' into DaAwesomeP-GitHubAct…
DaAwesomeP 369d7b4
gn actions lint use provided conspell annotations, spellintian as war…
DaAwesomeP 924f970
spelling script omit compiled *.cc files
DaAwesomeP 7cb2051
Merge remote-tracking branch 'upstream/0.10' into DaAwesomeP-GitHubAc…
DaAwesomeP 2900052
spelling remove extra comments
DaAwesomeP 6abac14
spelling more specific exclude
DaAwesomeP 568d533
spelling neater elif
DaAwesomeP 2594579
Merge branch 'DaAwesomeP-GitHubActionsLint2' of github.com:DaAwesomeP…
DaAwesomeP 78a58e2
gh action lint use latest codespell from git
DaAwesomeP 3ca702b
gh action lint use latest codespell from git...with git
DaAwesomeP 1bb2efc
codespell fixes
DaAwesomeP 4af4b75
Update .codespellignorewords wronly
DaAwesomeP 2951908
spelling name unknown test in error
DaAwesomeP 37bcc49
spelling sort file exclude list
DaAwesomeP e3f5d5d
spelling add todo for spellintian
DaAwesomeP 115cbbb
spelling wrap codespell line
DaAwesomeP File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,3 +2,4 @@ acn | |
| ACN | ||
| inflight | ||
| thead | ||
| wronly | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| { | ||
| "problemMatcher": [ | ||
| { | ||
| "owner": "lint-spellintian", | ||
| "severity": "warning", | ||
| "pattern": [ | ||
| { | ||
| "regexp": "^([^:]+):(\\s+)(.+)$", | ||
| "file": 1, | ||
| "message": 3 | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,104 @@ | ||
| #!/usr/bin/env bash | ||
| # This program is free software; you can redistribute it and/or modify | ||
| # it under the terms of the GNU General Public License as published by | ||
| # the Free Software Foundation; either version 2 of the License, or | ||
| # (at your option) any later version. | ||
| # | ||
| # This program is distributed in the hope that it will be useful, | ||
| # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| # GNU Library General Public License for more details. | ||
| # | ||
| # You should have received a copy of the GNU General Public License | ||
| # along with this program; if not, write to the Free Software | ||
| # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
| # | ||
| # spellintian.sh | ||
| # Copyright (C) 2023 Perry Naseck, Peter Newman | ||
|
|
||
| # This script is based on Travis CI tests by Peter Newman | ||
| current_test="" | ||
| if [ "$1" = "spellintian" ]; then | ||
| current_test="spellintian" | ||
| elif [ "$1" = "codespell" ]; then | ||
| current_test="codespell" | ||
| else | ||
| echo "Unknown test \"$1\" specified in first argument. Options are spellintian and codespell." | ||
| exit 1; | ||
| fi; | ||
|
|
||
| if ! [ -x "$(command -v zrun)" ]; then | ||
| echo "error: Cannot find zrun. Do you need the moreutils package?" | ||
| exit 1; | ||
| fi; | ||
| if [ $current_test = "spellintian" ] && ! [ -x "$(command -v spellintian)" ]; then | ||
| echo "error: Cannot find spellintian. Do you need the lintian package?" | ||
| exit 1; | ||
| fi; | ||
| if [ $current_test = "codespell" ] && ! [ -x "$(command -v codespell)" ]; then | ||
| echo "error: Cannot find codespell. Install via pip." | ||
| exit 1; | ||
| fi; | ||
|
|
||
| SPELLINGBLACKLIST=$(cat <<-BLACKLIST | ||
| -wholename "./.codespellignorelines" -or \ | ||
| -wholename "./.codespellignorewords" -or \ | ||
| -wholename "./.git/*" -or \ | ||
| -wholename "./Makefile" -or \ | ||
| -wholename "./Makefile.in" -or \ | ||
| -wholename "./aclocal.m4" -or \ | ||
| -wholename "./autom4te.cache/*" -or \ | ||
| -wholename "./common/protocol/Ola.pb.*" -or \ | ||
| -wholename "./common/rpc/TestService.pb.*" -or \ | ||
| -wholename "./config.log" -or \ | ||
| -wholename "./config.status" -or \ | ||
| -wholename "./config/config.guess" -or \ | ||
| -wholename "./config/config.sub" -or \ | ||
| -wholename "./config/depcomp" -or \ | ||
| -wholename "./config/install-sh" -or \ | ||
| -wholename "./config/libtool.m4" -or \ | ||
| -wholename "./config/ltmain.sh" -or \ | ||
| -wholename "./config/ltoptions.m4" -or \ | ||
| -wholename "./config/ltsugar.m4" -or \ | ||
| -wholename "./config/missing" -or \ | ||
| -wholename "./configure" -or \ | ||
| -wholename "./java/Makefile" -or \ | ||
| -wholename "./java/Makefile.in" -or \ | ||
| -wholename "./libtool" -or \ | ||
| -wholename "./olad/www/mobile.js" -or \ | ||
| -wholename "./olad/www/new/js/app.min.js" -or \ | ||
| -wholename "./olad/www/new/js/app.min.js.map" -or \ | ||
| -wholename "./olad/www/new/libs/angular/js/angular.min.js" -or \ | ||
| -wholename "./olad/www/new/libs/marked/js/marked.min.js" -or \ | ||
| -wholename "./olad/www/ola.js" -or \ | ||
| -wholename "./plugins/artnet/messages/ArtNetConfigMessages.pb.*" -or \ | ||
| -wholename "./tools/ola_trigger/config.tab.*" -or \ | ||
| -wholename "./tools/ola_trigger/lex.yy.cpp" | ||
| BLACKLIST | ||
| ) | ||
|
|
||
| spellingfiles=$(eval "find ./ -type f -and ! \( \ | ||
| $SPELLINGBLACKLIST \ | ||
| \) | xargs") | ||
|
|
||
| if [ $current_test = "spellintian" ]; then | ||
| # count the number of spellintian errors, including duplicate words | ||
| # spellintian does not change the exit code, so the output must be checked | ||
| spellintian_issues="$(zrun spellintian $spellingfiles 2>&1)" | ||
|
|
||
| if [[ -n $spellintian_issues ]]; then | ||
| printf "%s\n" "$spellintian_issues" | ||
| # For now we always exit with success, as these errors are manually checked | ||
peternewman marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| # TODO: Actively match and skip printing known false positives, exit with | ||
| # errors properly. | ||
| # exit 1; | ||
| exit 0; | ||
| fi; | ||
| elif [ $current_test = "codespell" ]; then | ||
| if ! zrun codespell --interactive 0 --check-filenames --check-hidden \ | ||
| --quiet 2 --regex "[a-zA-Z0-9][\\-'a-zA-Z0-9]+[a-zA-Z0-9]" \ | ||
| --exclude-file .codespellignorelines \ | ||
| --ignore-words .codespellignorewords $spellingfiles 2>&1; then | ||
| exit 1; | ||
| fi; | ||
| fi; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As sort of mentioned before, I'm beginning to wonder more if this should all become ci.sh or part of the Makefile or something, I'm not really sure. Probably makes sense to leave it until everything is migrated so we can easily re-assess what it all looks like compared to .travis-ci.sh .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I have some ideas for wrapping things but I just want to get everything working initially first. I'm significantly changing things such that I would write a new
ci.shfrom scratch probably. The current one is very Travis-centric.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah that's cool, lets leave this for the future then.