-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: simplify json format/validation action #372
Conversation
4ba22dd
to
2c0e405
Compare
f776ed2
to
e7eed13
Compare
e7eed13
to
1bfd7bd
Compare
no_errors_found=false | ||
has_errors=true | ||
fi | ||
done | ||
|
||
if [ "$no_errors_found" = true ]; then | ||
echo "[success] All JSON files are valid" | ||
else | ||
if [ "$has_errors" = true ]; then | ||
exit 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe just exit 1
right away instead of assigning to a variable and then reading afterwards?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we could! if the user had 3 malformed files then they'd only see one at a time.
this felt more "ergonomic" to show all the files so potentially it (just lint
) could be fixed without having to run it multiple times.
open to either approach!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'm for showing all the files that fail lint at once
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah nice, that's better!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice, so each CI run should execute linting and if it fails then PRs can't be merged until the developer runs just format
and commits the changes
Simplified the GitHub Actions workflow in PR #364 😅. This update also fixes an issue where
just
was missing in thehermit
setup, which the previous workflow didn’t catch.Since
just format
inherently includesjust lint
, we can just consolidate that into a single action.This change removes much of the automation introduced in the earlier PR, placing the responsibility on the author to ensure well-formed JSON is committed to the repository. The original intent was to automate formatting when directly modifying JSON files via the GitHub web interface (bypassing the
pre-commit
hook). However, after reconsideration, this is likely not the most common workflow and might not be something we should encourage anyway.Note: We still only check
hosted/*.json
which are the only assets published to tbdex.dev.