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

lint(track_config): check hello-world status #436

Merged
merged 7 commits into from
Oct 7, 2021

Conversation

bobtfish
Copy link
Contributor

@bobtfish bobtfish commented Oct 5, 2021

The "exercises.practice[].status" value must, if "exercises.practice[].slug" is equal to hello-world, be either omitted or the string active

Refs: #249

Copy link
Member

@ErikSchierboom ErikSchierboom left a comment

Choose a reason for hiding this comment

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

Lovely! I'll let @ee7 review the Nim code.

src/lint/track_config.nim Outdated Show resolved Hide resolved
The "exercises.practice[].status" value must, if "exercises.practice[].slug" is equal to hello-world, be either omitted or the string active

Refs: exercism#249
With the previous wording of:

    the value must be [...] `active` or absent

the "value is absent" might be understood as "the value is the empty
string".

This commit tries to clarify, but the wording is a bit clunky. It
doesn't matter much either way, since this error message will probably
be rarely seen.
@ee7
Copy link
Member

ee7 commented Oct 7, 2021

Thanks for working on this.

I took the liberty of pushing a few nitpick commits - see the commit messages.

Happy for me to merge this, @ErikSchierboom?

I probably would've added this in second pass (to avoid pain with working on the JsonNode for checks that depend on the values of multiple keys), but this is fine too.

@ErikSchierboom
Copy link
Member

I probably would've added this in second pass (to avoid pain with working on the JsonNode for checks that depend on the values of multiple keys), but this is fine too.

I agree. Maybe we can move the functionality there later?

I'm happy to merge this if you are (I'll leave the honor to you).

@ee7
Copy link
Member

ee7 commented Oct 7, 2021

This PR causes the following diff to the output of configlet lint, per track:

common-lisp

+The hello-world Practice Exercise has a `status` of `beta`, but for that exercise, either the value must be `active` or the key/value pair must be omitted (which implies `active`):
+./config.json
+
+Configlet detected at least one problem.
+For more information on resolving the problems, please see the documentation:
+https://github.com/exercism/docs/blob/main/building/configlet/lint.md

red

+The hello-world Practice Exercise has a `status` of `beta`, but for that exercise, either the value must be `active` or the key/value pair must be omitted (which implies `active`):
+./config.json
+
+Configlet detected at least one problem.
+For more information on resolving the problems, please see the documentation:
+https://github.com/exercism/docs/blob/main/building/configlet/lint.md

@ErikSchierboom
Copy link
Member

Nice.

@ee7 ee7 changed the title Add validation rule lint(track_config): check hello-world status Oct 7, 2021
@ee7 ee7 merged commit ea478ef into exercism:main Oct 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants