- 
                Notifications
    You must be signed in to change notification settings 
- Fork 217
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
Changes from 7 commits
c35da8a
              98767f7
              66c662e
              fb8a0f5
              369d7b4
              924f970
              7cb2051
              2900052
              6abac14
              568d533
              2594579
              78a58e2
              3ca702b
              1bb2efc
              4af4b75
              2951908
              37bcc49
              e3f5d5d
              115cbbb
              File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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 | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } | 
| Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,103 @@ | ||
| #!/usr/bin/env bash | ||
| There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe 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  There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah that's cool, lets leave this for the future then. | ||
| # 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="" | ||
| # run_single_only=false | ||
|         
                  peternewman marked this conversation as resolved.
              Outdated
          
            Show resolved
            Hide resolved | ||
| if [ "$1" = "spellintian" ]; then | ||
| current_test="spellintian" | ||
| # run_single_only=true | ||
|         
                  peternewman marked this conversation as resolved.
              Outdated
          
            Show resolved
            Hide resolved | ||
| elif [ "$1" = "codespell" ]; then | ||
| current_test="codespell" | ||
| else | ||
| echo "Unknown test specified in first argument. Options are spellintian and codespell." | ||
|         
                  peternewman marked this conversation as resolved.
              Outdated
          
            Show resolved
            Hide resolved | ||
| 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 "./.codespellignorewords" -or \ | ||
| -wholename "./.codespellignorelines" -or \ | ||
| -wholename "./.git/*" -or \ | ||
| -wholename "./aclocal.m4" -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 "./libtool" -or \ | ||
| -wholename "./config.log" -or \ | ||
| -wholename "./config.status" -or \ | ||
|         
                  peternewman marked this conversation as resolved.
              Outdated
          
            Show resolved
            Hide resolved | ||
| -wholename "./Makefile" -or \ | ||
| -wholename "./Makefile.in" -or \ | ||
| -wholename "./autom4te.cache/*" -or \ | ||
|         
                  peternewman marked this conversation as resolved.
              Outdated
          
            Show resolved
            Hide resolved | ||
| -wholename "./java/Makefile" -or \ | ||
| -wholename "./java/Makefile.in" -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/mobile.js" -or \ | ||
| -wholename "./olad/www/ola.js" -or \ | ||
| -wholename "./configure" -or \ | ||
| -wholename "./common/protocol/Ola.pb.*" -or \ | ||
|         
                  peternewman marked this conversation as resolved.
              Outdated
          
            Show resolved
            Hide resolved | ||
| -wholename "./plugins/artnet/messages/ArtNetConfigMessages.pb.*" -or \ | ||
| -wholename "./tools/ola_trigger/config.tab.*" -or \ | ||
| -wholename "./tools/ola_trigger/lex.yy.cpp" -or \ | ||
| -wholename "*.cc" | ||
|         
                  peternewman marked this conversation as resolved.
              Outdated
          
            Show resolved
            Hide resolved | ||
| 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 | ||
| # exit 1; | ||
| exit 0; | ||
| fi; | ||
| fi; | ||
|  | ||
| if [ $current_test = "codespell" ]; then | ||
|         
                  peternewman marked this conversation as resolved.
              Outdated
          
            Show resolved
            Hide resolved | ||
| 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 | ||
|         
                  peternewman marked this conversation as resolved.
              Outdated
          
            Show resolved
            Hide resolved | ||
| exit 1; | ||
| fi; | ||
| fi; | ||
Uh oh!
There was an error while loading. Please reload this page.