olsh / resharper-structured-logging

An extension for ReSharper and Rider that highlights structured logging templates and contains some useful analyzers
MIT License
141 stars 14 forks source link

Allow disabling analyzer in .editorconfig #99

Closed BrandonDusseau closed 10 months ago

BrandonDusseau commented 1 year ago

Rider allows disabling specific code inspections on a directory level by setting an option in .editorconfig. It doesn't appear that it's currently possible to use these to disable particular analyzers provided by this plugin.

For example, my team wants to disable the warning for making log messages compile-time constants. As far as I can tell, currently this requires placing the following comment into each affected file.

// ReSharper disable once TemplateIsNotCompileTimeConstantProblem

Is there a solution-wide method to disable this that I haven't been able to find? Is .editorconfig supported without me realizing it? If neither is the case, what would it take to implement support for this? Is it even possible for a plugin to make Rider recognize additional editorconfig options?

Thanks for your time.

frg commented 11 months ago

This was really annoying to find out how to do but you can change the severity for any resharper analyzer by converting the name to pascal_case, prefixing with "resharper" and postfixing with "highlighting".

resharper_template_is_not_compile_time_constant_problem_highlighting = error
BrandonDusseau commented 11 months ago

That took care of it, thanks! I would like to suggest that the maintainer document this so others can easily find it in the future.

olsh commented 10 months ago

@BrandonDusseau PR is welcome! 😄

BrandonDusseau commented 10 months ago

Sure, I'll try to put one up in the next week or two.