Skip to content

❇️ Add rcs1200 analyzer#121

Merged
vdebellabre merged 3 commits into
green-code-initiative:mainfrom
QzLP2P:feat/rcs1200/orderbyAndThenBy
May 20, 2026
Merged

❇️ Add rcs1200 analyzer#121
vdebellabre merged 3 commits into
green-code-initiative:mainfrom
QzLP2P:feat/rcs1200/orderbyAndThenBy

Conversation

@QzLP2P
Copy link
Copy Markdown
Contributor

@QzLP2P QzLP2P commented May 19, 2026

No description provided.

@QzLP2P QzLP2P force-pushed the feat/rcs1200/orderbyAndThenBy branch from 60cfb6c to 3f758d4 Compare May 19, 2026 15:39
@vdebellabre vdebellabre requested a review from Copilot May 19, 2026 15:44
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a new Creedengo analyzer (GCI98) to detect LINQ sort chains where OrderBy/OrderByDescending is used after an existing sort, and provides an automated code fix to switch to ThenBy/ThenByDescending. It also adds a small sandbox project to exercise the rule and a dedicated test suite to validate analyzer + fixer behavior.

Changes:

  • Added GCI98 analyzer + code fix (UseThenByInsteadOfOrderBy / UseThenByInsteadOfOrderByFixer).
  • Added MSTest-based verification coverage for the new analyzer/fixer.
  • Added a Creedengo.Sandbox console project (wired into the solution) with a sample triggering the rule.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/Creedengo.Tests/Tests/GCI98.UseThenByInsteadOfOrderBy.Tests.cs Adds analyzer + code-fix tests for GCI98 scenarios.
src/Creedengo.Sandbox/RCS1200Sandbox.cs Adds a sample LINQ chain intended to trigger the new rule.
src/Creedengo.Sandbox/Program.cs Adds sandbox entry point.
src/Creedengo.Sandbox/Creedengo.Sandbox.csproj Adds sandbox project referencing Creedengo.Core as an analyzer.
src/Creedengo.Core/Models/Rule.cs Adds the new rule ID constant and reformats the file.
src/Creedengo.Core/Analyzers/GCI98.UseThenByInsteadOfOrderBy.Fixer.cs Implements the code fix to replace OrderBy* with ThenBy* in sort chains.
src/Creedengo.Core/Analyzers/GCI98.UseThenByInsteadOfOrderBy.cs Implements the analyzer detecting OrderBy* calls after a prior sort call.
creedengo-csharp.slnx Adds the sandbox project to the solution.
.claude/settings.local.json Adds local Claude permission settings for build/test commands.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/Creedengo.Core/Models/Rule.cs Outdated
Comment thread src/Creedengo.Sandbox/Creedengo.Sandbox.csproj
Comment thread src/Creedengo.Sandbox/RCS1200Sandbox.cs Outdated
QzLP2P and others added 2 commits May 19, 2026 17:49
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@vdebellabre vdebellabre merged commit 1738556 into green-code-initiative:main May 20, 2026
1 check passed
@QzLP2P QzLP2P deleted the feat/rcs1200/orderbyAndThenBy branch May 20, 2026 07:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants