Expose the rule set file path in CommonCommandLineArguments
Currently the `CommonCommandLineParser` handles the `/ruleset` switch by reading the .ruleset file and setting the general and specific diagnostic options. However, it doesn't actually save the file path anywhere. This commit now exposes it through the `CommonCommandLineArguments` type, like any other switch that takes a file path. This change also corrects a subtle issue. As with other switches that take paths, if the `/ruleset` switch appears more than once the last occurrence should "win", and prior occurences should be ignored. However, the dictionary of specific diagnostic options was shared between processing one `/ruleset` and the next; even though the last one should win you could still end up with settings from the other ones. With this change the set of specific diagnostic options is reset with every `/ruleset` processed, ensuring only the last one has any effect. Technically this is a breaking change. However, you would have to work pretty hard to pass more than one `/ruleset` switch to the compiler. MSBuild only allows one, at most, so you would have to invoke the compiler directly.
Showing
想要评论请 注册 或 登录