Skip to content

Commit c80f208

Browse files
committed
GitHub Action to find typos and lint Python code
1 parent bd7de87 commit c80f208

39 files changed

+104
-79
lines changed

.github/workflows/ci.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# This Action uses minimal steps to run in ~5 seconds to rapidly:
2+
# look for typos in the codebase using codespell, and
3+
# lint Python code using ruff and provide intuitive GitHub Annotations to contributors.
4+
# https://github.com/codespell-project/codespell#readme
5+
# https://docs.astral.sh/ruff/
6+
name: ci
7+
on:
8+
push:
9+
# branches: [main, master]
10+
pull_request:
11+
# branches: [main, master]
12+
jobs:
13+
codespell:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
- uses: codespell-project/actions-codespell@v2
18+
with:
19+
ignore_words_list: blockin,dout,ethe,fo,reson,rin,shiftin,siz
20+
skip: "*.min.js"
21+
ruff:
22+
runs-on: ubuntu-latest
23+
steps:
24+
- uses: actions/checkout@v4
25+
- uses: astral-sh/ruff-action@v3

Resampler.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ void Resampler::resample(float* input0, float* input1, uint16_t inputLength, uin
306306
}
307307
}
308308
if(outputCount < outputLength){
309-
//ouput vector not full -> we ran out of input samples
309+
//output vector not full -> we ran out of input samples
310310
processedLength=inputLength;
311311
}
312312
else{

Resampler.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ class Resampler {
161161
}
162162
}
163163
if(outputCount < outputLength){
164-
//ouput vector not full -> we ran out of input samples
164+
//output vector not full -> we ran out of input samples
165165
processedLength=inputLength;
166166
}
167167
else{

analyze_fft1024.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ void AudioAnalyzeFFT1024::update(void)
9797
case 7:
9898
blocklist[7] = block;
9999
// TODO: perhaps distribute the work over multiple update() ??
100-
// github pull requsts welcome......
100+
// github pull requests welcome......
101101
copy_to_fft_buffer(buffer+0x000, blocklist[0]->data);
102102
copy_to_fft_buffer(buffer+0x100, blocklist[1]->data);
103103
copy_to_fft_buffer(buffer+0x200, blocklist[2]->data);

analyze_tonedetect.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ AudioAnalyzeToneDetect::operator bool()
153153

154154
//Serial.printf("bool: power=%d, trig=%d\n", power, trigger);
155155
return (power >= trigger);
156-
// TODO: this should really remember if it's retuned true previously,
156+
// TODO: this should really remember if it's returned true previously,
157157
// so it can give a single true response each time a tone is seen.
158158
}
159159

control_cs42448.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ bool AudioControlCS42448::inputLevelInteger(int32_t n)
127127
return write(CS42448_DAC_Channel_Invert, data, 7);
128128
}
129129

130-
bool AudioControlCS42448::inputLevelInteger(int chnnel, int32_t n)
130+
bool AudioControlCS42448::inputLevelInteger(int channel, int32_t n)
131131
{
132132

133133
return true;

control_cs42448.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class AudioControlCS42448 : public AudioControl
6666
bool volumeInteger(uint32_t n);
6767
bool volumeInteger(int channel, uint32_t n);
6868
bool inputLevelInteger(int32_t n);
69-
bool inputLevelInteger(int chnnel, int32_t n);
69+
bool inputLevelInteger(int channel, int32_t n);
7070
// convert level to volume byte, section 6.9.1, page 50
7171
uint32_t volumebyte(float level) {
7272
if (level >= 1.0f) return 0;

control_tlv320aic3206.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ bool AudioControlTLV320AIC3206::setMicBias(int n) {
244244
}
245245

246246
void AudioControlTLV320AIC3206::aic_reset() {
247-
if (debugToSerial) Serial.println("INFO: Reseting AIC");
247+
if (debugToSerial) Serial.println("INFO: Resetting AIC");
248248
aic_writePage(0x00, 0x01, 0x01);
249249
// aic_writeAddress(0x0001, 0x01);
250250

effect_delay.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ class AudioEffectDelay : public AudioStream
8383
}
8484
void disable(uint8_t channel) {
8585
if (channel >= 8) return;
86-
// diable this channel
86+
// disable this channel
8787
activemask &= ~(1<<channel);
8888
// recompute maxblocks for remaining enabled channels
8989
recompute_maxblocks();

effect_granular.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ void AudioEffectGranular::update(void)
153153
sample_req = false;
154154
allow_len_change = true; // Reduces noise by not allowing the
155155
// length to change after the sample has been
156-
// recored. Kind of not too much though
156+
// recorded. Kind of not too much though
157157
if (write_head >= glitch_len) {
158158
write_head = 0;
159159
sample_loaded = true;
@@ -166,7 +166,7 @@ void AudioEffectGranular::update(void)
166166

167167
if (sample_loaded) {
168168
//move it to the middle third of the bank.
169-
//3 "seperate" banks are used
169+
//3 "separate" banks are used
170170
float fade_len = 20.00;
171171
int16_t m2 = fade_len;
172172

0 commit comments

Comments
 (0)