File tree Expand file tree Collapse file tree
Ubiquity.NET.CommandLine.SrcGen
Ubiquity.NET.SrcGeneration.UT
Ubiquity.NET.SrcGeneration Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -32,3 +32,17 @@ tab_width = 2
3232# requires: https://marketplace.visualstudio.com/items?itemName=PaulHarrington.EditorGuidelinesPreview
3333guidelines = 92
3434
35+ # Settings for https://marketplace.visualstudio.com/items?itemName=MadsKristensen.MarkdownLint
36+ # Sadly, that is dragged in by https://marketplace.visualstudio.com/items?itemName=MadsKristensen.MarkdownEditor2
37+ # while there is a built-in version that doesn't support mermaid diagrams without all the CoPilot cruft.
38+ # see: https://developercommunity.visualstudio.com/t/Mermaid-rendering-does-not-work/10968192#T-N10986717
39+ # so the "third party" (not really) one is used.
40+ # The linter is NOT used in this repo as it is not flexible enough and inconsistently complains about perfectly valid markdown as not consistent.
41+ # sadly, the mdlint package doesn't have configuration for the `lines_above` or 'lines_below` parameters so disable the rule (MD022)
42+ # md_blanks_around_headings = false
43+ # md_ul_indent = 4
44+ # md_fenced_code_language = false # fenced "code" may just be text and no language exists
45+ # md_code_fence_style = backtick
46+ # md_emphasis_style = asterisk
47+ # md_strong_style = asterisk
48+
Original file line number Diff line number Diff line change 1- # UNC0000: An internal analyzer exception occurred.
1+ # UNC0000: An internal analyzer exception occurred
22An internal error occurred in the analyzer. Please [ report] ( https://github.com/UbiquityDotNET/Ubiquity.NET.Utils/issues )
33the issue with as much detail as possible, ideally with a small repro to help identify the
44problem. Please include the full stack of the exception as shown in the message details.
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ type does not contain an attribute that designates it as a command. The generato
44*** ignore*** the property and the *** entire*** class.
55
66## Example:
7+
78``` C#
89using System .IO ;
910
@@ -19,6 +20,7 @@ internal class testInput1
1920```
2021
2122## Fix:
23+
2224``` C#
2325using System .IO ;
2426
Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ internal class testInput1
2727```
2828
2929## Fix
30+
3031``` C#
3132using System .IO ;
3233
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ incorrect type is used. If this is ignored or suppressed the property is ignored
66generation.
77
88## Example
9+
910``` C#
1011using System .IO ;
1112
Original file line number Diff line number Diff line change 1- # UNC004 : Property type is nullable but marked as required.
1+ # UNC004 : Property type is nullable but marked as required
22This diagnostic is reported when a nullable type is marked as ` Required ` . This usually
33indicates an error in the source applying the attributes. An explicitly annotated nullable
44type has a legit value of null, therefore marking it as ` Required ` makes no sense. Required
55means that it is validated as specified on the command line, this validation only occurs at
66the time of *** invoking*** the command. (If a different command is parsed from the command
77line arguments then no validation occurs).
88
9-
109## Example
10+
1111``` C#
1212using Ubiquity .NET .CommandLine .GeneratorAttributes ;
1313
Original file line number Diff line number Diff line change 1- # UNC005 : Arity specified for property type is invalid.
1+ # UNC005 : Arity specified for property type is invalid
22This diagnostic indicates that the arity specified in an attribute does not match the type
33of value for that property^1^. The default arity is usually enough but it is sometimes valid
44to limit the "or more" default to a max value. In particular with collections there may be
5- a limit to the maximum number of values allowed so the arity specifies that. Not that the
6- arity applies to the *** values*** of a property. That is:
7- ` --foo true ` is ONLY allowed if the minimum arity is > 1, otherwise only the option itself
8- is allowed (for example: ` --foo ` ). Setting the arity to a maximum that is > 1 requires a
9- collection type to bind the parsed values to. Setting a minimum > 0 makes it required to
10- specify a value for the command. That is, with a minimum arity of 1 ` --foo ` is an error.
5+ a limit to the maximum number of values allowed so the arity specifies that.
116
7+ > [ !IMPORTANT]
8+ > The arity applies to the *** values*** of a property. That is, ` --foo true ` is ONLY allowed
9+ > if the minimum arity is > 1, otherwise only the option itself is allowed (for example:
10+ > ` --foo ` ). Setting the arity to a *** maximum*** that is > 1 requires a collection type to
11+ > bind the parsed values to. Setting a *** minimum*** > 0 makes it required to specify a
12+ > value for the option IFF the option itself is provided. That is, with a minimum arity of 1
13+ > ` --foo ` is an error. But not specifying the option is not (unless it is marked as
14+ > "Required")
1215
1316---
1417^1^ see the [ System.CommandLine docs] ( https://learn.microsoft.com/en-us/dotnet/standard/commandline/syntax#argument-arity )
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ parsing and binding. Additionally an analyzer is provided to aid in identifying
77with usage of the attributes for generation.
88
99## Analyzer Diagnostics
10+
1011Rule ID | Title |
1112--------|-------|
1213[ UNC000] ( https://ubiquitydotnet.github.io/Ubiquity.NET.Utils/CommandLine/diagnostics/UNC000.html ) | An internal analyzer exception occurred. |
Original file line number Diff line number Diff line change 1+ antlr
12arity
3+ bool
4+ initializer
5+ interop
6+ marshalling
7+ namespace
28nullable
9+ runtimes
10+ src
11+ Theming
12+ utils
Original file line number Diff line number Diff line change @@ -32,6 +32,20 @@ tab_width = 2
3232# requires: https://marketplace.visualstudio.com/items?itemName=PaulHarrington.EditorGuidelinesPreview
3333guidelines = 92
3434
35+ # Settings for https://marketplace.visualstudio.com/items?itemName=MadsKristensen.MarkdownLint
36+ # Sadly, that is dragged in by https://marketplace.visualstudio.com/items?itemName=MadsKristensen.MarkdownEditor2
37+ # while there is a built-in version that doesn't support mermaid diagrams without all the CoPilot cruft.
38+ # see: https://developercommunity.visualstudio.com/t/Mermaid-rendering-does-not-work/10968192#T-N10986717
39+ # so the "third party" (not really) one is used.
40+ # The linter is NOT used in this repo as it is not flexible enough and inconsistently complains about perfectly valid markdown as not consistent.
41+ # sadly, the mdlint package doesn't have configuration for the `lines_above` or 'lines_below` parameters so disable the rule (MD022)
42+ # md_blanks_around_headings = false
43+ # md_ul_indent = 4
44+ # md_fenced_code_language = false # fenced "code" may just be text and no language exists
45+ # md_code_fence_style = backtick
46+ # md_emphasis_style = asterisk
47+ # md_strong_style = asterisk
48+
3549# match ISO standard requirement for C/C++
3650[* .c,* .h,* .cpp ]
3751insert_final_newline = true
You can’t perform that action at this time.
0 commit comments