Skip to content

Commit f00d8d3

Browse files
authored
Merge pull request #1 from rainybit-code/chore/contributor-tooling
chore: contributor tooling, clang-format, comment cleanup
2 parents 58a5487 + 507cc54 commit f00d8d3

33 files changed

Lines changed: 2440 additions & 1815 deletions

.clang-format

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Code style for Spore. Run `clang-format -i src/**/*.{h,cpp,c}` before committing
2+
# (CI enforces it). Based on Google C++ with a 4-space indent and a 100-col width
3+
# to match the existing source.
4+
---
5+
Language: Cpp
6+
BasedOnStyle: Google
7+
IndentWidth: 4
8+
ContinuationIndentWidth: 4
9+
AccessModifierOffset: -2
10+
ColumnLimit: 100
11+
PointerAlignment: Left
12+
DerivePointerAlignment: false
13+
AlignTrailingComments: true
14+
# Includes are grouped by layer (daisy -> config -> io -> mod -> fx -> modes) on
15+
# purpose; don't let the formatter reorder them.
16+
SortIncludes: false

.clang-format-ignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Vendored sources keep their upstream formatting.
2+
src/hothouse.cpp
3+
src/hothouse.h
4+
src/usb_identity.c

.editorconfig

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# https://editorconfig.org -- baseline whitespace rules for every editor.
2+
root = true
3+
4+
[*]
5+
charset = utf-8
6+
end_of_line = lf
7+
insert_final_newline = true
8+
trim_trailing_whitespace = true
9+
indent_style = space
10+
indent_size = 4
11+
12+
[*.md]
13+
trim_trailing_whitespace = false # trailing spaces are meaningful (hard line break)
14+
15+
[Makefile]
16+
indent_style = tab
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
name: Bug report
3+
about: Report something that doesn't work as expected
4+
title: ''
5+
labels: bug
6+
assignees: ''
7+
---
8+
9+
**What happens**
10+
A clear description of the bug and what you expected instead.
11+
12+
**Firmware version**
13+
The version Spore reports over SysEx identify (shown in Propagator), or the git tag/commit
14+
you built from.
15+
16+
**Hardware**
17+
- Daisy Seed + Hothouse, or a bare Seed on the bench?
18+
- Anything wired to the analog sensor input (A0/D15)?
19+
20+
**Control state**
21+
Active mode (Toggle 1), FX (Toggle 3), variant (Toggle 2), and any relevant knob positions.
22+
If driving over MIDI, the CCs/notes involved.
23+
24+
**Steps to reproduce**
25+
1.
26+
2.
27+
3.
28+
29+
**Audio/log evidence**
30+
A recording, photo of the LEDs, or the CPU-load reading if relevant.

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
blank_issues_enabled: true
2+
contact_links:
3+
- name: Propagator (browser editor)
4+
url: https://github.com/rainybit-code/propagator/issues
5+
about: Issues with the companion web editor belong in the Propagator repo.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
name: Feature request
3+
about: Suggest a new mode, control, or capability
4+
title: ''
5+
labels: enhancement
6+
assignees: ''
7+
---
8+
9+
**What you'd like**
10+
A clear description of the feature or change.
11+
12+
**Why**
13+
The musical or workflow problem it solves.
14+
15+
**How it might work**
16+
Proposed control mapping (knobs/toggles/footswitches or MIDI CCs), and whether it fits an
17+
existing mode or needs a new one. See `docs/IDEAS.md` for the current roadmap.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<!-- Thanks for contributing to Spore! See CONTRIBUTING.md. -->
2+
3+
## What this changes
4+
5+
<!-- A short description of the change and why. -->
6+
7+
## Checklist
8+
9+
- [ ] Ran `clang-format -i` on touched files (CI enforces formatting)
10+
- [ ] `scripts/build.sh` (or `.ps1`) builds clean
11+
- [ ] New tunable values live in `src/config/params.h`
12+
- [ ] Added a line under `## [Unreleased]` in `CHANGELOG.md`
13+
- [ ] If a control changed, updated `docs/MIDI_PROTOCOL.md` and the `params::midi` map
14+
- [ ] Tested on hardware (Daisy Seed + Hothouse) — describe below, or note if untested

.github/workflows/firmware.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,18 @@ permissions:
1414
contents: write # needed to create Releases on tag builds
1515

