You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: building/configlet/README.md
+7-1
Original file line number
Diff line number
Diff line change
@@ -51,7 +51,13 @@ How to generate UUIDs can be found [here](/docs/building/configlet/uuid).
51
51
## Formatting
52
52
53
53
Configlet has a `fmt` command to help with consistent formatting of the JSON files in the track repo.
54
-
The `fmt` command currently only operates on the exercise `.meta/config.json` files but it is likely to operate on all the track JSON files in the future.
Copy file name to clipboardexpand all lines: building/configlet/format.md
+6-3
Original file line number
Diff line number
Diff line change
@@ -3,14 +3,17 @@
3
3
An Exercism track repo has many JSON files, including:
4
4
5
5
- The track `config.json` file.
6
-
7
6
- For each concept, a `.meta/config.json` and `links.json` file.
8
-
9
7
- For each Concept Exercise or Practice Exercise, a `.meta/config.json` file.
10
8
11
9
These files are more readable if they have a consistent formatting Exercism-wide, and so configlet has a `fmt` command for rewriting a track's JSON files in a canonical form.
12
10
13
-
The `fmt` command currently operates on the exercise `.meta/config.json` files and the track `config.json` file, but it is likely to operate on all the track JSON files in the future.
Copy file name to clipboardexpand all lines: building/tracks/ci/workflows.md
+6-2
Original file line number
Diff line number
Diff line change
@@ -15,15 +15,19 @@ For information on workflows, check the following docs:
15
15
## Shared workflows
16
16
17
17
Some workflows are shared across repositories.
18
-
These workflows _should not be changed_.
18
+
19
+
```exercism/caution
20
+
The shared workflows are automatically synced (from the [org-wide-files repo](https://github.com/exercism/org-wide-files/)).
21
+
You should thus not manually change their contents.
22
+
```
19
23
20
24
### General workflows
21
25
22
26
-`sync-labels.yml`: automatically syncs the repository's labels from a `labels.yml` file
23
27
24
28
### Track-specific workflows
25
29
26
-
-`configlet.yml`: runs the [configlet tool](/docs/building/configlet), which checks if a track's (configuration) files are properly structured - both syntactically and semantically
30
+
-[`configlet.yml`](/docs/building/tracks/ci/workflows/configlet): runs the [configlet tool](/docs/building/configlet), which checks if a track's (configuration) files are properly structured - both syntactically and semantically
27
31
-`no-important-files-changed.yml`: checks if pull requests would cause all existing solutions of one or more changes exercises to be re-run
The `configlet` workflow is defined in the `.github/workflows/configlet.yml` file.
4
+
It uses the [configlet tool](/docs/building/configlet) to check if a track's (configuration) files are properly structured - both syntactically and semantically.
5
+
It does this by running [`configlet lint`](/docs/building/configlet/lint).
6
+
7
+
## Enable checking file formatting
8
+
9
+
Tracks can use [`configlet fmt`](/docs/building/configlet/format) to format the track's various configuration files.
10
+
The same command can also be used to check if all configuration files are formatted correctly.
11
+
12
+
The `configlet` workflow supports verifying whether the configuration files are formatted correctly, but this is optional and disabled by default.
13
+
To opt-into verifying configuration files' formatting, follow these steps:
14
+
15
+
1. Create a `.github/org-wide-files-config.toml` file with the following contents
16
+
17
+
```toml
18
+
[configlet]
19
+
fmt = true
20
+
```
21
+
22
+
2. After this file is merged into `main`, a PR will automatically be opened that modifies the `configlet.yml` workflow as follows:
Copy file name to clipboardexpand all lines: building/tracks/new/add-first-exercise.md
+30
Original file line number
Diff line number
Diff line change
@@ -113,5 +113,35 @@ Tip: just can copy-paste-modify the example solution.
113
113
Once you're done with the exercise, please add your your GitHub username to the `"authors"` array in the exercise's `.meta/config.json` file.
114
114
This will ensure we correctly credit you with having created the exercise.
115
115
116
+
### Linting
117
+
118
+
To verify that the exercise is setup correctly, you can use the [configlet tool](/docs/building/configlet)'s built-in linting functionality.
119
+
120
+
The first step is to fetch the `configlet` tool, for which we've created two scripts:
121
+
122
+
-`bin/fetch-configlet`: run this when using \*nix or macOS
123
+
-`bin/fetch-configlet.ps1`: run this when using Windows
124
+
125
+
Running one of these scripts from the root directory of the track's repo will download the `bin/configlet` respectively `bin/configlet.exe` binary.
126
+
127
+
You can then check the exercise for correctness by running [`bin/configlet lint`](/docs/building/configlet/lint).
128
+
129
+
````exercism/note
130
+
It is likely that `configlet` will report the following error:
131
+
```shell
132
+
The `tags` array is empty:
133
+
/path/to/track/config.json
134
+
```
135
+
136
+
This error will be fixed in the [Prepare for launch](/docs/building/tracks/new/prepare-for-launch#h-update-metadata) step, so either:
137
+
138
+
- ignore the error (for now), or
139
+
- fix the error by adding tags
140
+
````
141
+
142
+
```exercism/note
143
+
The [`configlet` workflow](/docs/building/tracks/ci/workflows/configlet) will automatically runs `configlet lint` whenever something is pushed to `main` or to a pull request.
GitHub Actions are based on _workflows_, which define scripts to run automatically whenever a specific event occurs (e.g. pushing a commit).
9
9
For more information on GitHub Actions workflows, check the [workflows docs](/docs/building/tracks/ci/workflows).
10
10
11
+
## Pre-installed workflows
12
+
13
+
Tracks come pre-installed with a number of workflows, most of which you should _not_ modify (they're called _shared workflows_).
14
+
There is one workflow that you _should_ change though, which is the `test.yml` workflow.
15
+
11
16
## Test workflow
12
17
13
-
Each track comes with a `test.yml` workflow.
14
-
The goal of this workflow is to verify that the track's exercises are in proper shape.
18
+
The goal of the `test.yml` workflow is to verify that the track's exercises are in proper shape.
15
19
The workflow is setup to run automatically (in GitHub Actions terminology: is _triggered_) when a push is made to the `main` branch or to a pull request's branch.
16
20
17
21
The workflow itself should not do much, except for:
0 commit comments