Harden library: CI/CD, type specs, Elixir 1.18, JSON stdlib#1
Merged
Conversation
- 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
nous: compile (warnings-as-errors), format, credo (--strict), test, dialyzer, hex publish on version tagsJasonusage with Elixir 1.18 stdlibJSONmodule@spec/@typeannotations to all ~99 public functions across 22 modules, passingmix dialyzerwith 0 warningsget/2,update/3,stream/2to Sensors, Lights, Chimes, LiveviewsUnifiApi.StreamErrorexception replaces bareRuntimeError, also handles non-list API responsesTest plan
mix compile --warnings-as-errors— cleanmix format --check-formatted— cleanmix credo --strict— 0 issuesmix test— 133 tests, 0 failuresmix dialyzer— 0 errors