Code Monkey home page Code Monkey logo

Comments (4)

sharwell avatar sharwell commented on July 22, 2024

This is fine to fix. Can also likely work around:

partial struct Money :
#if !NETSTANDARD
    ISpanFormattable,
#endif
    IFormattable

Or:

partial struct Money
#if NET6_OR_GREATER
    : ISpanFormattable
#else
    : IFormattable
#endif

from stylecopanalyzers.

mikernet avatar mikernet commented on July 22, 2024

Good point, didn't think of that tbh.
Another one, before:

public readonly struct BigDecimal : IComparable<BigDecimal>, IEquatable<BigDecimal>, IComparable, IFormattable
#if NET7_0_OR_GREATER
#pragma warning disable SA1001 // Commas should be spaced correctly
    , IFloatingPoint<BigDecimal>
#pragma warning restore SA1001
#endif

After:

public readonly struct BigDecimal :
#if NET7_0_OR_GREATER
    IFloatingPoint<BigDecimal>,
#endif
    IComparable<BigDecimal>, IEquatable<BigDecimal>, IComparable, IFormattable

That works for me.

from stylecopanalyzers.

mikernet avatar mikernet commented on July 22, 2024

Given that there is a suitable alternative form that avoids the warning, I'm fine with this being closed if you don't think it is needed. I prefer the suggested workaround anyway, the leading comma bothered me haha.

from stylecopanalyzers.

sharwell avatar sharwell commented on July 22, 2024

I'm leaving this open because it's fairly standard for us to ignore the end-of-line/beginning-of-line rules in the presence of preprocessor directives. We could either ignore all directives here, or we could just ignore conditional directives (#if/#elif/#else/#endif). I think I lean towards the latter.

from stylecopanalyzers.

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.