ci: activate and use CI pipeline in GitHub#5
Merged
kentaro merged 11 commits intokentaro:mainfrom Jan 28, 2026
Merged
Conversation
The expression `[:__struct__] -- except` evaluates to `[:__struct__]`
(since except typically doesn't contain `:__struct__)`, so the final
result is `Map.keys(struct) -- [:__struct__]` — the except fields are
never removed.
This especially happens when deriving from Ecto schemas and ignoring the
`__meta__` like this:
`@derive {Toon.Encoder, except: [:__meta__]}`
This solves it by removing the parentheses. The PR adds necessary tests
to make sure this is fixed.
fix: remove parantheses to make except work
Previously, structs would fall through to the map clause in normalize/1, which attempted to enumerate them and failed with "Enumerable not implemented". This fix adds a struct clause before the map clause that dispatches to the Toon.Encoder protocol, mirroring how Jason handles struct encoding. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
fix: dispatch to Toon.Encoder protocol for structs in normalize/1
Prevents double-escaping of nested structs by having derived encoders return maps instead of TOON strings. The actual TOON encoding now happens once at the top level. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add @moduledoc false to test fixture modules - Fix alias ordering in nested_struct_test.exs - Update @SPEC to allow map() return from derived encoders Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
fix(encoder): return normalized maps from derived encoders
- Add OTP 28 to test matrix with exclusions for Elixir < 1.18 - Replace separate format/credo steps with mix quality.ci - Add PLT caching for faster dialyzer runs Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove dead code patterns that could never match: - detect_root_type([]) in structural_parser.ex - append_lines(writer, [], _depth) in objects.ex - Define precise types to fix supertype warnings: - Add @type decoded in decode.ex - Add @type validated in options.ex - Use nonempty_list() in arrays.ex and strings.ex specs - Fix protocol fallback no_return warning: - Remove @SPEC from Toon.Encoder.Any encode/2 functions - Add .dialyzer_ignore.exs for intentional no_return behavior - Add edge case tests to verify behavior before dead code removal Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
xu-chris
commented
Jan 20, 2026
README.md
Outdated
|
|
||
| [](https://hex.pm/packages/toon) | ||
| [](https://hexdocs.pm/toon) | ||
| [](https://coveralls.io/github/xu-chris/toon_ex?branch=main) |
Contributor
Author
There was a problem hiding this comment.
@kentaro This needs probably a change by you to use the correct handle for the Coverage status. :)
Pull Request Test Coverage Report for Build 4b742b545266a13fabb5b8a37a01459115669285-PR-5Details
💛 - Coveralls |
Owner
|
Thank you!! |
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.
Currently when opening a PR or merging one, neither
qualitynorquality.cidoes run. The whole CI workflow seems to be not activated. One reason potentially could be open and hard to solve Dialyzer issues.This PR solves it by:
quality.ciconsistently to the CIqualityjobI still continue working on more fixes, so this is building upon #3 and #4 and should be merged after these therefore.