Skip to content

Commit cfbfe34

Browse files
authored
Merge pull request #42 from OpenLightingProject/0.10
Resync with 0.10
2 parents 0328b63 + 74f80b2 commit cfbfe34

17 files changed

Lines changed: 502 additions & 47 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: 256 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,256 @@
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 pkg-config libtool autoconf \
140+
automake g++ bison flex make bash-completion dh-autoreconf \
141+
debhelper devscripts wget python3-pip
142+
- name: Install Python lint tools
143+
run: python3 -m pip install --no-input cpplint flake8
144+
- name: Install build dependencies
145+
shell: bash
146+
run: |
147+
apt-get -y install libcppunit-dev uuid-dev libncurses5-dev \
148+
libmicrohttpd-dev protobuf-compiler python3-protobuf \
149+
libprotobuf-dev libprotoc-dev zlib1g-dev libftdi-dev \
150+
libusb-1.0-0-dev liblo-dev libavahi-client-dev python3-numpy
151+
- name: Enable Problem Matcher for GitHub annotations
152+
run: echo "::add-matcher::.github/problem-matcher-lint-cpplint.json"
153+
- name: cpplint
154+
run: make cpplint VERBOSE=1
155+
flake8:
156+
name: flake8
157+
runs-on: ubuntu-latest
158+
container: debian:stable
159+
needs: build
160+
steps:
161+
- name: Download built source tree archive
162+
uses: actions/download-artifact@v3
163+
with:
164+
name: ola-debian-stable-built-source-tree
165+
path: .
166+
- name: SHA256 artifact archive
167+
run: sha256sum ola-debian-stable-built-source-tree.tar.gz
168+
- name: Unarchive artifacts and delete archive
169+
shell: bash
170+
run: |
171+
tar -xvzf ola-debian-stable-built-source-tree.tar.gz .
172+
rm ola-debian-stable-built-source-tree.tar.gz
173+
- name: Display structure of extracted files
174+
if: env.ACTIONS_STEP_DEBUG == 'true'
175+
run: ls -alR
176+
- name: Update package database
177+
run: apt-get update -y
178+
- name: Install build tools
179+
shell: bash
180+
run: |
181+
apt-get -y install pkg-config libtool autoconf \
182+
automake g++ bison flex make bash-completion dh-autoreconf \
183+
debhelper devscripts wget python3-pip
184+
- name: Install Python lint tools
185+
run: python3 -m pip install --no-input cpplint flake8
186+
- name: Setup flake8 annotations
187+
uses: rbialon/flake8-annotations@v1
188+
- name: Install build dependencies
189+
shell: bash
190+
run: |
191+
apt-get -y install libcppunit-dev uuid-dev libncurses5-dev \
192+
libmicrohttpd-dev protobuf-compiler python3-protobuf \
193+
libprotobuf-dev libprotoc-dev zlib1g-dev libftdi-dev \
194+
libusb-1.0-0-dev liblo-dev libavahi-client-dev python3-numpy
195+
- name: flake8
196+
run: make flake8 VERBOSE=1
197+
spellintian:
198+
name: spellintian
199+
runs-on: ubuntu-latest
200+
container: debian:stable
201+
needs: build
202+
steps:
203+
- name: Download built source tree archive
204+
uses: actions/download-artifact@v3
205+
with:
206+
name: ola-debian-stable-built-source-tree
207+
path: .
208+
- name: SHA256 artifact archive
209+
run: sha256sum ola-debian-stable-built-source-tree.tar.gz
210+
- name: Unarchive artifacts and delete archive
211+
shell: bash
212+
run: |
213+
tar -xvzf ola-debian-stable-built-source-tree.tar.gz .
214+
rm ola-debian-stable-built-source-tree.tar.gz
215+
- name: Display structure of extracted files
216+
if: env.ACTIONS_STEP_DEBUG == 'true'
217+
run: ls -alR
218+
- name: Update package database
219+
run: apt-get update -y
220+
- name: Install lint tools
221+
run: apt-get -y install moreutils lintian
222+
- name: Enable Problem Matcher for GitHub annotations
223+
run: echo "::add-matcher::.github/problem-matcher-lint-spellintian.json"
224+
- name: spellintian
225+
run: ./scripts/spelling.sh spellintian
226+
codespell:
227+
name: codespell
228+
runs-on: ubuntu-latest
229+
container: debian:stable
230+
needs: build
231+
steps:
232+
- name: Download built source tree archive
233+
uses: actions/download-artifact@v3
234+
with:
235+
name: ola-debian-stable-built-source-tree
236+
path: .
237+
- name: SHA256 artifact archive
238+
run: sha256sum ola-debian-stable-built-source-tree.tar.gz
239+
- name: Unarchive artifacts and delete archive
240+
shell: bash
241+
run: |
242+
tar -xvzf ola-debian-stable-built-source-tree.tar.gz .
243+
rm ola-debian-stable-built-source-tree.tar.gz
244+
- name: Display structure of extracted files
245+
if: env.ACTIONS_STEP_DEBUG == 'true'
246+
run: ls -alR
247+
- name: Update package database
248+
run: apt-get update -y
249+
- name: Install lint tools
250+
run: apt-get -y install python3-pip git moreutils
251+
- name: Install Python lint tools
252+
run: python3 -m pip install --no-input git+https://github.com/codespell-project/codespell.git
253+
- name: Setup codespell annotations
254+
uses: codespell-project/codespell-problem-matcher@v1
255+
- name: codespell
256+
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 forked cpplint (e.g. via pip for the latest version) and re-run configure.)
273265
endif

0 commit comments

Comments
 (0)