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

Replace custom MSBuild targets with improved documentation #1790

Merged
merged 1 commit into from
Nov 18, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ internal class SettingsFileCodeFixProvider : CodeFixProvider
{
private const string StyleCopSettingsFileName = "stylecop.json";
private const string DefaultSettingsFileContent = @"{
// ACTION REQUIRED: This file was automatically added to your project, but it
// will not take effect until additional steps are taken to enable it. See the
// following page for additional information:
//
// https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/EnableConfiguration.md

""$schema"": ""https://raw.githubusercontent.com/DotNetAnalyzers/StyleCopAnalyzers/master/StyleCop.Analyzers/StyleCop.Analyzers/Settings/stylecop.schema.json"",
""settings"": {
""documentationRules"": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@
<None Include="..\stylecop.json">
<Link>stylecop.json</Link>
</None>
<None Include="build\StyleCop.Analyzers.targets" />
<None Include="packages.config" />
<NuGetManifest Include="StyleCop.Analyzers.nuspec">
<SubType>Designer</SubType>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@
<file src="tools\install.ps1" target="tools\" />
<file src="tools\uninstall.ps1" target="tools\" />

<!-- MSBuild imports -->
<file src="build\StyleCop.Analyzers.targets" target="build\" />

<!-- Source code -->
<file src="..\StyleCop.Analyzers\**\*.cs" exclude="..\StyleCop.Analyzers\obj\**\*.cs" target="src"/>
<file src="**\*.cs" exclude="obj\**\*.cs;Properties\AssemblyInfo.cs" target="src"/>
Expand Down

This file was deleted.

1 change: 1 addition & 0 deletions StyleCopAnalyzers.sln
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "documentation", "documentation", "{19DD9E9D-877A-4492-9B7F-2E681DD58308}"
ProjectSection(SolutionItems) = preProject
documentation\Configuration.md = documentation\Configuration.md
documentation\EnableConfiguration.md = documentation\EnableConfiguration.md
documentation\SA1000.md = documentation\SA1000.md
documentation\SA1001.md = documentation\SA1001.md
documentation\SA1002.md = documentation\SA1002.md
Expand Down
27 changes: 27 additions & 0 deletions documentation/EnableConfiguration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Enabling **stylecop.json**

At this time, the code fix is not able to fully configure the newly-created **stylecop.json** file for use. This is
tracked in bug report [dotnet/roslyn#4655](https://github.com/dotnet/roslyn/issues/4655). In the mean time, users must
manually perform the following additional steps after creating the **stylecop.json** file.

1. Right click the project in **Solution Explorer** and select **Unload Project**. If you are asked to save changes,
click **Yes**.
2. Right click the unloaded project in **Solution Explorer** and select **Edit *ProjectName*.csproj**.
3. Locate the following item in the project file.

```csharp
<None Include="stylecop.json" />
```

4. Change the definition to the following.

```csharp
<AdditionalFiles Include="stylecop.json" />
```

5. Save and close the project file.
6. Right click the unloaded project in **Solution Explorer** and select **Reload Project**.

## Next steps

Additional information about the content of **stylecop.json** is available in [Configuration.md](Configuration.md).