Meziantou.Analyzer
Meziantou.Analyzer copied to clipboard
MA0124 Support case insensitive matching mode
The rule MA0124 is really useful. (Others too but it's not the point).
It would be nice to have a way (csproj property maybe) to enable a case insensitive matching mode in order to not have to duplicate all parameter name variations in the LoggerParameterTypes.txt.
In my case, all parameters from my log message are translated in camelCase. So MyPropertyId
and myPropertyId
will be a single one at the end. But myPropertyId
and mypropertyid
will stay as two distinct properties.
The full case insensitive would be enough, but camel case matching mode would be even better.
Voila voila, Have a nice day
It could also be per line configuration like javascript regex flag notation /\w+\s/gis;
- Is it an issue because the parameters are not normalized in the code? In this case, would it be better to provide a code fix to update all log parameters in the code?
- Should the case-sensitivity be per parameter? Or should it be global?
Should the case-sensitivity be per parameter? Or should it be global?
Why not both? Master project property and/or per param. Both would fit my needs
Is it an issue because the parameters are not normalized in the code? In this case, would it be better to provide a code fix to update all log parameters in the code?
Even if the existing source code is normalised, if someone add an existing param but with a different casing, it will not trigger any warning if not already exactly defined in LoggerParameterTypes
Why not both? Master project property and/or per param. Both would fit my needs
Everything's possible, but time is not infinite. I prefer keeping the scope small if it fits the need.
Even if the existing source code is normalised, if someone add an existing param but with a different casing, it will not trigger any warning if not already exactly defined in LoggerParameterTypes
You can enable MA0135
to report all unconfigured parameters.
MA0135
is a nice alternative. Thx.
This issue is stale because it has been open for 60 days with no activity.
This issue was closed because it has been inactive for 14 days since being marked as stale.