Comments (5)
.NET 8 and C# 12 were released yesterday and so this is now an issue with production code. For now, I've had to disable the SA1010 rule for our code until this can be fixed. Please can this be fixed as quickly as possible.
from stylecopanalyzers.
I hit this when telling VS to make fixes for Use collection initializers (IDE0028). It will automatically create statements that trigger SA1010. For example:
List<string> foo = [];
from stylecopanalyzers.
I assume that .NET 8 and C# 12 will be released very soon now. This fix is probably trivial, but what do you think about adding a new test project, @sharwell? Should it wait until you are done with your updates to the test projects (#3675 (comment)), or can it be done now? If you would like to wait, do you have any estimate of when you will be done?
from stylecopanalyzers.
I'm unsure if all the various cases are being tracked or accounted for, but I thought I would report that SA1010 also fires during coalesce, coalesce assign, and ternary operations.
List<string>? list = default;
// fires on coalesce
List<string> otherList = list ?? [];
// fires on ternary
List<string> anotherList = list is null ? [] : list;
// fires on coalesce assigement
list ??= [];
from stylecopanalyzers.
Hit this in a few places.
ctors = [.. ctors.OrderByDescending(info => info.GetParameters().Length)];
object result = TypesManager.InvokeGenericStaticMethod(typeof(ServiceLocator), nameof(ResolveMock), [type]);
if (request.OtherEmails != null)
{
emails = [.. request.OtherEmails.Split([';', ','])];
}
public static readonly string[] AllBlastRadiusStrings = [SingleNode, SingleCustomer, SingleScaleUnitSlicePartition, SingleScaleUnit, SingleRack, SingleCluster, SingleAZ, SingleRegion, MultipleRacks, MultipleClusters, MultipleAZs, MultipleRegions, Global, Other];
from stylecopanalyzers.
Related Issues (20)
- SA1600 should not trigger for explicit interface implementations HOT 7
- SA1313: False positive for records HOT 2
- SA1513 triggered on object initializer inside collection expression HOT 1
- Analyzer proposal: prefer `or` instead of multiple `case` that follow through HOT 3
- New feature: Support for Inline-SQL with Verbatim String Literals as a Formatting Indicator HOT 6
- SA1600 doesn't seem to work for record types HOT 1
- New rule: multiple conditions for an if-statement should be intended HOT 2
- SA1009 triggers when having the closing parenthesis on a single line HOT 2
- StyleCop schema file URL is getting timed out HOT 1
- SA1134 exception for auto-properties HOT 1
- SA1119 false positive for parenthesis around `x switch {}` expression HOT 3
- SA1009 is triggered for the increment in prefix notation
- SA1118 false positive with multi-line collection expressions as arguments HOT 1
- [Question] proper way ot add stylecop.json to a multiproject solution using visual studio code. HOT 3
- SA1648 false positive when implementing static interface members HOT 2
- SA1516 Elements should be separated by blank line - Razor Class Library - csproj file HOT 12
- New Analyzer: Use File Scoped Namespaces HOT 3
- Remove ConfigureAwait(false) in tests? HOT 4
- SA1008 False Positive if a tuple type is assigned an alias via `using`.
- SA1013 allows any number of spaces after list initializer HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stylecopanalyzers.