Northeastern-Electric-Racing / Northeastern-Electric-Racing/Calypso

[CANGEN] - Add filename to JSON check error messages

Open
#87 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

good first issue
Dominant language
Rust
Stars
2
Forks
2
Avg merge
6d 20h
Merged PRs (30d)
3

Description

Description

Right now, on build, Calypso validates the JSON files in Embedded-Base/cangen/can-messages/ are up to spec. If they aren't, the build fails with a message describing what was wrong with the JSON. However, this message doesn't include the name of the file, meaning fixing errors can require some grepping. File names would be a nice touch to the CAN spec dev experience

Acceptance Criteria

CAN spec build errors include the name of the file that causes the error

Proposed Solution

Probably get the file name as __entry from the validate_all_spec() function in libs/calypso-cangen/src/validate.rs, and somehow propagate that to the individual error messages (see the thiserror enum at the top of that same file)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in libs/calypso-cangen/src/validate.rs, reading validate_all_spec() and the thiserror enum at the top of the file. Trace how each validation error is produced and ensure CAN spec build errors identify the file that caused them; completion is confirmed when the acceptance criterion is met for invalid JSON files in Embedded-Base/cangen/can-messages/.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
build-system, embedded-iot
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.