-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
48 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,21 @@ | ||
Automatic documentation | ||
=== | ||
# Automatic documentation | ||
|
||
|
||
The documentation in this repo was setup using this guide: | ||
https://redandgreen.co.uk/sphinx-to-github-pages-via-github-actions/ | ||
|
||
|
||
Key commands | ||
=== | ||
|
||
Setup from scratch: | ||
## Key commands | ||
|
||
`cd /docs` | ||
`sphinx-quickstart` | ||
* Setup from scratch: | ||
`cd /docs && sphinx-quickstart` | ||
|
||
Generate .rst's automatically (from root directory) | ||
* Generate .rst's automatically (from root directory) | ||
`sphinx-apidoc -o docs .` | ||
|
||
Manually generate html (already done in Github Action): | ||
* Manually generate html (already done in Github Action): | ||
`cd docs && make html` | ||
|
||
Clean html | ||
* Clean html | ||
|
||
`cd docs && make clean` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,40 @@ | ||
Automatic documentation | ||
=== | ||
# Continuous Integration | ||
|
||
The documentation in this repo was setup using this guide: | ||
https://redandgreen.co.uk/sphinx-to-github-pages-via-github-actions/ | ||
CI allows lots of processes to occur automatically | ||
|
||
Think of `pre-commit` as "local" and `github actions` as cloud. | ||
|
||
Key commands | ||
=== | ||
1. `pre-commit` is a tool that runs arbitrary scripts at `pre-commit` and `pre-push` time. You can reuse it's config for github-action based scripts, to ensure all ci scripts are run. | ||
|
||
Setup from scratch: | ||
2. `github actions` (see `.github/workflows`) are workflows that run "on the cloud" on github.com. They run based on a few conditions such as pushing/merging, PRs etc. They mainly just setup an linux box to install `pre-commit` and then duplicate what was being done on a local environment. They also publish our html documentation (such as this page) into the `gh-pages` branch. | ||
|
||
`cd /docs` | ||
`sphinx-quickstart` | ||
|
||
Generate .rst's automatically (from root directory) | ||
`sphinx-apidoc -o docs .` | ||
## Tools | ||
|
||
Manually generate html (already done in Github Action): | ||
`cd docs && make html` | ||
|
||
Clean html | ||
### Pre-commit | ||
|
||
`cd docs && make clean` | ||
`pre-commit` is both the name of a tool, and of a stage in committing. | ||
|
||
This section details what is done at the stages | ||
1. `pre-commit`: runs `ruff-linting` and `mypy` and `mixed-crlf`. These are all very fast and ensure commits have barebones checks before going in. | ||
|
||
2. `pre-push`: runs `pytest unit tests` as well as `coverage` | ||
|
||
### ruff | ||
A simple tool that does linting | ||
|
||
### mypy | ||
Type-checking tool | ||
|
||
### mixed-crlf | ||
Ensures that we don't commit any `crlf` files. Converts all to `lf` | ||
|
||
### pytest | ||
Unit testing framework | ||
|
||
### coverage | ||
`Coverage` is a simple tool that tells you what % of your code is covered by tests. This can be easily gamed, for example a test that is `assert main() == 0` will result in very high coverage but not necessarily good tests. | ||
|
||
### sphinx | ||
Generates `.rst` files and `html` files automatically. You can inject markdown manually. Check the [autodoc](autodoc.md) page for more information. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ adventofcode2023 | |
================ | ||
|
||
.. toctree:: | ||
:maxdepth: 4 | ||
:maxdepth: 1 | ||
|
||
day01 | ||
day02 | ||
|