Skip to content

Fix location of CodeAnalysis.ruleset - #59

Merged
ViktorHofer merged 1 commit into
dotnet:masterfrom
stephentoub:movecodeanalysis
Nov 15, 2019
Merged

ViktorHofer merged 1 commit into
dotnet:masterfrom
stephentoub:movecodeanalysis

Conversation

@stephentoub

Copy link
Copy Markdown
Member

No description provided.

@ViktorHofer ViktorHofer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you consider moving the ruleset file under src instead as it's shared?

<!-- Analyzers -->
<PropertyGroup>
<CodeAnalysisRuleset>$(CoreLibSharedDir)CodeAnalysis.ruleset</CodeAnalysisRuleset>
<CodeAnalysisRuleset>$(LibrariesProjectRoot)CodeAnalysis.ruleset</CodeAnalysisRuleset>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove that property in favor of the one in the repo root

@stephentoub stephentoub Nov 15, 2019 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove that property in favor of the one in the repo root

Not following. You mean replace LibrariesProjectRoot with something else? (LibrariesProjectRoot is defined by the Directory.Build.props in the repo root.)

@stephentoub stephentoub Nov 15, 2019 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh... do you mean just remove this whole analyzers section, from both here and the libraries build props, and add it instead to the root Directory.Build.props?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly. I believed that property was already there but I was wrong. Please do that.

@stephentoub stephentoub Nov 15, 2019 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ViktorHofer, I just took a look at doing this, and there's a bunch of analyzer stuff that needs to be consolidated, not just this one property. For example, eng\Analyzers.props has the PackageReferences used by corefx, but those same PackageReferences are in System.Private.CoreLib.csproj for coreclr. I think we should separately consolidate everything to do with analyzers, rather than moving this one property and doing it piecemeal. The root Directory.Build.props is currently very sparse.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for letting me know of that, I wasn't aware how CoreLib references these analyzers. I agree, let's do that separately.

@stephentoub

Copy link
Copy Markdown
Member Author

Did you consider moving the ruleset file under src instead as it's shared?

Yes, but I like that src is so clean, and would like to avoid adding additional files there unless it's really valuable. Also, libraries is where almost all of the managed code is that's being analyzed; there's only a tiny amount that's specific to runtime/src/coreclr/System.Private.CoreLib, and the project there already needs to reach across to src/libraries to get the bulk of the CoreLib implementation, so it seems fine for it to also access the analysis file here as well.

@ViktorHofer

Copy link
Copy Markdown
Member

That sounds reasonable. Thanks.

@ViktorHofer

Copy link
Copy Markdown
Member

Seems we are still hitting the FreeBSD issue with System.IO.Ports. cc @wfurt

@ViktorHofer
ViktorHofer merged commit e64a34c into dotnet:master Nov 15, 2019
@ViktorHofer
ViktorHofer deleted the movecodeanalysis branch November 15, 2019 18:13
@karelz karelz added this to the 5.0.0 milestone Aug 18, 2020
MichalStrehovsky pushed a commit to MichalStrehovsky/runtime that referenced this pull request Aug 27, 2020
* Disable more warnings for latest 5.0-rc SDK

* Delete using nuint/nint

* Delete redundant or no longer necessary build properties

Port dotnet#41051

* Add ObjectWriter feed to global NuGet.config for now
@ghost ghost locked as resolved and limited conversation to collaborators Dec 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants