Enforce documentation for configs via test suites - #293
Conversation
5dd663e to
6033499
Compare
6033499 to
bed15a4
Compare
|
I'm not sure about this. The configs that don't have a config are sorta supposed to be the ones that are self explanatory as to avoid cluttering the config with a ton of documentation(bc then it looks too busy) |
Then they can just be annotated as Undocumented like in this pr, perhaps with a more fitting reason or a simple |
|
This is more so as a safeguard to make sure config options that don’t have comments are intended not to have them. With this change i discovered some like purpur alt keepalive not being documented |
fcacd66 to
7d42f8c
Compare
Dueris
left a comment
There was a problem hiding this comment.
After these are addressed and Bacons other PR that is currently blocking this is merged, Im good with this being merged too
| "each bucket will be ticked" | ||
| ).greaterThan(0.0F); | ||
| option("purpurAlternativeKeepalive") | ||
| .docs( |
There was a problem hiding this comment.
This method(docs) wraps the text in the blob. Probably best to use a Style instance and make the AKA specifically on a new line rather than wrapped with everything else.
| public boolean disableSweepingEdge = false; | ||
| @Undocumented("Doesn't require docs.") | ||
| public boolean disableCritsWhileSprinting = false; | ||
| // public int invulnerabilityTicks = 10; |
There was a problem hiding this comment.
Perhaps out of scope of this PR but we can probably remove this comment too since there isn't a reliable way to reintroduce this given our new setup
| } | ||
|
|
||
| if (Part.class.isAssignableFrom(field.getType())) { | ||
| @SuppressWarnings("unchecked") |
There was a problem hiding this comment.
Use a comment to suppress the warnings to follow the rest of the code-style:
//noinspection unchecked
| final Set<String> returned = new HashSet<>(); | ||
| final Set<String> fixed = new HashSet<>(); | ||
|
|
||
| for (final var element : found) { |
There was a problem hiding this comment.
While I honestly dont care TOO much, use the actual type instead of var lol
This pull request adds tests for the global and world configuration classes which enforce all options have documentation attached to them.
The verification can be opted out of by annotating the relevant config with
@Undocumentedalong with a reason.In addition to above it completes https://panel.canvasmc.io/dashboard/tasks/cmr0gyjxp00ap0klpfncznk15
Example output