From 418f62df913871027e92db9db31ed5d9812f1a2b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Mar 2026 21:45:59 +0000 Subject: [PATCH 1/2] chore(deps): Bump actions/upload-artifact from 4 to 7 (#409) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4 to 7.
Release notes

Sourced from actions/upload-artifact's releases.

v7.0.0

v7 What's new

Direct Uploads

Adds support for uploading single files directly (unzipped). Callers can set the new archive parameter to false to skip zipping the file during upload. Right now, we only support single files. The action will fail if the glob passed resolves to multiple files. The name parameter is also ignored with this setting. Instead, the name of the artifact will be the name of the uploaded file.

ESM

To support new versions of the @actions/* packages, we've upgraded the package to ESM.

What's Changed

New Contributors

Full Changelog: https://github.com/actions/upload-artifact/compare/v6...v7.0.0

v6.0.0

v6 - What's new

[!IMPORTANT] actions/upload-artifact@v6 now runs on Node.js 24 (runs.using: node24) and requires a minimum Actions Runner version of 2.327.1. If you are using self-hosted runners, ensure they are updated before upgrading.

Node.js 24

This release updates the runtime to Node.js 24. v5 had preliminary support for Node.js 24, however this action was by default still running on Node.js 20. Now this action by default will run on Node.js 24.

What's Changed

Full Changelog: https://github.com/actions/upload-artifact/compare/v5.0.0...v6.0.0

v5.0.0

What's Changed

BREAKING CHANGE: this update supports Node v24.x. This is not a breaking change per-se but we're treating it as such.

... (truncated)

Commits

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=actions/upload-artifact&package-manager=github_actions&previous-version=4&new-version=7)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/dotnetBuild.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dotnetBuild.yml b/.github/workflows/dotnetBuild.yml index 10e850d..d81a0bf 100644 --- a/.github/workflows/dotnetBuild.yml +++ b/.github/workflows/dotnetBuild.yml @@ -60,7 +60,7 @@ jobs: run: dotnet pack IntelliTect.Analyzer/IntelliTect.Analyzer/IntelliTect.Analyzer.csproj --configuration Release --no-build --output ./nupkg - name: Upload NuGet Package - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: analyzer-nupkg path: ./nupkg/*.nupkg From b1cb7cd4753a7326c1093c6b2e94b29505d18fd3 Mon Sep 17 00:00:00 2001 From: Benjamin Michaelis Date: Mon, 16 Mar 2026 16:58:55 -0700 Subject: [PATCH 2/2] fix: INTL0101 code fix NotImplementedException for non-class declaration types (#411) ## Description Describe your changes here. Fixes #Issue_Number (if available) ### Ensure that your pull request has followed all the steps below: - [ ] Code compilation - [ ] Created tests which fail without the change (if possible) - [ ] All tests passing - [ ] Extended the README / documentation, if necessary Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../AttributesOnSeparateLines.cs | 35 +- .../AttributesOnSeparateLinesTests.cs | 306 ++++++++++++++++++ 2 files changed, 311 insertions(+), 30 deletions(-) diff --git a/IntelliTect.Analyzer/IntelliTect.Analyzer.CodeFixes/AttributesOnSeparateLines.cs b/IntelliTect.Analyzer/IntelliTect.Analyzer.CodeFixes/AttributesOnSeparateLines.cs index d8f6e9d..c3f7b86 100644 --- a/IntelliTect.Analyzer/IntelliTect.Analyzer.CodeFixes/AttributesOnSeparateLines.cs +++ b/IntelliTect.Analyzer/IntelliTect.Analyzer.CodeFixes/AttributesOnSeparateLines.cs @@ -1,5 +1,4 @@ using System; -using System.Collections.Generic; using System.Collections.Immutable; using System.Composition; using System.Linq; @@ -48,8 +47,8 @@ public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) attributeList = attributeList.Parent; } - // Get the class, method or property adjacent to the AttributeList - if (attributeList?.Parent is not SyntaxNode parentDeclaration) + // Get the member declaration adjacent to the AttributeList + if (attributeList?.Parent is not MemberDeclarationSyntax parentDeclaration) { return; } @@ -63,12 +62,12 @@ public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) diagnostic); } - private static async Task PutOnSeparateLine(Document document, SyntaxNode parentDeclaration, CancellationToken cancellationToken) + private static async Task PutOnSeparateLine(Document document, MemberDeclarationSyntax parentDeclaration, CancellationToken cancellationToken) { var attributeLists = new SyntaxList(); // put every attribute into it's own attributelist eg.: [A,B,C] => [A][B][C] - foreach (AttributeSyntax attribute in GetAttributeListSyntaxes(parentDeclaration).SelectMany(l => l.Attributes)) + foreach (AttributeSyntax attribute in parentDeclaration.AttributeLists.SelectMany(l => l.Attributes)) { attributeLists = attributeLists.Add( SyntaxFactory.AttributeList( @@ -80,7 +79,7 @@ private static async Task PutOnSeparateLine(Document document, SyntaxN } // the formatter-annotation will wrap every attribute on a separate line - SyntaxNode newNode = BuildNodeWithAttributeLists(parentDeclaration, attributeLists) + MemberDeclarationSyntax newNode = parentDeclaration.WithAttributeLists(attributeLists) .WithAdditionalAnnotations(Formatter.Annotation); // Replace the old local declaration with the new local declaration. @@ -90,29 +89,5 @@ private static async Task PutOnSeparateLine(Document document, SyntaxN return document.WithSyntaxRoot(newRoot); } - - private static IEnumerable GetAttributeListSyntaxes(SyntaxNode node) - { - return node switch - { - ClassDeclarationSyntax c => c.AttributeLists, - MethodDeclarationSyntax m => m.AttributeLists, - PropertyDeclarationSyntax p => p.AttributeLists, - FieldDeclarationSyntax f => f.AttributeLists, - _ => throw new NotImplementedException(), - }; - } - - private static SyntaxNode BuildNodeWithAttributeLists(SyntaxNode node, SyntaxList attributeLists) - { - return node switch - { - ClassDeclarationSyntax c => c.WithAttributeLists(attributeLists), - MethodDeclarationSyntax m => m.WithAttributeLists(attributeLists), - PropertyDeclarationSyntax p => p.WithAttributeLists(attributeLists), - FieldDeclarationSyntax f => f.WithAttributeLists(attributeLists), - _ => throw new NotImplementedException(), - }; - } } } diff --git a/IntelliTect.Analyzer/IntelliTect.Analyzer.Test/AttributesOnSeparateLinesTests.cs b/IntelliTect.Analyzer/IntelliTect.Analyzer.Test/AttributesOnSeparateLinesTests.cs index b64e6ad..5125273 100644 --- a/IntelliTect.Analyzer/IntelliTect.Analyzer.Test/AttributesOnSeparateLinesTests.cs +++ b/IntelliTect.Analyzer/IntelliTect.Analyzer.Test/AttributesOnSeparateLinesTests.cs @@ -390,6 +390,312 @@ static void Main() await VerifyCSharpFix(test, fixTest); } + [TestMethod] + public async Task StructAttributeLineViolation_CodeFix_TwoAttributesOnSameLine_TwoAttributesOnSeparateLines() + { + string test = @"using System; + +namespace ConsoleApp +{ + class AAttribute : Attribute + { + } + + class BAttribute : Attribute + { + } + + [A][B] + struct MyStruct + { + } +}"; + + string fixTest = @"using System; + +namespace ConsoleApp +{ + class AAttribute : Attribute + { + } + + class BAttribute : Attribute + { + } + + [A] + [B] + struct MyStruct + { + } +}"; + await VerifyCSharpFix(test, fixTest); + } + + [TestMethod] + public async Task RecordAttributeLineViolation_CodeFix_TwoAttributesOnSameLine_TwoAttributesOnSeparateLines() + { + string test = @"using System; + +namespace ConsoleApp +{ + class AAttribute : Attribute + { + } + + class BAttribute : Attribute + { + } + + [A][B] + record MyRecord + { + } +}"; + + string fixTest = @"using System; + +namespace ConsoleApp +{ + class AAttribute : Attribute + { + } + + class BAttribute : Attribute + { + } + + [A] + [B] + record MyRecord + { + } +}"; + await VerifyCSharpFix(test, fixTest); + } + + [TestMethod] + public async Task InterfaceAttributeLineViolation_CodeFix_TwoAttributesOnSameLine_TwoAttributesOnSeparateLines() + { + string test = @"using System; + +namespace ConsoleApp +{ + class AAttribute : Attribute + { + } + + class BAttribute : Attribute + { + } + + [A][B] + interface IMyInterface + { + } +}"; + + string fixTest = @"using System; + +namespace ConsoleApp +{ + class AAttribute : Attribute + { + } + + class BAttribute : Attribute + { + } + + [A] + [B] + interface IMyInterface + { + } +}"; + await VerifyCSharpFix(test, fixTest); + } + + [TestMethod] + public async Task EnumAttributeLineViolation_CodeFix_TwoAttributesOnSameLine_TwoAttributesOnSeparateLines() + { + string test = @"using System; + +namespace ConsoleApp +{ + class AAttribute : Attribute + { + } + + class BAttribute : Attribute + { + } + + [A][B] + enum MyEnum + { + Foo + } +}"; + + string fixTest = @"using System; + +namespace ConsoleApp +{ + class AAttribute : Attribute + { + } + + class BAttribute : Attribute + { + } + + [A] + [B] + enum MyEnum + { + Foo + } +}"; + await VerifyCSharpFix(test, fixTest); + } + + [TestMethod] + public async Task ConstructorAttributeLineViolation_CodeFix_TwoAttributesOnSameLine_TwoAttributesOnSeparateLines() + { + string test = @"using System; + +namespace ConsoleApp +{ + class AAttribute : Attribute + { + } + + class BAttribute : Attribute + { + } + + class Program + { + [A][B] + Program() + { + } + } +}"; + + string fixTest = @"using System; + +namespace ConsoleApp +{ + class AAttribute : Attribute + { + } + + class BAttribute : Attribute + { + } + + class Program + { + [A] + [B] + Program() + { + } + } +}"; + await VerifyCSharpFix(test, fixTest); + } + + [TestMethod] + public async Task EnumMemberAttributeLineViolation_CodeFix_TwoAttributesOnSameLine_TwoAttributesOnSeparateLines() + { + string test = @"using System; + +namespace ConsoleApp +{ + class AAttribute : Attribute + { + } + + class BAttribute : Attribute + { + } + + enum MyEnum + { + [A][B] + Bar + } +}"; + + string fixTest = @"using System; + +namespace ConsoleApp +{ + class AAttribute : Attribute + { + } + + class BAttribute : Attribute + { + } + + enum MyEnum + { + [A] + [B] + Bar + } +}"; + await VerifyCSharpFix(test, fixTest); + } + + [TestMethod] + public async Task IndexerAttributeLineViolation_CodeFix_TwoAttributesOnSameLine_TwoAttributesOnSeparateLines() + { + string test = @"using System; + +namespace ConsoleApp +{ + class AAttribute : Attribute + { + } + + class BAttribute : Attribute + { + } + + class Program + { + [A][B] + int this[int i] { get => 0; } + } +}"; + + string fixTest = @"using System; + +namespace ConsoleApp +{ + class AAttribute : Attribute + { + } + + class BAttribute : Attribute + { + } + + class Program + { + [A] + [B] + int this[int i] { get => 0; } + } +}"; + await VerifyCSharpFix(test, fixTest); + } + [TestMethod] [Description("Analyzer should not report on generated code")] public void AttributesOnSameLine_InGeneratedCode_NoDiagnostic()