How to use with dotnet cli and csproj?
See original GitHub issueThe current instructions for using the dotnet cli use a project.json
and not a csproj
.
I’ve tried to get csproj
to work with stylecop.json
but it seems to have no effect.
dotnet-test.csproj
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
<CodeAnalysisRuleSet>./dotnet-test.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<!-- No effect. No error on bad path. -->
<AdditionalFile Include="./stylecop.json" />
<AdditionalFiles Include="$(SolutionDir)/stylecop.json" Link="stylecop.json" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="StyleCop.Analyzers" Version="1.0.2" />
</ItemGroup>
</Project>
dotnet-test.ruleset
<?xml version="1.0" encoding="utf-8"?>
<RuleSet Name="The Rules" ToolsVersion="10.0">
<Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers">
<Rule Id="SA1652" Action="None" /> <!-- Don't use XML documentation -->
<Rule Id="SA1633" Action="None" /> <!-- No file header -->
</Rules>
</RuleSet>
stylecop.json
{
"$schema": "https://raw.githubusercontent.com/DotNetAnalyzers/StyleCopAnalyzers/master/StyleCop.Analyzers/StyleCop.Analyzers/Settings/stylecop.schema.json",
"settings": {
"indentation": {
"useTabs": true
}
}
}
Intentional parse error -- no effect
Program.cs
// This file uses tabs
using System;
public class Program
{
public static void Main(string[] args)
{
Console.WriteLine("Hello World!");
}
}
I’m still getting warning SA1027: Tabs must not be used
errors. How do I configure this?
This issue is similar to #2028, but it doesn’t go away if I fix the parse error in stylecop.json
.
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
dotnet sln command - .NET CLI
The dotnet sln command provides a convenient way to list and modify projects in a solution file. Create a solution file. To use...
Read more >dotnet run command - .NET CLI
The dotnet run command provides a convenient option to run your application from the source code with one command.
Read more >dotnet add reference command - .NET CLI
The dotnet add reference command provides a convenient option to add project-to-project references.
Read more >dotnet build command - .NET CLI
The dotnet build command builds a project and all of its dependencies.
Read more >dotnet new <TEMPLATE> - .NET CLI
The dotnet new command creates new .NET projects based on the specified template.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes, of course a
,
😦Thanks for the reply @vweijsters
But it does not look like it:
Am I missing something?