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

Enable StyleCop Analyzer #7424

Merged

Conversation

chidozieononiwu
Copy link
Member

Enable Style Cop with all rules disabled

@chidozieononiwu
Copy link
Member Author

/azp run net - client - ci

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@chidozieononiwu chidozieononiwu requested a review from pakrym August 29, 2019 15:17
@@ -45,6 +45,7 @@
<IsTestSupportProject Condition="'$(IsTestProject)' != 'true' and ($(MSBuildProjectDirectory.Contains('/tests/')) or $(MSBuildProjectDirectory.Contains('\tests\')))">true</IsTestSupportProject>
<EnableClientSdkAnalyzers Condition="'$(IsClientLibrary)' == 'true' and '$(IsTestProject)' != 'true' and '$(IsTestSupportProject)' != 'true' and '$(IsSamplesProject)' != 'true'">true</EnableClientSdkAnalyzers>
<EnableFxCopAnalyzers Condition="'$(IsClientLibrary)' == 'true' and '$(IsTestProject)' != 'true' and '$(IsTestSupportProject)' != 'true' and '$(IsSamplesProject)' != 'true'">true</EnableFxCopAnalyzers>
<CodeAnalysisRuleSet>$(RepoEngPath)\CodeAnalysis.ruleset</CodeAnalysisRuleSet>
Copy link
Member

Choose a reason for hiding this comment

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

You might want to consider adding a condition here if you expect some folks might need to opt-out. Although it is hard to opt-out of a setting in the props file because it is imported before any properties in a project can be set, but we should figure out an opt-out strategy.

Copy link
Member Author

Choose a reason for hiding this comment

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

Opt out will be done by simply removing the package reference from the specific project.

Copy link
Member

Choose a reason for hiding this comment

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

My expectation is that the package reference would be would be in the common targets file similar to the other tools packages like SourceLink, as opposed to being in each of the projects. Although you are correct you can condition the project references for projects that want to opt-out.

@chidozieononiwu chidozieononiwu merged commit f5d3bc8 into Azure:master Aug 29, 2019
@chidozieononiwu chidozieononiwu deleted the EnableStyleCopAnalyzer branch August 29, 2019 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants