Skip to content

Commit bb54f27

Browse files
docs: update contributing to include nox (#653)
Signed-off-by: arielle <me@arielle.codes> Co-authored-by: Joshie <74162303+CoderJoshDK@users.noreply.github.com>
1 parent f3c7b87 commit bb54f27

6 files changed

Lines changed: 94 additions & 38 deletions

File tree

CONTRIBUTING.md

Lines changed: 51 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,7 @@ git clone https://github.com/onerandomusername/monty-python
8282
cd monty-python
8383
```
8484

85-
Next, create a file named `.env` within the cloned repository. This will be used
86-
later regardless of how you run Monty.
85+
Next, create a file named `.env` within the cloned repository.
8786

8887
A minimum viable contents (if using Docker) are as follows:
8988

@@ -94,8 +93,8 @@ BOT_TOKEN=...
9493
# to change the default prefix from `-`
9594
PREFIX=...
9695

97-
# optional, used to increase GitHub ratelimits from
98-
# 60 to 5000/h and enable the graphql API
96+
# optional, but necessary for anything using GitHub,
97+
# required to enable the GitHub related code
9998
GITHUB_TOKEN=...
10099
```
101100

@@ -111,8 +110,12 @@ uv run prek install
111110
If you don't already have uv installed, check the
112111
[uv documentation](https://docs.astral.sh/uv/), or use a tool like pipx or uvx.
113112

114-
Make sure you install prek, as it will lint every commit before its created,
115-
limiting the amount of fixes needing to be made in the review process.
113+
Make sure you run `prek install`, as it will integrate with git and lint every
114+
commit before committing, limiting the amount of fixes needing to be made in the
115+
review process.
116+
117+
Some fixes aren't automatic or done with prek, so take a look at
118+
[Running CI locally](#running-ci-locally)
116119

117120
### Create a Discord Bot
118121

@@ -172,9 +175,42 @@ docker compose up monty
172175
Monty should now be running! There's now a few other configuration things to do
173176
to finish initialising the database. See the bot only commands.
174177

175-
## Building the documentation
178+
## Running CI locally
179+
180+
As a public bot, Monty Python has continuous integration through GitHub actions
181+
and other developer tools to ensure that Monty is held to strict quality
182+
standards (as time progresses)!
183+
184+
To run the CI equivalent locally, we use nox as our runner.
185+
186+
```sh
187+
uv run nox
188+
```
189+
190+
With no arguments, this command will run all of the sessions and fixes that we
191+
run in CI.
192+
193+
If any changes are made, the results should be commited along with the rest of
194+
your code.
195+
196+
### Commands and Autodoc
197+
198+
To document the procedures and methods on Monty, there is a custom script which
199+
serves to update two files listing the prefix and application commands that are
200+
available on Monty. These files are still in beta, and should not be relied at
201+
this moment for anything other than contributing documentation.
176202

177-
TLDR
203+
Running the autodoc session should automatically update these files, if there
204+
were any changes.
205+
206+
```sh
207+
uv run nox -s autodoc`
208+
```
209+
210+
### Building the documentation
211+
212+
To preview the documentation with an automatic reloading server, use the
213+
following command:
178214

179215
```sh
180216
uv run nox -s docs
@@ -188,3 +224,10 @@ uv run mkdocs serve
188224

189225
The dev server runs on http://127.0.0.1:8000 by default. Use `mkdocs build` to
190226
produce the static site into `site/`.
227+
228+
If you modified any documentation pages, including the CONTRIBUTING.md document
229+
or the README.md, make sure you run mdformat.
230+
231+
```sh
232+
uv run nox -s mdformat
233+
```

docs/contributing/developer-commands.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ extensions or modules for development.
4141
- Unload currently loaded extensions given their fully qualified or
4242
unqualified names.
4343
- `ext autoreload`
44-
- Autoreload of modified extensions.
44+
- Autoreload of modified extensions. This watches for file edits, and will
45+
reload modified extensions automatically.
4546

4647
> [!TIP]
4748
> The library that is required for the autoreload command is only installed for
@@ -58,10 +59,14 @@ only. This command runs within the event loop, and **within the bot context**.
5859
> to your bot and computer.
5960
6061
This command is named `ieval`, short for internal evaluation. It processes with
61-
the same syntax rules as the `eval` command, which uses the snekbox backend, but
62-
is instead run within the bot. This is a developer-only command, as you can
63-
easily print the bot token or do other nefarious things.
62+
the same parsing rules as the `eval` command, which uses the snekbox backend,
63+
but this command is run within the bot. This is a developer-only command, as you
64+
can easily print the bot token or do other nefarious things.
6465

6566
```py
6667
-ieval await ctx.send("this is from the bot context!")
6768
```
69+
70+
This command was recently rewritten, and has a few known bugs, see
71+
<https://github.com/onerandomusername/monty-python/issues/621> for more details.
72+
If you'd like to fix these, please do!

docs/future-plans.md

Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8,47 +8,50 @@ These are a list of future plans and integrations for Monty. If you want to help
88
with one, please open an issue to flesh out the idea a bit more before
99
contributing.
1010

11+
There is also a list of future plans and integrations @
12+
<https://github.com/onerandomusername/monty-python/issues>
13+
1114
## Todo
1215

1316
### Core
1417

15-
- Speed up boot time
16-
- Restructure deployments to be able to use RESUMING when deploying a new
18+
- [ ] Speed up boot time
19+
- [ ] Restructure deployments to be able to use RESUMING when deploying a new
1720
version of Monty (don't lose any events between deployments)
18-
- Use `monty.utils.responses` in more places.
19-
- Type safety
20-
- Enforce `DeleteButton` on *every. single. reply.*
21+
- [ ] Use `monty.utils.responses` in more places.
22+
- [ ] Type safety
23+
- [ ] Enforce `DeleteButton` on *every. single. reply.*
2124

2225
### Database management
2326

24-
- Rewrite guild configuration to be eager upon guild join
25-
- Per-user configuration (see below)
27+
- [ ] Rewrite guild configuration to be eager upon guild join
28+
- [ ] Per-user configuration (see below)
2629

2730
### Dependencies
2831

29-
- Drop some of the additional markdown parsers
32+
- [ ] Drop some of the additional markdown parsers
3033

3134
### GitHub Parsing
3235

33-
- Migrate to Mistune v3
34-
- Rewrite GitHub processing to be more reconfigurable
35-
- Support components v2
36-
- Add image support to replies
37-
- Per user configuration of settings, see below
36+
- [ ] Migrate to Mistune v3
37+
- [ ] Rewrite GitHub processing to be more reconfigurable
38+
- [ ] Support components v2
39+
- [ ] Add image support to replies
40+
- [ ] Per user configuration of settings, see below
3841

3942
### User Support
4043

41-
- Per-user configuration
42-
- documentation objects
43-
- github org
44-
- github expand configuration
45-
- discourse expand
46-
- Per-user Feature system for deployments
47-
- Admin support for user blacklist
44+
- [ ] Per-user configuration
45+
- [ ] documentation objects
46+
- [ ] github org
47+
- [ ] github expand configuration
48+
- [ ] discourse expand
49+
- [ ] Per-user Feature system for deployments
50+
- [ ] Admin support for user blacklist
4851

4952
## Completed
5053

51-
- Rewrite the developer-side feature view command
52-
- Add contributing documentation
53-
- Migrate to uv
54-
- Add an autodoc of all app commands to the documentation website.
54+
- [x] Rewrite the developer-side feature view command
55+
- [x] Add contributing documentation
56+
- [x] Migrate to uv
57+
- [x] Add an autodoc of all app commands to the documentation website.

mkdocs.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ plugins:
5656
markdown_extensions:
5757
- admonition
5858
- pymdownx.details
59+
- pymdownx.tasklist:
60+
custom_checkbox: true
5961
- pymdownx.superfences
6062
- markdown_gfm_admonition
6163
- pymdownx.highlight:

monty/exts/core/extensions.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,11 @@ async def _autoreload_worker(self, channel: disnake.abc.Messageable) -> None:
314314
invoke_without_command=True,
315315
)
316316
async def autoreload(self, ctx: commands.Context) -> None:
317-
"""Autoreload of modified extensions."""
317+
"""
318+
Autoreload of modified extensions.
319+
320+
This watches for file edits, and will reload modified extensions automatically.
321+
"""
318322
msg = "Autoreload is currently: "
319323
msg += "enabled" if self.bot._autoreload_task and not self.bot._autoreload_task.done() else "disabled"
320324
msg += "."

task.env

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)