-
-
Notifications
You must be signed in to change notification settings - Fork 14
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 key_features
#236
Conversation
It is the number of runes.
We should |
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.
LGTM
This commit implements the below rules for a track's `config.json` file. - The `"key_features"` key is optional - The `"key_features"` value must be an array with length = 6 - The `"key_features[].title"` key is required - The `"key_features[].title"` value must be a non-empty, non-blank string with length <= 25 - The `"key_features[].content"` key is required - The `"key_features[].content"` value must be a non-empty, non-blank string with length <= 100 These rules are currently disabled until we have a list of valid icons: - The `"key_features[].icon"` key is required - The `"key_features[].icon"` value must be a string that matches one of the pre-defined icon values See the spec: - https://github.com/exercism/docs/blob/main/building/configlet/lint.md#rule-configjson-file-is-valid
323ebee
to
c9acd22
Compare
Current diff due to this PR: luaIdeally the below should say +The value of `content` that starts with `Lua is primarily designed...` is 167 characters, but must not exceed 100 characters:
+./config.json
+
+The value of `content` that starts with `Lua is known to be one of...` is 149 characters, but must not exceed 100 characters:
+./config.json
+
+The value of `content` that starts with `Lua has a simple, yet pow...` is 112 characters, but must not exceed 100 characters:
+./config.json
+
+The value of `content` that starts with `Lua offers a small, yet f...` is 133 characters, but must not exceed 100 characters:
+./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 Non-blocking for this PR, but somewhat relevant: currently, we do not allow an optional string to be the empty string. Is that correct? We only allow it to be missing or The current code is below. At the bottom, we have configlet/src/lint/validators.nim Lines 42 to 51 in f9aacb6
|
Hmmm. For now, I'd leave it like that. I do find that an empty string is something else than omitting a value or using null. We might revisit later, but for now this is good I think. |
This commit implements the below rules for a track's root
config.json
file.
"key_features"
key is optional"key_features"
value must be an array with length = 6"key_features[].title"
key is required"key_features[].title"
value must be a non-empty, non-blankstring with length <= 25
"key_features[].content"
key is required"key_features[].content"
value must be a non-empty, non-blankstring with length <= 100
These rules are currently disabled until we have a list of valid icons:
"key_features[].icon"
key is required"key_features[].icon"
value must be a string that matches one ofthe pre-defined icon values
See the spec:
Questions for @ErikSchierboom:
len
of 102 (it contains–
, which is 3 bytes). Should we be checking for length or rune length?icon
errors for now?This PR produces the following diff to the output of
configlet lint
, per track:common-lisp
julia
lua
php
python
rust