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

Following command line builds don't trigger warnings #3195

Closed
alefranz opened this issue Sep 5, 2020 · 1 comment
Closed

Following command line builds don't trigger warnings #3195

alefranz opened this issue Sep 5, 2020 · 1 comment
Labels

Comments

@alefranz
Copy link

alefranz commented Sep 5, 2020

When running dotnet build on an already built project, the StyleCopAnalyzers warnings are not emitted

First build:

❯ dotnet build
Microsoft (R) Build Engine version 16.7.0-preview-20360-03+188921e2f for .NET
Copyright (C) Microsoft Corporation. All rights reserved.

  Determining projects to restore...
  All projects are up-to-date for restore.
Controllers\WeatherForecastController.cs(16,100): warning SA1413: Use trailing comma in multi-line initializers [C:\dev\alefranz\StyleCopDemo\StyleCopDemo\StyleCopDemo.csproj]
Controllers\WeatherForecastController.cs(34,17): warning SA1413: Use trailing comma in multi-line initializers [C:\dev\alefranz\StyleCopDemo\StyleCopDemo\StyleCopDemo.csproj]
  StyleCopDemo -> C:\dev\alefranz\StyleCopDemo\StyleCopDemo\bin\Debug\netcoreapp3.1\StyleCopDemo.dll

Build succeeded.

Controllers\WeatherForecastController.cs(16,100): warning SA1413: Use trailing comma in multi-line initializers [C:\dev\alefranz\StyleCopDemo\StyleCopDemo\StyleCopDemo.csproj]
Controllers\WeatherForecastController.cs(34,17): warning SA1413: Use trailing comma in multi-line initializers [C:\dev\alefranz\StyleCopDemo\StyleCopDemo\StyleCopDemo.csproj]
    2 Warning(s)
    0 Error(s)

Time Elapsed 00:00:01.31

Following build (without code changes):

❯ dotnet build
Microsoft (R) Build Engine version 16.7.0-preview-20360-03+188921e2f for .NET
Copyright (C) Microsoft Corporation. All rights reserved.

  Determining projects to restore...
  All projects are up-to-date for restore.
  StyleCopDemo -> C:\dev\alefranz\StyleCopDemo\StyleCopDemo\bin\Debug\netcoreapp3.1\StyleCopDemo.dll

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:00:00.86

Repro: https://github.com/alefranz/StyleCopDemo/tree/rebuild-bug

Expected behaviour

Warnings are always emitted

Versions

StyleCop.Analyzers 1.1.118
.NET Core SDK 3.1.401

@sharwell
Copy link
Member

sharwell commented Sep 6, 2020

Duplicate of dotnet/msbuild#3046

@sharwell sharwell marked this as a duplicate of dotnet/msbuild#3046 Sep 6, 2020
@sharwell sharwell closed this as completed Sep 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants