Repository navigation
Refactor few code style rules to separate docs - #20856
Conversation
Creating this initial PR as the proposed structure of IDE code style rule docs. - Rule ID + option name based index - We retain the rule ID-agnostic table based on just the option groups and option names in individual Language rules, Formatting rules and Naming rules pages. This could be a preferred browsing approach for users who just want to look at options, and don't care about rule severities, and hence rule IDs. - All the rule specific content moves to separate `idexxxx.md` pages. Whenever multiple rules are used by the same option or an option group, we will create a single doc page, but have necessary id based redirects so the IDE analyzers themselves can use deterministic help links which end in `idexxxx`.
| }, | ||
| { | ||
| "source_path": "docs/fundamentals/code-analysis/style-rules/ide0003.md", | ||
| "redirect_url": "/dotnet/fundamentals/code-analysis/style-rules/ide0003_ide0009.md" |
There was a problem hiding this comment.
Redirects needed when multiple complimentary rule IDs are clubbed with same option/option group and hence need to be in the same doc page. These redirects will allow each analyzer to specify docs/fundamentals/code-analysis/style-rules/<%RuleId%>.md by directly mapping rule ID to URI.
| @@ -0,0 +1,147 @@ | |||
| --- | |||
| title: "'this.' and 'Me.' qualifiers (IDE0003 and IDE0009)" | |||
There was a problem hiding this comment.
Example doc page for IDE code style option group that use multiple complimentary rules, which need to be documented in a single page.
There was a problem hiding this comment.
NOTE: Almost all content here is taken from existing language-rules.md file.
| @@ -0,0 +1,89 @@ | |||
| --- | |||
| title: "Use language keywords instead of framework type names for type references (IDE0049)" | |||
There was a problem hiding this comment.
Example IDE rule with single rule ID used for an option group.
|
|
||
| ## Index | ||
|
|
||
| The following pages list all the code style rules by rule ID and corresponding option(s), if any. |
There was a problem hiding this comment.
Rule ID + option based index.
| The style rules in this section are applicable to both C# and Visual Basic. | ||
|
|
||
| - ["This." and "Me." qualifiers](#this-and-me) | ||
| - ["This." and "Me." qualifiers](ide0003_ide0009.md) |
There was a problem hiding this comment.
This table will still be retained in case user wants to browse all style rules by Option group and/or option names, without the overhead of rule IDs, which are only ever needed if user wants to change rule severity.
| - [Parameter preferences](#parameter-preferences) | ||
| - dotnet\_code\_quality\_unused\_parameters | ||
|
|
||
| ### <a name="this-and-me"></a>"This." and "Me." qualifiers |
There was a problem hiding this comment.
The actual rule contents moved out to separate docs which can directly be linked from the analyzer by just mapping the rule ID to URI.
|
@gewarren I cannot figure out the reason for the build failure. toc looks fine to me.. |
gewarren
left a comment
There was a problem hiding this comment.
I'll wait to approve until I can see a preview.
Co-authored-by: Genevieve Warren <[email protected]>
|
I have few more rule ports in my branch, will address this feedback and push those out by EOD day. Thanks for the review. |
Co-authored-by: Genevieve Warren <[email protected]>
|
@gewarren I think I addressed your feedback. Please let me know if I missed something. Thanks! |
Co-authored-by: Genevieve Warren <[email protected]>
Co-authored-by: Genevieve Warren <[email protected]>
gewarren
left a comment
There was a problem hiding this comment.
Table looks much better!
|
Thanks @gewarren! |
Summary
Creating this initial PR as the proposed structure of IDE code style rule docs.
idexxxx.mdpages. Whenever multiple rules are used by the same option or an option group, we will create a single doc page, but have necessary id based redirects so the IDE analyzers themselves can use deterministic help links which end inidexxxx.[Edit by gewarren to add preview link.]