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

Document tags field #468

Merged
merged 9 commits into from
Oct 6, 2023
Merged
Show file tree
Hide file tree
Changes from 7 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
7 changes: 7 additions & 0 deletions building/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -717,6 +717,13 @@
"title": "The Analyzer Interface",
"blurb": ""
},
{
"uuid": "4dec2835-6dc0-493b-81aa-d93cf1d6036c",
"slug": "tooling/analyzers/tags",
"path": "building/tooling/analyzers/tags.md",
"title": "Tagging solutions",
"blurb": ""
},
{
"uuid": "fd89f1aa-e73b-46f0-9759-da5cc9969069",
"slug": "tooling/representers",
Expand Down
36 changes: 36 additions & 0 deletions building/configlet/lint.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,19 @@ The `config.json` file should have the following checks:
- The `"concepts[].slug"` value must be a kebab-case string² with length <= 255
- The `"concepts[].name"` key is required
- The `"concepts[].name"` value must be a Title Case string³ with length <= 255
- The `"concepts[].tags"` key is optional
- The `"concepts[].tags.all"` key is optional, unless `"concepts[].tags.any"` is empty
- The `"concepts[].tags.all"` value must be an array
- The `"concepts[].tags.all"` values must be non-blank tag⁷ strings with length <= 255
- The `"concepts[].tags.all"` values must not have duplicates
- The `"concepts[].tags.any"` key is optional, unless `"concepts[].tags.all"` is empty
- The `"concepts[].tags.any"` value must be an array
- The `"concepts[].tags.any"` values must be non-blank tag⁷ strings with length <= 255
- The `"concepts[].tags.any"` values must not have duplicates
- The `"concepts[].tags.not"` key is optional
- The `"concepts[].tags.not"` value must be an array
- The `"concepts[].tags.not"` values must be non-blank tag⁷ strings with length <= 255
- The `"concepts[].tags.not"` values must not have duplicates
- Each `"concepts"` value must have a `concept/<concepts.slug>/about.md` file. Linting rules for this file are specified below.
- Each `"concepts"` value must have a `concept/<concepts.slug>/introduction.md` file. Linting rules for this file are specified below.
- Each `"concepts"` value must have a `concept/<concepts.slug>/links.json` file. Linting rules for this file are specified below.
Expand Down Expand Up @@ -372,6 +385,19 @@ The `config.json` file should have the following checks:
- The `"approaches[].contributors"` values must not have duplicates
- The `"approaches[].contributors"` values are treated case-insensitively
- Users can only be listed in either the `"approaches[].authors"` or `"approaches[].contributors"` array (no overlap)
- The `"approaches[].tags"` key is optional
- The `"approaches[].tags.all"` key is optional, unless `"approaches[].tags.any"` is empty
- The `"approaches[].tags.all"` value must be an array
- The `"approaches[].tags.all"` values must be non-blank tag⁷ strings with length <= 255
- The `"approaches[].tags.all"` values must not have duplicates
- The `"approaches[].tags.any"` key is optional, unless `"approaches[].tags.all"` is empty
- The `"approaches[].tags.any"` value must be an array
- The `"approaches[].tags.any"` values must be non-blank tag⁷ strings with length <= 255
- The `"approaches[].tags.any"` values must not have duplicates
- The `"approaches[].tags.not"` key is optional
- The `"approaches[].tags.not"` value must be an array
- The `"approaches[].tags.not"` values must be non-blank tag⁷ strings with length <= 255
- The `"approaches[].tags.not"` values must not have duplicates

### Rule: exercises/{concept|practice}/&lt;slug&gt;/.approaches/&lt;approach-slug&gt;/content.md is valid

Expand Down Expand Up @@ -564,3 +590,13 @@ The `config.json` file should have the following checks:
```

You can run `configlet uuid` to generate a suitable UUID.

7. **Valid analyzer `tag`**: A non-blank string¹ that is formatted as `<category>:<thing>`.
The `<category>` value must be one of:

- `paradigm` (e.g. `paradigm:functional`)
- `technique` (e.g. `technique:recursion`)
- `construct` (e.g. `construct:bitwise-and`)
- `uses` (e.g. `uses:DateTime.add_seconds`)

The `<thing>` value must a string that contains only characters in the range `[a-z0-9]`, optionally separated by dashes (e.g. `"two-fer"`) or underscores (e.g. `"two_fer"`). It must match the regular expression: `^[a-z0-9]+([-_][a-z0-9]+)*$`
Copy link
Member

@ee7 ee7 Oct 6, 2023

Choose a reason for hiding this comment

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

Maybe "by a single dash" and "or by a single underscore"?

And the above example of DateTime.add_seconds does not match that regular expression - there is a ., and a capital letter.

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmmm, let's just make it non-blank, as tracks are free to use them how they please

1 change: 1 addition & 0 deletions building/tooling/analyzers/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ You can use the following documents to learn more about building an analyzer:
- [The Analyzer interface.](/docs/building/tooling/analyzers/interface)
- [How to build a Docker image with Docker for local testing and deployment](/docs/building/tooling/analyzers/docker)
- [Writing Analyzer comments](/docs/building/tooling/analyzers/comments)
- [Tagging solutions](/docs/building/tooling/analyzers/tags)
23 changes: 23 additions & 0 deletions building/tooling/analyzers/interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ The `analysis.json` file should be structured as followed:
"comment": "ruby.general.some_unparameterised_message"
},
"ruby.general.some_unparameterised_message"
],
"tags": [
"construct:list",
"paradigm:functional",
"technique:higher-order-functions",
"uses:List.unfold"
]
}
```
Expand Down Expand Up @@ -79,6 +85,22 @@ Comments without a type field default to `informative `.
Currently in the website, we soft-block on `essential` comments, encourage students to complete `actionable` comments before marking as complete on Practice Exercises (but not Concept Exercises), but don't suggest any action on `informative` or `celebratory`.
However, in the future we may choose to add emojis or indicators to other types, or group them separately.

### `tags` (optional)

The `tags` field is an array of strings.
Each tag is formatted as: `"<category>:<thing>"`.

Some examples being:

- `"paradigm:functional"`
- `"technique:recursion"`
- `"construct:bitwise-and"`
- `"uses:DateTime.add_seconds"`

Tags can be used to identify what constructs/techniques/paradigms a solution uses.

For more information, see [Tagging solutions][tagging-solutions].

## Debugging

The contents of `stdout` and `stderr` from each run will be persisted into files that can be viewed later.
Expand All @@ -87,3 +109,4 @@ You may write an `analysis.out` file that contains debugging information you wan

[website-copy-repo]: https://github.com/exercise/website-copy
[writing-analyzer-comments]: /docs/building/tooling/analyzers/comments
[tagging-solutions]: /docs/building/tooling/analyzers/tags
Loading
Loading