Giter Site home page Giter Site logo

Suppressing one IDExxxx rule from a multi-rule EditorConfig setting is not possible if EnforceCodeStyleInBuild is enabled about roslyn HOT 8 OPEN

cremor avatar cremor commented on June 20, 2024
Suppressing one IDExxxx rule from a multi-rule EditorConfig setting is not possible if EnforceCodeStyleInBuild is enabled

from roslyn.

Comments (8)

sharwell avatar sharwell commented on June 20, 2024

This behavior is by design. We are working (#73843) to add an option where the :warning suffix on dotnet_style_prefer_collection_expression is ignored in favor of using the value from dotnet_diagnostic.IDE0305.severity, but this option will not apply to individual rules (you either get the :warning suffix support on all supported code style rules, or you do not get it at all).

I would recommend filing a bug report specifically for the dotnet_style_prefer_collection_expression if its current configuration is problematic.

from roslyn.

sharwell avatar sharwell commented on June 20, 2024

@cremor Thank you very much for taking the time to file this issue with the full detail. It would have taken me a very long time to otherwise unravel this slightly different situation from the others that have been reported recently.

I'm going to keep it in its current form so we can continue to point to it in the future as the reason why code style settings should in general apply to only one diagnostic. The new issue would focus on dotnet_style_prefer_collection_expression specifically and its impact on multiple diagnostic IDs.

from roslyn.

cremor avatar cremor commented on June 20, 2024

@sharwell I'm not sure if I understand you correctly.

Build time analysis - which was only enabled for the :severity suffix syntax in #52991 for .NET 9 (AnalysisLevel 9) - might not support this case. Ok, that could be a known limitation (which should be documented).

But are you saying that the current behavior of the IntelliSense analysis is by design too? Should the property EnforceCodeStyleInBuild really influence IntelliSense analysis?

from roslyn.

sharwell avatar sharwell commented on June 20, 2024

@cremor I don't think I understand the question. I was reviewing this issue for the limited case where EnforceCodeStyleInBuild is set to true (step 4 in the initial post). Is there a separate question you have for a scenario where it is set to false?

from roslyn.

cremor avatar cremor commented on June 20, 2024

No, my question is about when it is set to true. But I'm observing the IntelliSense analysis results in the Visual Studio error list. I'm not concerned about build time analysis output (right now).
So while I have set EnforceCodeStyleInBuild to true (for unrelated reasons), it shouldn't affect IntelliSense analysis results in my opinion.

from roslyn.

cremor avatar cremor commented on June 20, 2024

@sharwell (Again using a mention, not sure if you saw my last message.)

I have an additional question. What did you mean with this?

I would recommend filing a bug report specifically for the dotnet_style_prefer_collection_expression if its current configuration is problematic.

Did you only mean that in the context of build time analysis, or for IntelliSense analysis too?

from roslyn.

sharwell avatar sharwell commented on June 20, 2024

No, my question is about when it is set to true. But I'm observing the IntelliSense analysis results in the Visual Studio error list. I'm not concerned about build time analysis output (right now).

My answer above was related to what happens on build when EnforceCodeStyleInBuild is true. If this value is causing a difference in the IDE or some other scenario, I would need to see a description of scenario A and the behavior in scenario A, and a description of scenario B and the behavior in scenario B. At that point we can figure out why the behavior changes.

The EnforceCodeStyleInBuild setting should only impact IntelliSense behavior for the purpose of making the IDE behavior be the same as the compile-time behavior. Sometimes when this option is false, the IDE does things that the build would not do.

Did you only mean that in the context of build time analysis, or for IntelliSense analysis too?

I'm not aware of a case where it would make a difference here.

from roslyn.

cremor avatar cremor commented on June 20, 2024

If this value is causing a difference in the IDE or some other scenario, I would need to see a description of scenario A and the behavior in scenario A, and a description of scenario B and the behavior in scenario B. At that point we can figure out why the behavior changes.

@sharwell The description is this issue. If I understand you correctly then scenario A is step 3 and scenario B is step 5 of my first post here.

from roslyn.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.