Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .codespellignorelines
Original file line number Diff line number Diff line change
Expand Up @@ -191,3 +191,11 @@ import java.nio.ByteOrder;
string("one\\\"two\\\\three\\/four\\bfive\\fsix\\nseven\\reight\\tnine"),
s1 = "one\"two\\three/four\bfive\fsix\nseven\reight\tnine";
string("one\\\"two\\\\three\\/four\\bfive\\fsix\\nseven\\reight\\tnine"),
self.assertEqual(rtf._EscapeData(u'caf\xe9'), "caf\\xe9")
self.assertEqual('%s' % rtf._EscapeData(u'caf\xe9'), "caf\\xe9")
self.assertEqual('%s' % rtf._EscapeData(['caf\xe9']), "['caf\\\\xe9']")
self.assertEqual('%s' % rtf._EscapeData({"a": "caf\xe9"}),
"{'a': 'caf\\\\xe9'}")
# self.assertEqual('%s' % rtf._EscapeData({"caf\xe9": "bar"}),
# "{'caf\xe9': 'bar'}")
"forin": true,
1 change: 1 addition & 0 deletions .codespellignorewords
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ acn
ACN
inflight
thead
wronly
15 changes: 15 additions & 0 deletions .github/problem-matcher-lint-spellintian.json
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
}
]
}
]
}
60 changes: 60 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -194,3 +194,63 @@ jobs:
libusb-1.0-0-dev liblo-dev libavahi-client-dev python3-numpy
- name: flake8
run: make flake8 VERBOSE=1
spellintian:
name: spellintian
runs-on: ubuntu-latest
container: debian:stable
needs: build
steps:
- name: Download built source tree archive
uses: actions/download-artifact@v3
with:
name: ola-debian-stable-built-source-tree
path: .
- name: SHA256 artifact archive
run: sha256sum ola-debian-stable-built-source-tree.tar.gz
- name: Unarchive artifacts and delete archive
shell: bash
run: |
tar -xvzf ola-debian-stable-built-source-tree.tar.gz .
rm ola-debian-stable-built-source-tree.tar.gz
- name: Display structure of extracted files
if: env.ACTIONS_STEP_DEBUG == 'true'
run: ls -alR
- name: Update package database
run: apt-get update -y
- name: Install lint tools
run: apt-get -y install moreutils lintian
- name: Enable Problem Matcher for GitHub annotations
run: echo "::add-matcher::.github/problem-matcher-lint-spellintian.json"
- name: spellintian
run: ./scripts/spelling.sh spellintian
codespell:
name: codespell
runs-on: ubuntu-latest
container: debian:stable
needs: build
steps:
- name: Download built source tree archive
uses: actions/download-artifact@v3
with:
name: ola-debian-stable-built-source-tree
path: .
- name: SHA256 artifact archive
run: sha256sum ola-debian-stable-built-source-tree.tar.gz
- name: Unarchive artifacts and delete archive
shell: bash
run: |
tar -xvzf ola-debian-stable-built-source-tree.tar.gz .
rm ola-debian-stable-built-source-tree.tar.gz
- name: Display structure of extracted files
if: env.ACTIONS_STEP_DEBUG == 'true'
run: ls -alR
- name: Update package database
run: apt-get update -y
- name: Install lint tools
run: apt-get -y install python3-pip git moreutils
- name: Install Python lint tools
run: python3 -m pip install --no-input git+https://github.com/codespell-project/codespell.git
- name: Setup codespell annotations
uses: codespell-project/codespell-problem-matcher@v1
- name: codespell
run: ./scripts/spelling.sh codespell
2 changes: 1 addition & 1 deletion common/rdm/testdata/test_pids.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2263,7 +2263,7 @@ pid {
}
field {
type: STRING
name: "modulation_frequence_description"
name: "modulation_frequency_description"
max_size: 32
}
}
Expand Down
104 changes: 104 additions & 0 deletions scripts/spelling.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
#!/usr/bin/env bash
Copy link
Member

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 .

Copy link
Member Author

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.sh from scratch probably. The current one is very Travis-centric.

Copy link
Member

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.

# 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
# 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;
2 changes: 1 addition & 1 deletion tools/rdm/TestDefinitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -1520,7 +1520,7 @@ def VerifyResult(self, response, fields):
language_set.add(language)
if ContainsUnprintable(language):
self.AddAdvisory(
'Language name in languague capabilities contains unprintable '
'Language name in language capabilities contains unprintable '
'characters, was %s' % language.encode('string-escape'))

self.SetProperty('languages_capabilities', language_set)
Expand Down