Skip to content

Commit 40e8910

Browse files
committed
Merge branch '0.10' of https://github.com/openlightingproject/ola into 0.10-c11-compat
2 parents a8bfb32 + e523002 commit 40e8910

20 files changed

Lines changed: 511 additions & 53 deletions

.codespellignorelines

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,3 +191,11 @@ import java.nio.ByteOrder;
191191
string("one\\\"two\\\\three\\/four\\bfive\\fsix\\nseven\\reight\\tnine"),
192192
s1 = "one\"two\\three/four\bfive\fsix\nseven\reight\tnine";
193193
string("one\\\"two\\\\three\\/four\\bfive\\fsix\\nseven\\reight\\tnine"),
194+
self.assertEqual(rtf._EscapeData(u'caf\xe9'), "caf\\xe9")
195+
self.assertEqual('%s' % rtf._EscapeData(u'caf\xe9'), "caf\\xe9")
196+
self.assertEqual('%s' % rtf._EscapeData(['caf\xe9']), "['caf\\\\xe9']")
197+
self.assertEqual('%s' % rtf._EscapeData({"a": "caf\xe9"}),
198+
"{'a': 'caf\\\\xe9'}")
199+
# self.assertEqual('%s' % rtf._EscapeData({"caf\xe9": "bar"}),
200+
# "{'caf\xe9': 'bar'}")
201+
"forin": true,

.codespellignorewords

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ acn
22
ACN
33
inflight
44
thead
5+
wronly
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"problemMatcher": [
3+
{
4+
"owner": "lint-check-licences",
5+
"pattern": [
6+
{
7+
"regexp": "^(notice|error)(:(file|dir):([^:]+)(:lines? (\\d+)(-(\\d+))?)?)?: (.+)$",
8+
"severity": 1,
9+
"file": 4,
10+
"line": 6,
11+
"message": 9
12+
}
13+
]
14+
}
15+
]
16+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"problemMatcher": [
3+
{
4+
"owner": "lint-cpplint",
5+
"severity": "error",
6+
"pattern": [
7+
{
8+
"regexp": "^(.+):(\\d+):\\s+((.+)\\s+\\[(.*)\\]\\s\\[(.*)\\])$",
9+
"file": 1,
10+
"line": 2,
11+
"message": 3,
12+
"code": 5
13+
}
14+
]
15+
}
16+
]
17+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"problemMatcher": [
3+
{
4+
"owner": "lint-generic-nolints",
5+
"pattern": [
6+
{
7+
"regexp": "^(notice|error)(:(file|dir):([^:]+)(:lines? (\\d+)(-(\\d+))?)?)?: (.+)$",
8+
"severity": 1,
9+
"file": 4,
10+
"line": 6,
11+
"message": 9
12+
}
13+
]
14+
}
15+
]
16+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"problemMatcher": [
3+
{
4+
"owner": "lint-spellintian",
5+
"severity": "warning",
6+
"pattern": [
7+
{
8+
"regexp": "^([^:]+):(\\s+)(.+)$",
9+
"file": 1,
10+
"message": 3
11+
}
12+
]
13+
}
14+
]
15+
}

.github/workflows/annotation.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,3 @@ jobs:
1212
- name: Flake8 with annotations - Python 2
1313
# Using the flake8 options in the .flake8 file
1414
uses: TrueBrain/actions-flake8@main
15-
flake8-annotation-python3:
16-
runs-on: ubuntu-latest
17-
steps:
18-
- uses: actions/checkout@master
19-
- uses: actions/setup-python@v2
20-
with:
21-
python-version: '3.10'
22-
- name: Flake8 with annotations - Python 3
23-
# Using the flake8 options in the .flake8 file
24-
uses: TrueBrain/actions-flake8@main

.github/workflows/lint.yaml

