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: README.md
+17-17Lines changed: 17 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -52,7 +52,7 @@ Individual solutions live in the `./src/bin/` directory as separate binaries. _I
52
52
Every [solution](https://github.com/fspoettel/advent-of-code-rust/blob/main/src/template.txt) has _tests_ referencing its _example_ file in `./data/examples`. Use these tests to develop and debug your solutions against the example input. In VS Code, `rust-analyzer` will display buttons for running / debugging these unit tests above the unit test blocks.
53
53
54
54
> [!TIP]
55
-
> If a day has different example inputs for both parts, you can use the `read_file_part()` helper in your tests instead of `read_file()`. For example, if this applies to day 1, you can create a second example file `01-2.txt` and invoke the helper like `let result = part_two(&advent_of_code::template::read_file_part("examples", DAY, 2));` to read it in `test_part_two`.
55
+
> If a day has multiple example inputs, you can use the `read_file_part()` helper in your tests instead of `read_file()`. If this e.g. applies to day 1, you can create a second example file `01-2.txt` and invoke the helper like `let result = part_two(&advent_of_code::template::read_file_part("examples", DAY, 2));`. This supports an arbitrary number of example files.
56
56
57
57
### ➡️ Download input for a day
58
58
@@ -98,7 +98,7 @@ For example, running a benchmarked, optimized execution of day 1 would look like
98
98
> [!IMPORTANT]
99
99
> This requires [installing the aoc-cli crate](#configure-aoc-cli-integration).
100
100
101
-
In order to submit part of a solution for checking, append the `--submit <part>` option to the `solve` command.
101
+
Append the `--submit <part>` option to the `solve` command to submit your solution for checking.
102
102
103
103
### ➡️ Run all solutions
104
104
@@ -120,7 +120,7 @@ This runs all solutions sequentially and prints output to the command-line. Same
120
120
121
121
### ➡️ Update readme benchmarks
122
122
123
-
The template can write benchmark times to the README via the `cargo time` command.
123
+
The template can write benchmark times to the readme via the `cargo time` command.
124
124
125
125
By default, this command checks for missing benchmarks, runs those solutions, and then updates the table. If you want to (re-)time all solutions, run `cargo time --all`. If you want to (re-)time one specific solution, run `cargo time <day>`.
126
126
@@ -134,18 +134,6 @@ cargo test
134
134
135
135
To run tests for a specific day, append `--bin <day>`, e.g. `cargo test --bin 01`. You can further scope it down to a specific part, e.g. `cargo test --bin 01 part_one`.
136
136
137
-
### ➡️ Format code
138
-
139
-
```sh
140
-
cargo fmt
141
-
```
142
-
143
-
### ➡️ Lint code
144
-
145
-
```sh
146
-
cargo clippy
147
-
```
148
-
149
137
### ➡️ Read puzzle description
150
138
151
139
> [!IMPORTANT]
@@ -196,12 +184,24 @@ cargo today
196
184
# ...the input...
197
185
```
198
186
187
+
### ➡️ Format code
188
+
189
+
```sh
190
+
cargo fmt
191
+
```
192
+
193
+
### ➡️ Lint code
194
+
195
+
```sh
196
+
cargo clippy
197
+
```
198
+
199
199
## Optional template features
200
200
201
201
### Configure aoc-cli integration
202
202
203
203
1. Install [`aoc-cli`](https://github.com/scarvalhojr/aoc-cli/) via cargo: `cargo install aoc-cli --version 0.12.0`
204
-
2. Create an `.adventofcode.session`file in your home directory and paste your session cookie. To retrieve the session cookie, press F12 anywhere on the Advent of Code website to open your browser developer tools. Look in _Cookies_ under the _Application_ or _Storage_ tab, and copy out the `session` cookie value. [^1]
204
+
2. Create the file `<home_directory>/.adventofcode.session` and paste your session cookie into it. To retrieve the session cookie, press F12 anywhere on the Advent of Code website to open your browser developer tools. Look in _Cookies_ under the _Application_ or _Storage_ tab, and copy out the `session` cookie value. [^1]
205
205
206
206
Once installed, you can use the [download command](#download-input--description-for-a-day), the read command, and automatically submit solutions via the [`--submit` flag](#submitting-solutions).
207
207
@@ -229,7 +229,7 @@ Go to the _Variables_ tab in your repository settings and create the following v
229
229
230
230
✨ You can now run this action manually via the _Run workflow_ button on the workflow page. If you want the workflow to run automatically, uncomment the `schedule` section in the `readme-stars.yml` workflow file or add a `push` trigger.
231
231
232
-
### Check code formatting / clippy lints in CI
232
+
### Enable code formatting / clippy checks in the CI
233
233
234
234
Uncomment the respective sections in the `ci.yml` workflow.
0 commit comments