[Merged by Bors] - ci: basic check on fields in 100.yaml and 1000.yaml#20078
[Merged by Bors] - ci: basic check on fields in 100.yaml and 1000.yaml#20078bryangingechen wants to merge 13 commits intomasterfrom
Conversation
PR summary 3c3fb6a999Import changes for modified filesNo significant changes to the import graph Import changes for all files
Declarations diff
You can run this locally as follows## summary with just the declaration names:
./scripts/declarations_diff.sh <optional_commit>
## more verbose report:
./scripts/declarations_diff.sh long <optional_commit>The doc-module for No changes to technical debt.You can run this locally as
|
|
Thanks for the quick review! I've marked this as |
grunweg
left a comment
There was a problem hiding this comment.
Actually, one more thought: there are now two locations for these doc comments on the respective fields: once in {100,1000}.yaml, and once in the HundredTheorems class.
At the minimum, can we make sure to copy all the doc comments everywhere, and add comments to keep these in sync? In fact, I wonder if it's better to shorten the comment in the yaml file, referring to yaml_check.py for a documentation of the respective fields.
(I seemingly cannot edit your PR, so haven't pushed any of these changes directly.)
|
I just went ahead and updated this PR for the proposed webpage PR (and also added validation for decl vs decls). The last commit (a more flexible date format) is in anticipation of 1000-plus/1000-plus.github.io#10. |
|
Merged master, fixed another violation of the file format and improved the error message. I would maintainer merge this now - but as I wrote the second half of the code, I'd prefer not to. |
|
I'm not sure about the last commit: I consciously deleted those doc-comments, as they make no sense in the context of mathlib. What do you think? |
|
Ah, I just thought it'd be easier to keep them in sync if they were exactly the same text so I copied and pasted them without thinking. I guess it's not much more work to just copy and paste the fields though. Let me revert. |
|
I hope the allowed fields will change very rarely, if at all. (The current changes are bug fixes, in my opinion.) |
|
@fpvandoorn This PR has gone through major revision by @grunweg and should now be in sync with leanprover-community/leanprover-community.github.io#563. Do you mind re-reviewing / merging this if it looks good? After this is merged the website will be temporarily broken, but I plan on merging the PR over there in short order so there won't be any actual broken builds, hopefully. |
|
Thanks! bors merge |
This PR makes `scripts/yaml_check.py` verify that `100.yaml` and `1000.yaml` only contain fields the webpage expects them to. Otherwise, changes in mathlib breaking the website won't be noticed until they are merged; this has happened several times in the last days. In particular, replace two occurrences of `note` in `1000.yaml` by `comment`. To this end, this PR copies the dataclass constructors which are used in the website script to `scripts/yaml_check.py` (along with a comment asking to keep them in sync). While at it, this PR documents the fields in `100.yaml` as well, and moves the documentation for `1000.yaml` to the copied dataclasses in `yaml_check.py`. In addition, validate that at most one of the fields `decl` and `decls` are passed: the webpage also does this; this avoids late surprises. Co-authored-by: grunweg <rothgang@math.uni-bonn.de> Co-authored-by: Michael Rothgang <rothgang@math.uni-bonn.de>
|
Pull request successfully merged into master. Build succeeded: |
This PR makes
scripts/yaml_check.pyverify that100.yamland1000.yamlonly contain fields the webpage expects them to. Otherwise, changes in mathlib breaking the website won't be noticed until they are merged; this has happened several times in the last days. In particular, replace two occurrences ofnotein1000.yamlbycomment.To this end, this PR copies the dataclass constructors which are used in the website script to
scripts/yaml_check.py(along with a comment asking to keep them in sync).While at it, this PR documents the fields in
100.yamlas well, and moves the documentation for1000.yamlto the copied dataclasses inyaml_check.py.In addition, validate that at most one of the fields
declanddeclsare passed: the webpage also does this; this avoids late surprises.Co-authored-by: grunweg rothgang@math.uni-bonn.de
After merging this, the website will be broken until leanprover-community/leanprover-community.github.io#563 is merged.