Skip to content

Harden library: CI/CD, type specs, Elixir 1.18, JSON stdlib#1

Merged
nyo16 merged 1 commit into
masterfrom
harden-lib-v0.3.0
Mar 28, 2026
Merged

Harden library: CI/CD, type specs, Elixir 1.18, JSON stdlib#1
nyo16 merged 1 commit into
masterfrom
harden-lib-v0.3.0

Conversation

@nyo16

@nyo16 nyo16 commented Mar 28, 2026

Copy link
Copy Markdown
Owner

Summary

  • CI/CD pipeline ported from nous: compile (warnings-as-errors), format, credo (--strict), test, dialyzer, hex publish on version tags
  • Elixir ~> 1.18 / OTP 27 — replaced all direct Jason usage with Elixir 1.18 stdlib JSON module
  • Type safety — added @spec/@type annotations to all ~99 public functions across 22 modules, passing mix dialyzer with 0 warnings
  • Protect API parity — added get/2, update/3, stream/2 to Sensors, Lights, Chimes, Liveviews
  • Typed stream errors — new UnifiApi.StreamError exception replaces bare RuntimeError, also handles non-list API responses
  • Hardened tests — 133 tests (up from 106): new formatter tests, client edge cases (401, mid-stream errors, non-list responses, verify_ssl), protect stream/get/update coverage

Test plan

  • mix compile --warnings-as-errors — clean
  • mix format --check-formatted — clean
  • mix credo --strict — 0 issues
  • mix test — 133 tests, 0 failures
  • mix dialyzer — 0 errors

- Set Elixir version to ~> 1.18 with OTP 27, extract @Version module attr
- Add CI/CD pipeline (compile, format, credo, test, dialyzer, hex publish)
- Add Credo config and Dialyxir for static analysis
- Add @spec/@type annotations to all ~99 public functions across 22 modules
- Replace all direct Jason usage with Elixir 1.18 stdlib JSON module
- Create UnifiApi.StreamError exception for typed stream error handling
- Add get/2, update/3, stream/2 to Protect Sensors, Lights, Chimes, Liveviews
- Harden tests: 133 total (up from 106) with formatter, edge case, and stream tests
@nyo16 nyo16 merged commit 85579a8 into master Mar 28, 2026
6 checks passed
@nyo16 nyo16 deleted the harden-lib-v0.3.0 branch March 28, 2026 22:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant