Repository navigation
Conversation
laurmaedje
left a comment
There was a problem hiding this comment.
Nice! A few remarks:
I find that "readme/image/inadequate-alt".alt-text = ["Repo", "License"] does not really tell me what it does by itself. Together with the table heading ignored-lints, it does sort of, but it's not very clear when viewed locally.
I tried to come up with something clearer, but did not manage to find a spelling that's clearly better. I do have a few ideas (some of which you probably already considered and decided against).
First of all, I think one small improvement would be to have a consistent naming for each kind of filter, e.g. always matches instead of alt-text, urls, and names. The alt-text part in particular was confusing to me because it does not tell me what it does. inadequate-alt".alt-text = ["Repo"] reads to me as if the alt text "Repo" is inadequate, even though we are stating the opposite with this rule!
I also find the string followed by dot key a bit hard to read and unpretty. Personally, I would probably demonstrate the slightly more verbose spelling with an inline dictionary.
Combined, it would then be something like this
[tool.package-check.ignored-lints]
"manifest/package/description/typst" = true
"size/large" = { files = "examples/*" }
"readme/image/inadequate-alt" = { matches = "Repo|License" }For the name ignored-lints, I would also throw allow, lints.allow and lints.ignored into the ring as alternatives, though I'm unsure if any of these is actually better. Maybe it's just my perpetual dislike of multi-word identifiers.
[tool.package-check.lints.allow]
...To make file and match rules a bit more locally understandable and have just lints as the top-level (which I find a bit nicer conceptually), we could also go with something like this:
[tool.package-check.lints]
"manifest/package/description/typst" = "allow"
"size/large" = { allow-files = "examples/*" }
"readme/image/inadequate-alt" = { allow-matches = "Repo|License" }The "allow" part is a bit redundant now, but it does imo read a bit better locally. Again, not sure...
They are currently 15MB for the bundle, and double that for the whole archive.
What do you mean with "bundle" and "archive" in this context?
Regexes are currently not anchored. Should we always anchor them, or only plain text ones?
I think I'd expect the regex to have to match the full alt-text / name / URL.
006f77a to
6f45d46
Compare
[tool.package-check.lints]
"manifest/package/description/typst" = "allow"
"size/large" = { allow-files = "examples/*" }
"readme/image/inadequate-alt" = { allow-matches = "Repo|License" }I think I like this the most. This morning I've added the
The bundle would be the files served when importing the package, so without the |
Me too 👍
What would it be used for? I could imagine something like
The sizes seem okay to me then. |
6f45d46 to
35c0b33
Compare
It isn't immediately obvious to me what Currently the diagnostics are printed as two separate lists separated by headers like this: I'm also not a huge fan of the names, but I think this is more readable than having to scan for an |
|
The idea was that filter is positive, i.e. what remains: Filtering for "denied" shows only the checks that were denied, i.e. not allowed (the default). Filtering for "all" would show all. For Maybe neither is particularly clear. 😅 |
118050c to
a7bae96
Compare
|
Test @typst/package-review |
08af48f to
118db83
Compare
- This introduces our own `Diagnostic` type that requires a `Code` enum - The TOML parsing code is quite heavily refactored - More links to the `typst/packages` docs are added
- Parse `tools.package-check.ignored-lints` - Filter diagnostics by code - Warn if `lints` selectors are unused - Remove `size/extra-large` hint and add `size/bundle`, `size/archive` - Split off toml module from manifest
…s to `check` command - Improve the CLI output - Share printing code between test runner and CLI - Make the `--json` flag write a JSON object per package - Document the structure of the JSON output
a591d4a to
9202b32
Compare
- Add an `[overridable]` tag to all overridable diagnostis. - If overridable diagnostics were denied, add a link to the package-check docs - Add a `lints` subcommand that list all overridable lints - Update the check run message
310a8bb to
951ec14
Compare
Implements #55, #95
This categorizes all lint codes into three categories:
Ignorable hints can be silenced in the
typst.tomlmanifest using three different types of selectors, depending on the scope of the lint. There are:Here is an example of the three lint types:
size/bundleandsize/archivelints. The plan is to make the github action read package size exceptions from a database that can only be edited by the staff. This way we can't miss any packages ignoring the lints during review.TODO/To decide
15MBfor the bundle, and double that for the whole archive.Docs.