Lines changed: 238 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,238 @@
1+
name: lint
2+
on: [push, pull_request]
3+
jobs:
4+
build:
5+
name: Build for Lint Tasks
6+
runs-on: ubuntu-latest
7+
container: debian:stable
8+
steps:
9+
- name: Update package database
10+
run: apt-get update -y
11+
# See comments beginning at
12+
# https://github.com/actions/runner/issues/763#issuecomment-1435474884
13+
# Without Git, actions/checkout@v3 will resort to REST and will not
14+
# create a .git folder or .git.config. The Problem Matcher looks for
15+
# .git/config to find where the root of the repo is, so it must be
16+
# present.
17+
- name: Install Git
18+
run: apt-get -y install git
19+
- uses: actions/checkout@v3
20+
- name: Install build tools
21+
shell: bash
22+
run: |
23+
apt-get -y install pkg-config libtool autoconf \
24+
automake g++ bison flex make bash-completion dh-autoreconf \
25+
debhelper devscripts wget python3-pip
26+
- name: Install Python lint tools
27+
run: python3 -m pip install --no-input cpplint flake8
28+
- name: Install build dependencies
29+
shell: bash
30+
run: |
31+
apt-get -y install libcppunit-dev uuid-dev libncurses5-dev \
32+
libmicrohttpd-dev protobuf-compiler python3-protobuf \
33+
libprotobuf-dev libprotoc-dev zlib1g-dev libftdi-dev \
34+
libusb-1.0-0-dev liblo-dev libavahi-client-dev python3-numpy
35+
- name: Autoreconf
36+
run: autoreconf -i
37+
- name: Configure
38+
run: ./configure --enable-rdm-tests --enable-ja-rule --enable-e133
39+
- name: Build builtfiles
40+
run: make builtfiles VERBOSE=1
41+
- name: Display structure of the built files
42+
if: env.ACTIONS_STEP_DEBUG == 'true'
43+
run: ls -alR
44+
- name: Archive artifacts to speed up slow GH Actions upload/download
45+
shell: bash
46+
# If the file does not exist when tar excludes it, then it will not
47+
# actually exclude it, so it must first be touched
48+
run: |
49+
touch ola-debian-stable-built-source-tree.tar.gz
50+
tar --exclude=ola-debian-stable-built-source-tree.tar.gz -cvzf ola-debian-stable-built-source-tree.tar.gz .
51+
- name: SHA256 artifact archive
52+
run: sha256sum ola-debian-stable-built-source-tree.tar.gz
53+
- uses: actions/upload-artifact@v3
54+
with:
55+
name: ola-debian-stable-built-source-tree
56+
path: ola-debian-stable-built-source-tree.tar.gz
57+
check-licences:
58+
name: Check Licences
59+
runs-on: ubuntu-latest
60+
container: debian:stable
61+
needs: build
62+
steps:
63+
- name: Download built source tree archive
64+
uses: actions/download-artifact@v3
65+
with:
66+
name: ola-debian-stable-built-source-tree
67+
path: .
68+
- name: SHA256 artifact archive
69+
run: sha256sum ola-debian-stable-built-source-tree.tar.gz
70+
- name: Unarchive artifacts and delete archive
71+
shell: bash
72+
run: |
73+
tar -xvzf ola-debian-stable-built-source-tree.tar.gz .
74+
rm ola-debian-stable-built-source-tree.tar.gz
75+
- name: Display structure of extracted files
76+
if: env.ACTIONS_STEP_DEBUG == 'true'
77+
run: ls -alR
78+
- name: Update package database
79+
run: apt-get update -y
80+
- name: Install Python
81+
run: apt-get -y install python3 python-is-python3
82+
- name: Enable Problem Matcher for GitHub annotations
83+
run: echo "::add-matcher::.github/problem-matcher-lint-check-licences.json"
84+
- name: Check licenses
85+
shell: bash
86+
run: ./scripts/enforce_licence.py
87+
generic-nolints:
88+
name: Count generic NOLINTs
89+
runs-on: ubuntu-latest
90+
container: debian:stable
91+
needs: build
92+
steps:
93+
- name: Download built source tree archive
94+
uses: actions/download-artifact@v3
95+
with:
96+
name: ola-debian-stable-built-source-tree
97+
path: .
98+
- name: SHA256 artifact archive
99+
run: sha256sum ola-debian-stable-built-source-tree.tar.gz
100+
- name: Unarchive artifacts and delete archive
101+
shell: bash
102+
run: |
103+
tar -xvzf ola-debian-stable-built-source-tree.tar.gz .
104+
rm ola-debian-stable-built-source-tree.tar.gz
105+
- name: Display structure of extracted files
106+
if: env.ACTIONS_STEP_DEBUG == 'true'
107+
run: ls -alR
108+
- name: Enable Problem Matcher for GitHub annotations
109+
run: echo "::add-matcher::.github/problem-matcher-lint-generic-nolints.json"
110+
- name: Count the number of generic NOLINTs
111+
shell: bash
112+
run: ./scripts/count_generic_nolints.sh
113+
cpplint:
114+
name: cpplint
115+
runs-on: ubuntu-latest
116+
container: debian:stable
117+
needs: build
118+
steps:
119+
- name: Download built source tree archive
120+
uses: actions/download-artifact@v3
121+
with:
122+
name: ola-debian-stable-built-source-tree
123+
path: .
124+
- name: SHA256 artifact archive
125+
run: sha256sum ola-debian-stable-built-source-tree.tar.gz
126+
- name: Unarchive artifacts and delete archive
127+
shell: bash
128+
run: |
129+
tar -xvzf ola-debian-stable-built-source-tree.tar.gz .
130+
rm ola-debian-stable-built-source-tree.tar.gz
131+
- name: Display structure of extracted files
132+
if: env.ACTIONS_STEP_DEBUG == 'true'
133+
run: ls -alR
134+
- name: Update package database
135+
run: apt-get update -y
136+
- name: Install build tools
137+
shell: bash
138+
run: |
139+
apt-get -y install make python3-pip
140+
- name: Install Python lint tools
141+
run: python3 -m pip install --no-input cpplint
142+
- name: Enable Problem Matcher for GitHub annotations
143+
run: echo "::add-matcher::.github/problem-matcher-lint-cpplint.json"
144+
- name: cpplint
145+
run: make cpplint VERBOSE=1
146+
flake8:
147+
name: flake8
148+
runs-on: ubuntu-latest
149+
container: debian:stable
150+
needs: build
151+
steps:
152+
- name: Download built source tree archive
153+
uses: actions/download-artifact@v3
154+
with:
155+
name: ola-debian-stable-built-source-tree
156+
path: .
157+
- name: SHA256 artifact archive
158+
run: sha256sum ola-debian-stable-built-source-tree.tar.gz
159+
- name: Unarchive artifacts and delete archive
160+
shell: bash
161+
run: |
162+
tar -xvzf ola-debian-stable-built-source-tree.tar.gz .
163+
rm ola-debian-stable-built-source-tree.tar.gz
164+
- name: Display structure of extracted files
165+
if: env.ACTIONS_STEP_DEBUG == 'true'
166+
run: ls -alR
167+
- name: Update package database
168+
run: apt-get update -y
169+
- name: Install build tools
170+
shell: bash
171+
run: |
172+
apt-get -y install make python3-pip
173+
- name: Install Python lint tools
174+
run: python3 -m pip install --no-input flake8
175+
- name: Setup flake8 annotations
176+
uses: rbialon/flake8-annotations@v1
177+
- name: flake8
178+
run: make flake8 VERBOSE=1
179+
spellintian:
180+
name: spellintian
181+
runs-on: ubuntu-latest
182+
container: debian:stable
183+
needs: build
184+
steps:
185+
- name: Download built source tree archive
186+
uses: actions/download-artifact@v3
187+
with:
188+
name: ola-debian-stable-built-source-tree
189+
path: .
190+
- name: SHA256 artifact archive
191+
run: sha256sum ola-debian-stable-built-source-tree.tar.gz
192+
- name: Unarchive artifacts and delete archive
193+
shell: bash
194+
run: |
195+
tar -xvzf ola-debian-stable-built-source-tree.tar.gz .
196+
rm ola-debian-stable-built-source-tree.tar.gz
197+
- name: Display structure of extracted files
198+
if: env.ACTIONS_STEP_DEBUG == 'true'
199+
run: ls -alR
200+
- name: Update package database
201+
run: apt-get update -y
202+
- name: Install lint tools
203+
run: apt-get -y install moreutils lintian
204+
- name: Enable Problem Matcher for GitHub annotations
205+
run: echo "::add-matcher::.github/problem-matcher-lint-spellintian.json"
206+
- name: spellintian
207+
run: ./scripts/spelling.sh spellintian
208+
codespell:
209+
name: codespell
210+
runs-on: ubuntu-latest
211+
container: debian:stable
212+
needs: build
213+
steps:
214+
- name: Download built source tree archive
215+
uses: actions/download-artifact@v3
216+
with:
217+
name: ola-debian-stable-built-source-tree
218+
path: .
219+
- name: SHA256 artifact archive
220+
run: sha256sum ola-debian-stable-built-source-tree.tar.gz
221+
- name: Unarchive artifacts and delete archive
222+
shell: bash
223+
run: |
224+
tar -xvzf ola-debian-stable-built-source-tree.tar.gz .
225+
rm ola-debian-stable-built-source-tree.tar.gz
226+
- name: Display structure of extracted files
227+
if: env.ACTIONS_STEP_DEBUG == 'true'
228+
run: ls -alR
229+
- name: Update package database
230+
run: apt-get update -y
231+
- name: Install lint tools
232+
run: apt-get -y install python3-pip git moreutils
233+
- name: Install Python lint tools
234+
run: python3 -m pip install --no-input git+https://github.com/codespell-project/codespell.git
235+
- name: Setup codespell annotations
236+
uses: codespell-project/codespell-problem-matcher@v1
237+
- name: codespell
238+
run: ./scripts/spelling.sh codespell

