Commit Graph

2 Commits

Author SHA1 Message Date
Michael Handschuh df5846569f Enforce CA1304 and CA1305 as build errors
This will cause the build to fail if overloads are available that accept
an IFormatProvider/CultureInfo that are not used. In most cases, simply
invoking the appropriate method in `StringExtensions` will do the trick.
For parsing, such `Parse<Type>Invariant` and associated methods.
For ToString-ing, use `ToStringInvariant` and `ToStringInvariant(format)`
Other culture-specific string methods are also provided, including
`StartsWithInvariant`, `EndsWithInvariant` and `IndexOfInvariant`. We
can continue to add methods to `StringExtensions` as new cases arise.

See #3045
2019-09-12 15:30:46 -04:00
Michael Handschuh 703f915182 Configure QuantConnect.ruleset in all projects
The initial ruleset is specifically aimed at addressing #3045. When we'd like
to start addressing other issues available via the FxCopAnalyzers, we can update
the action in QuantConnect.ruleset. A nice way to do it is to first set it to
warning, then go through the solution, project-by-project, fixing each warning.
At the end you can flip it to error and ensure it still builds. Moving forward,
any changes will fail if they violate the rule.

In support of #3045, we'll be configuring the following rules:
> CA1304: https://docs.microsoft.com/en-us/visualstudio/code-quality/ca1304-specify-cultureinfo?view=vs-2017
> CA1305: https://docs.microsoft.com/en-us/visualstudio/code-quality/ca1305-specify-iformatprovider?view=vs-2017
2019-08-16 18:08:18 -03:00