Skip to content
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

(chore) catch invalid json #26

Merged
merged 2 commits into from
Jun 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/configlet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@ jobs:

- name: Configlet Linter
run: configlet lint

- name: Ensure valid JSON
run: jq '.' config.json
Comment on lines +20 to +21
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is actually a very nice idea. @ee7 @SaschaMann do we want to add this to the central configlet workflow to catch exercism/configlet#312?

Copy link
Member

@ee7 ee7 Jun 2, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great idea. Why didn't we think of this before? It's a good stop-gap measure until we have stricter parsing in configlet lint.

Created a draft PR here: exercism/github-actions#21

Maybe we can make this look obvious in the workflow log, rather than needing to do a mass PR to each track's configlet.yml.

Edit: The main downside is that people will only see that their JSON is invalid in CI, and not when running configlet lint locally. But I've just realised that we can just make configlet lint run jq when it's detected on the system (and/or when we're running in CI). Let's do that instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But I've just realised that we can just make configlet lint run jq when it's detected on the system (and/or when we're running in CI). Let's do that instead.

Now we're thinking! :-) It could even recommend you install it...

2 changes: 1 addition & 1 deletion config.json
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@
"difficulty": 1,
"topics": [
"numbers",
"loops",
"loops"
]
},
{
Expand Down