Adapt agent guidance and supporting docs for BeatGlow

This commit is contained in:
maze committed 2026-10-29 17:44:29 +01:00
1 parent 7916bc0b78
commit 07dc1ec5b3
5 files changed
+154 -1

No files matched your search

+22
View File
@@ -0,0 +1,22 @@
# Coding conventions
- Use idiomatic Go, `gofmt`, and the surrounding package's naming and import style.
Extend existing contracts instead of introducing parallel registries or layers.
- Wrap propagated errors with useful context and `%w`. Use `errors.Is` or
`errors.As` when callers need to recognize them.
- Decide recovery at the caller: a disconnected MPD server can be retried, while
unusable startup configuration should return an error. Explain intentional
recovery; avoid silent failures and unnecessary process termination.
- Use structured Logrus fields for component, device, connection and path context.
Keep frame/sample loops quiet; log meaningful transitions and actionable failures.
- Keep display refreshes and controller event handling responsive. Close owned
connections, files and tickers; make goroutine shutdown explicit. Review channel
ownership and synchronization when changing lifecycle behavior.
- Validate protocol responses, HCL values, dimensions and PCM formats before use.
Respect Linux build constraints and hardware-specific dependencies.
- Put focused tests beside implementations. Cover parsing, malformed input,
detection precedence, failures and recovery with temporary files or fake servers.
Unit tests should run without physical GPIO, displays or a live MPD instance.
Adapted from [Flow's coding guide](https://github.com/onflow/flow-go/blob/master/docs/agents/CodingConventions.md),
with BeatGlow-specific lifecycle, logging and hardware guidance.