Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some rules/options aren't being picked up when configured in a global AnalyzerConfig #884

Closed
xt0rted opened this issue Mar 22, 2022 · 0 comments

Comments

@xt0rted
Copy link
Contributor

xt0rted commented Mar 22, 2022

Product and Version Used:

  • Roslynator.Analyzers: 4.0.2
  • Roslynator.CodeAnalysis.Analyzers: 4.0.2
  • Roslynator.Formatting.Analyzers: 4.0.2

Steps to Reproduce:

I'm trying to put all of my Roslynator settings in a global AnalyzerConfig so it's easier to share/update between projects.

I enabled RCS0001 and it reports errors. I then enabled RCS0011 but it doesn't report errors, and it's option roslynator_blank_line_between_single_line_accessors doesn't do anything.

If I move the settings for RCS0011 to the root .editorconfig then the analyzer lights up and reports an error, but not when it's configured in my global config.

The setup I'm using is as follows:

/Directory.Build.targets

<Project>

  <Target Name="AddGlobalCodeAnalysisRules" BeforeTargets="CoreCompile">
    <ItemGroup>
      <EditorConfigFiles Include="$(MSBuildThisFileDirectory)analysis\*.editorconfig" />
    </ItemGroup>
  </Target>

</Project>

/analysis/roslynator.editorconfig

is_global = true

# RCS0001: Add blank line after embedded statement
dotnet_diagnostic.RCS0001.severity = error

# RCS0011: Add/remove blank line between single-line accessors
dotnet_diagnostic.RCS0011.severity = error
roslynator_blank_line_between_single_line_accessors = false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants