-
-
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: check files
key in track-level config
#435
Commits on Oct 5, 2021
-
Configuration menu - View commit details
-
Copy full SHA for 9f50c4d - Browse repository at this point
Copy the full SHA 9f50c4dView commit details
Commits on Oct 6, 2021
-
Configuration menu - View commit details
-
Copy full SHA for dc240cc - Browse repository at this point
Copy the full SHA dc240ccView commit details -
Configuration menu - View commit details
-
Copy full SHA for 2e82742 - Browse repository at this point
Copy the full SHA 2e82742View commit details -
Configuration menu - View commit details
-
Copy full SHA for 82ac0da - Browse repository at this point
Copy the full SHA 82ac0daView commit details
Commits on Oct 7, 2021
-
tests(lint): prefer a
check
blockThis is more consistent with the test layout in the `isFilesPattern` suite, and elsewhere in this file.
Configuration menu - View commit details
-
Copy full SHA for 48e99ce - Browse repository at this point
Copy the full SHA 48e99ceView commit details -
tests(lint): prefer method call syntax for
len
Personal taste, but this makes it easier to see that the pattern is identical in each pair of lines, and we've tended to use `.len` elsewhere.
Configuration menu - View commit details
-
Copy full SHA for 4085ca0 - Browse repository at this point
Copy the full SHA 4085ca0View commit details -
Configuration menu - View commit details
-
Copy full SHA for fe82c4f - Browse repository at this point
Copy the full SHA fe82c4fView commit details -
tests(lint): bikeshed test name
Before: no placeholder with placeholder multiple placeholders After: no placeholder one placeholder multiple placeholders
Configuration menu - View commit details
-
Copy full SHA for a12bf22 - Browse repository at this point
Copy the full SHA a12bf22View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8a89d84 - Browse repository at this point
Copy the full SHA 8a89d84View commit details -
Configuration menu - View commit details
-
Copy full SHA for c793924 - Browse repository at this point
Copy the full SHA c793924View commit details -
lint(validators): fix IndexDefect
Previously, an IndexDefect was raised for an input string that ends with the % character.
Configuration menu - View commit details
-
Copy full SHA for 8432a61 - Browse repository at this point
Copy the full SHA 8432a61View commit details -
lint(validators): group the mutable globals
Let's put both these variables close to the `isString` proc that uses them.
Configuration menu - View commit details
-
Copy full SHA for 94400e2 - Browse repository at this point
Copy the full SHA 94400e2View commit details -
Configuration menu - View commit details
-
Copy full SHA for fbf5faf - Browse repository at this point
Copy the full SHA fbf5fafView commit details -
Configuration menu - View commit details
-
Copy full SHA for 61f6692 - Browse repository at this point
Copy the full SHA 61f6692View commit details -
lint(validators): prefer
notin
I think this reads more naturally, and we've tended to use this style elsewhere.
Configuration menu - View commit details
-
Copy full SHA for e5385eb - Browse repository at this point
Copy the full SHA e5385ebView commit details -
lint(validators): move global into proc
This makes it obvious that `filesPatterns` isn't used elsewhere.
Configuration menu - View commit details
-
Copy full SHA for 5041aaa - Browse repository at this point
Copy the full SHA 5041aaaView commit details -
lint(validators): s/placeholder/ph
This makes the name of this variable more consistent with the code in `isFilesPattern`: for ph in extractPlaceholders(s): if ph notin filesPatterns: result = false
Configuration menu - View commit details
-
Copy full SHA for 59317b5 - Browse repository at this point
Copy the full SHA 59317b5View commit details -
lint(validators): optimize
extractPlaceholders
The Nim compiler doesn't optimize the previous pattern. The recommended ways to write it are these: foo.add bar foo &= bar
Configuration menu - View commit details
-
Copy full SHA for 0273683 - Browse repository at this point
Copy the full SHA 0273683View commit details -
This makes it obvious that we don't mutate `c`.
Configuration menu - View commit details
-
Copy full SHA for 41d31f2 - Browse repository at this point
Copy the full SHA 41d31f2View commit details -
lint(validators): rename parameter
This is more consistent with the name of the parameter in `isFilesPattern`, and our code elsewhere.
Configuration menu - View commit details
-
Copy full SHA for 817f67a - Browse repository at this point
Copy the full SHA 817f67aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 8a80087 - Browse repository at this point
Copy the full SHA 8a80087View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3ffce9e - Browse repository at this point
Copy the full SHA 3ffce9eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 51dcf9b - Browse repository at this point
Copy the full SHA 51dcf9bView commit details
Commits on Oct 8, 2021
-
lint(validators): make iterator private
This was used neither in the configlet codebase, nor the tests.
Configuration menu - View commit details
-
Copy full SHA for 9975b0f - Browse repository at this point
Copy the full SHA 9975b0fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 0435e44 - Browse repository at this point
Copy the full SHA 0435e44View commit details -
lint(track_config): tweak indentation style
I don't have a strong preference for this indentation style, but it's what we've used elsewhere.
Configuration menu - View commit details
-
Copy full SHA for e9c1d44 - Browse repository at this point
Copy the full SHA e9c1d44View commit details -
lint(track_config): tweak
hasObject
useIt was a little confusing that passing `isRequired = false` to `hasObject` did nothing, because we checked `hasKey` twice. But the problem is that the existing `hasX` design is a bit of a mess, or at least the proc names. I don't love that a proc named `hasObject` returns true when `isRequired = false` is passed. Let's just do it this way for now - I found it little clearer. Eventually, all this `hasX` code might be refactored.
Configuration menu - View commit details
-
Copy full SHA for 6df6fe6 - Browse repository at this point
Copy the full SHA 6df6fe6View commit details -
Configuration menu - View commit details
-
Copy full SHA for f3b544c - Browse repository at this point
Copy the full SHA f3b544cView commit details -
move testing-only extractPlaceholders procedure
This makes it more obvious that this func was only used during the tests. After the Nim 1.6 release we'll be able to test procs in other modules without exporting them.
Configuration menu - View commit details
-
Copy full SHA for 9ea0422 - Browse repository at this point
Copy the full SHA 9ea0422View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8ffd252 - Browse repository at this point
Copy the full SHA 8ffd252View commit details -
This test case used 3 placeholder characters, not 2.
Configuration menu - View commit details
-
Copy full SHA for c889846 - Browse repository at this point
Copy the full SHA c889846View commit details -
Configuration menu - View commit details
-
Copy full SHA for d7b61d3 - Browse repository at this point
Copy the full SHA d7b61d3View commit details
Commits on Oct 12, 2021
-
Revert "lint(track_config): tweak
hasObject
use"This reverts commit 6df6fe6. Oops. It does need to be like this. Otherwise, when the optional `files` key is missing, `configlet lint` incorrectly prints this: The `files` key is missing: ./config.json
Configuration menu - View commit details
-
Copy full SHA for 8b6e9cc - Browse repository at this point
Copy the full SHA 8b6e9ccView commit details -
lint(validators): add warning for possible bad placeholder usage
This is a very basic check, but at least it catches something like %{snake_slug.foo Currently, there is only one track with multiple placeholders.
Configuration menu - View commit details
-
Copy full SHA for 60e26ad - Browse repository at this point
Copy the full SHA 60e26adView commit details -
tests(lint): check multiple uses of same placeholder
And the (unlikely) use of 3 placeholders.
Configuration menu - View commit details
-
Copy full SHA for b5f8033 - Browse repository at this point
Copy the full SHA b5f8033View commit details -
lint(validators): remove final
.
from error msgWe omitted these elsewhere.
Configuration menu - View commit details
-
Copy full SHA for a1e8efd - Browse repository at this point
Copy the full SHA a1e8efdView commit details -
Configuration menu - View commit details
-
Copy full SHA for fe72242 - Browse repository at this point
Copy the full SHA fe72242View commit details -
lint(validators): specify valid placeholders only once
Note that the string is still set at compile-time. The func is a bit long - oh well.
Configuration menu - View commit details
-
Copy full SHA for 24a42ba - Browse repository at this point
Copy the full SHA 24a42baView commit details -
lint(validators): return false quicker
This better communicates that `extractPlaceholders` isn't printing error messages, so we don't need to iterate over every placeholder.
Configuration menu - View commit details
-
Copy full SHA for 60267c4 - Browse repository at this point
Copy the full SHA 60267c4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 99ae34d - Browse repository at this point
Copy the full SHA 99ae34dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7d7cabd - Browse repository at this point
Copy the full SHA 7d7cabdView commit details
Commits on Oct 13, 2021
-
lint(validators): use "patterns" and "placeholders" consistently
This makes the code use the terminology from the docs: 4. Valid `files` pattern: A non-blank string¹ that specifies a location of a file used in an exercise, relative to the exercise's directory. A pattern may use one of the following placeholders: - `%{kebab_slug}`: the `kebab-case` exercise slug (e.g. `bit-manipulation`) - `%{snake_slug}`: the `snake_case` exercise slug (e.g. `bit_manipulation`) - `%{camel_slug}`: the `camelCase` exercise slug (e.g. `bitManipulation`) - `%{pascal_slug}`: the `PascalCase` exercise slug (e.g. `BitManipulation`)
Configuration menu - View commit details
-
Copy full SHA for faffd0f - Browse repository at this point
Copy the full SHA faffd0fView commit details -
lint(validators): nitpick "files pattern"
"valid files pattern" sounds like it could be missing a possessive apostrophe. Let's refer to a single string as either a `files` pattern or a file pattern The latter reads better here, since the key name is already mentioned.
Configuration menu - View commit details
-
Copy full SHA for 9febbcd - Browse repository at this point
Copy the full SHA 9febbcdView commit details -
tests(lint): test multiple placeholders that are different
This is allowed, but unlikely.
Configuration menu - View commit details
-
Copy full SHA for 01a0c18 - Browse repository at this point
Copy the full SHA 01a0c18View commit details