1616
jobs:
17+
format:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v4
21+
- name: Check formatting (clang-format)
22+
run: |
23+
clang-format --version
24+
# Vendored sources keep their upstream formatting (also in .clang-format-ignore).
25+
find src \( -name '*.h' -o -name '*.cpp' -o -name '*.c' \) \
26+
! -name 'hothouse.*' ! -name 'usb_identity.c' -print0 \
27+
| xargs -0 clang-format --dry-run --Werror
28+
1729
build:
1830
runs-on: ubuntu-latest
1931
steps:
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
name: update-submodules
2+
3+
# Weekly check for new libDaisy / DaisySP commits. If upstream has moved, bump the
4+
# vendored submodules, confirm the firmware still builds, and open a PR. Also runnable
5+
# on demand from the Actions tab (workflow_dispatch).
6+
on:
7+
schedule:
8+
- cron: '0 7 * * 1' # Mondays 07:00 UTC
9+
workflow_dispatch:
10+
11+
permissions:
12+
contents: write
13+
pull-requests: write
14+
15+
jobs:
16+
update:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Checkout (with submodules)
20+
uses: actions/checkout@v4
21+
with:
22+
submodules: recursive
23+
fetch-depth: 0
24+
25+
- name: Bump submodules to upstream HEAD
26+
id: bump
27+
run: |
28+
set -e
29+
summary=""
30+
for sm in lib/libDaisy lib/DaisySP; do
31+
old=$(git -C "$sm" rev-parse --short HEAD)
32+
git -C "$sm" fetch --quiet origin
33+
def=$(git -C "$sm" remote show origin | sed -n 's/.*HEAD branch: //p')
34+
git -C "$sm" checkout --quiet "origin/$def"
35+
new=$(git -C "$sm" rev-parse --short HEAD)
36+
[ "$old" != "$new" ] && summary="${summary}- \`${sm}\`: ${old} -> ${new}"$'\n'
37+
done
38+
# Stage the new gitlinks, then sync nested submodules (each lib has its own) to match.
39+
git add lib/libDaisy lib/DaisySP
40+
git submodule update --init --recursive
41+
if git diff --cached --quiet -- lib; then
42+
echo "changed=false" >> "$GITHUB_OUTPUT"
43+
echo "Submodules already up to date."
44+
else
45+
echo "changed=true" >> "$GITHUB_OUTPUT"
46+
{ echo "summary<<EOF"; printf '%s' "$summary"; echo "EOF"; } >> "$GITHUB_OUTPUT"
47+
fi
48+
49+
- name: Install ARM GCC toolchain
50+
if: steps.bump.outputs.changed == 'true'
51+
uses: carlosperate/arm-none-eabi-gcc-action@v1
52+
with:
53+
release: '12.3.Rel1'
54+
55+
- name: Build with the updated libraries
56+
if: steps.bump.outputs.changed == 'true'
57+
id: build
58+
continue-on-error: true # a build break shouldn't suppress the PR -- flag it instead
59+
run: |
60+
make -C lib/libDaisy -j"$(nproc)"
61+
make -C lib/DaisySP -j"$(nproc)"
62+
make -j"$(nproc)"
63+
64+
- name: Open pull request
65+
if: steps.bump.outputs.changed == 'true'
66+
uses: peter-evans/create-pull-request@v6
67+
with:
68+
branch: chore/update-submodules
69+
delete-branch: true
70+
add-paths: lib
71+
commit-message: 'chore: update vendored submodules to upstream HEAD'
72+
title: 'chore: update vendored submodules (libDaisy / DaisySP)'
73+
labels: dependencies
74+
body: |
75+
Automated weekly bump of the vendored libraries to their upstream default branch.
76+
77+
${{ steps.bump.outputs.summary }}
78+
Firmware build with the updated libraries: **${{ steps.build.outcome }}**
79+
(`success` = compiles clean; `failure` = needs a compatibility fix before merging).
80+
81+
Review the upstream changelogs, then merge if the build is green. The repo's
82+
`firmware.yml` CI does **not** run automatically on this bot PR (a GitHub limitation
83+
on `GITHUB_TOKEN`-created PRs), which is why the build above runs inline.

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/); this pr
55
uses [Semantic Versioning](https://semver.org/) (`vMAJOR.MINOR.PATCH`).
66

77
## [Unreleased]
8+
- **Contributor tooling.** Added `CONTRIBUTING.md`, GitHub issue/PR templates, a
9+
`.clang-format` (Google C++, 4-space, 100-col) + `.editorconfig`, and a CI job that
10+
enforces formatting. New `scripts/setup.{sh,ps1}` one-shot bootstrap (submodules + libs).
11+
- **Internal cleanup** (no behaviour change): `PumpMidi` takes a `MidiContext` struct
12+
instead of 11 positional args; per-mode parameter defaults are assigned by enum name so
13+
reordering can't silently shift them; CPU-watchdog and LED thresholds moved into
14+
`params::watchdog` / `params::ui`.
815

916
## [v0.3.4] - 2026-06-24
1017
- **New Granular engine controls** (`config/gran_params.h`, CC 94-97) for the Propagator

0 commit comments

Comments
 (0)