Conversation
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
tarekziade
left a comment
There was a problem hiding this comment.
nice!
when we your run mlinter --rule you get a documentation snippet, very similar to your doc for each rule. See also --list-rules.
I wonder if it wouldn't make sense to auto generate that portion of the doc automatically
|
oh good idea! i think it'd be clearer and easier to scan if we combined the |
Could you show me an example of what you have in mind? would that be a reorg in the toml or in how the CLI outputs it? |
|
i was thinking a reorg in [rules.TRF001.explanation]
what_it_does = "Checks naming consistency between <Model>PreTrainedModel and config_class."
why_bad = "Mismatched config_class can break loading, auto classes, and developer expectations."
diff = '''
class AcmePreTrainedModel(PreTrainedModel):
- config_class = NanoConfig
+ config_class = AcmeConfig
''' |
nice! +1 to do this. |
tarekziade
left a comment
There was a problem hiding this comment.
super nice addition, thanks!
|
do you have permissions to merge for me @tarekziade? i don't think the required failing test is related here |
|
I don't have the perms. cc @ydshieh |
adds docs for static model rules so model contributors are aware of expectations
added from @tarekziade feedback:
format_rule_details()to output Markdown that gets inserted directly in the docscheck_modeling_rules_doc.pyutil that checksrules.tomland usesformat_rule_details()to generate the## Rules referencesectionmake check-repoandmake fix-repoto catch any drifts and automatically regenerate the docs if a rule is added or removed fromrules.toml