AUTHORS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Contributors:
2121
Masaki Muranaka, various patches
2222
Nicolas, for the win32 port of libartnet
2323
Nils Van Zuijlen, typos and python lib small update
24-
Perry Naseck, EPoll delay fix
24+
Perry Naseck, EPoll delay fix, various GitHub Actions CI workflows
2525
Peter Newman, MilInst Plugin, Scanlime Fadecandy support and numerous fixes
2626
Ravindra Nath Kakarla, RDM Test Server (Google Summer of Code 2012)
2727
Rowan Maclachlan (hippy) for various changes

Makefile.am

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -240,13 +240,12 @@ lint: flake8 cpplint
240240
.PHONY : flake8
241241
flake8: Makefile.am
242242
if FOUND_FLAKE8
243-
flake8
243+
flake8 --statistics --count
244244
else
245245
$(error flake8 not found. Install flake8 and re-run configure.)
246246
endif
247247

248248
# cpplint linter
249-
CPP_LINT_URL = "https://raw.githubusercontent.com/google/styleguide/gh-pages/cpplint/cpplint.py"
250249
CPP_LINT_FILTER = "-legal/copyright,-readability/streams,-runtime/arrays"
251250
CPP_LINT_FILES = $(shell find . \( -name "*.h" -or -name "*.cpp" \) -and ! \( \
252251
-wholename "./common/protocol/Ola.pb.*" -or \
@@ -258,16 +257,9 @@ CPP_LINT_FILES = $(shell find . \( -name "*.h" -or -name "*.cpp" \) -and ! \( \
258257
-wholename "./tools/ola_trigger/config.tab.*" -or \
259258
-wholename "./tools/ola_trigger/lex.yy.cpp" \) | xargs)
260259
.PHONY : cpplint
261-
if FOUND_CPPLINT
262260
cpplint: Makefile.am
263-
cpplint.py --filter=$(CPP_LINT_FILTER) $(CPP_LINT_FILES)
261+
if FOUND_CPPLINT
262+
cpplint --filter=$(CPP_LINT_FILTER) $(CPP_LINT_FILES)
264263
else
265-
cpplint: Makefile.am cpplint.py
266-
./cpplint.py --filter=$(CPP_LINT_FILTER) $(CPP_LINT_FILES)
267-
endif
268-
269-
if !FOUND_CPPLINT
270-
cpplint.py:
271-
wget -O cpplint.py $(CPP_LINT_URL)
272-
chmod u+x cpplint.py
264+
$(error cpplint not found. Install the forked cpplint (e.g. via pip for the latest version) and re-run configure.)
273265
endif

0 commit comments

Comments
 (0)