Apply fixes from CodeFactor - #149
Conversation
There was a problem hiding this comment.
Sorry @codefactor-io[bot], you have reached your weekly rate limit of 500000 diff characters.
Please try again later or upgrade to continue using Sourcery
|
CodeFactor found an issue: Complex Method It's currently on: |
|
@greptile review |
Greptile SummaryThe PR applies automated formatting cleanups without changing application logic.
Confidence Score: 4/5The PR appears safe to merge functionally, but its inconsistent carriage-return formatting should be normalized first. The code’s runtime behavior remains unchanged, while the only accepted issue is a non-blocking line-ending and trailing-whitespace regression that makes Git whitespace validation fail. Files Needing Attention: QuickShell.Core/Services/TerminalHostIds.cs, QuickShell/Services/SectionListItems.cs, QuickShell.Run/QuickShellRunSettingsWindow.cs
|
| Filename | Overview |
|---|---|
| QuickShell.Core/Services/TerminalHostIds.cs | Logic is unchanged, but the formatting rewrite introduces embedded carriage returns and fails whitespace validation. |
| QuickShell/Services/SectionListItems.cs | Section-header behavior is unchanged, but mixed line endings collapse multiple logical lines in the diff. |
| QuickShell.Run/QuickShellRunSettingsWindow.cs | The settings behavior is unchanged; many replacement blank lines contain whitespace flagged by Git. |
| scripts/LogoAssetGenerator/Program.cs | Adds precedence-clarifying parentheses without changing the arithmetic results. |
Prompt To Fix All With AI
### Issue 1
QuickShell.Core/Services/TerminalHostIds.cs:2
**Normalize introduced line endings**
The formatting pass introduces carriage-return whitespace throughout the changed source and joins several logical lines into single records in this file and `SectionListItems.cs`. This causes Git whitespace validation to fail and makes subsequent diffs and edits unnecessarily error-prone.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Reviews (1): Last reviewed commit: "[CodeFactor] Apply fixes" | Re-trigger Greptile
| { | ||
| public const string LetWindowsChoose = "system"; | ||
|
|
||
| internal static class TerminalHostIds{ public const string LetWindowsChoose = "system"; |
There was a problem hiding this comment.
Normalize introduced line endings
The formatting pass introduces carriage-return whitespace throughout the changed source and joins several logical lines into single records in this file and SectionListItems.cs. This causes Git whitespace validation to fail and makes subsequent diffs and edits unnecessarily error-prone.
Prompt To Fix With AI
This is a comment left during a code review.
Path: QuickShell.Core/Services/TerminalHostIds.cs
Line: 2
Comment:
**Normalize introduced line endings**
The formatting pass introduces carriage-return whitespace throughout the changed source and joins several logical lines into single records in this file and `SectionListItems.cs`. This causes Git whitespace validation to fail and makes subsequent diffs and edits unnecessarily error-prone.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
There was a problem hiding this comment.
Pull request overview
This pull request applies automated CodeFactor-driven cleanups across the QuickShell solution, primarily focused on formatting/clarity changes in C# sources and a small set of math-expression readability tweaks in the logo asset generator.
Changes:
- Adds explicit parentheses in several arithmetic expressions in the logo poster rendering code to make operator precedence unambiguous.
- Performs whitespace/blank-line cleanup across core services, models, the Run settings UI, and test files.
- Reformats small helper utilities (e.g., section header list items) without intended behavioral changes.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/LogoAssetGenerator/Program.cs | Adds parentheses to clarify math precedence in poster layout calculations. |
| QuickShell/Services/SectionListItems.cs | Reformats section-header helper; affected by line-ending/format rewrite. |
| QuickShell.Run/QuickShellRunSettingsWindow.cs | Removes excess blank lines / whitespace in the settings window UI code. |
| QuickShell.Core/Services/WorkspaceRepositorySnapshot.cs | Minor whitespace cleanup in scoring logic. |
| QuickShell.Core/Services/TerminalHostIds.cs | Reformats terminal host ID helpers; affected by line-ending/format rewrite. |
| QuickShell.Core/Services/TerminalCatalog.cs | Minor whitespace cleanup around interface implementations. |
| QuickShell.Core/Services/ShortcutLaunchFormJson.cs | Whitespace cleanup in Adaptive Card JSON builder helpers. |
| QuickShell.Core/Models/WorkspaceSecurityMetadata.cs | Removes a stray blank line. |
| QuickShell.Core/Models/TerminalShortcut.cs | Whitespace cleanup within the core shortcut model. |
| QuickShell.Core.Tests/WorkspaceTrustCommandTests.cs | Minor whitespace cleanup. |
| QuickShell.Core.Tests/TestQuickShellServicesFactory.cs | Removes a trailing blank line. |
| QuickShell.Core.Tests/RunGlobalQueryTests.cs | Whitespace cleanup in tests. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
|
||
| public static Separator CreateHeader(string sectionTitle) => new(sectionTitle); | ||
| } | ||
| /// <summary>/// Emits CmdPal section headers per PowerToys PR #43952: a <see cref="Separator"/> row/// (no command, non-empty section/title) renders the visible header; stamping/// <see cref="IListItem.Section"/> on normal items does not./// </summary>internal static class SectionListItems{ public static IEnumerable<IListItem> InSection(string sectionTitle, IEnumerable<IListItem> items) { var materialized = items.ToList(); |
| namespace QuickShell.Services; | ||
|
|
||
| internal static class TerminalHostIds | ||
| { | ||
| public const string LetWindowsChoose = "system"; | ||
|
|
||
| internal static class TerminalHostIds{ public const string LetWindowsChoose = "system"; | ||
| public const string WindowsTerminal = "wt"; | ||
|
|
||
| public const string WindowsConsoleHost = "conhost"; | ||
|
|
||
| public const string IntelligentTerminal = "it"; |
CodeFactor's formatting pass left bare CR and CRCRLF endings that collapsed braces onto single records and broke Git whitespace handling. Co-authored-by: Cursor <cursoragent@cursor.com>
|
PR author is in the excluded authors list. |
Extract match collection and ranking comparison so CodeFactor's Complex Method finding on the nested launch scan no longer applies. Co-authored-by: Cursor <cursoragent@cursor.com>
This pull request applies fixes from code review by CodeFactor.
For more information, click here.