Fix CA1506 coupling and resolve cross-platform IDE0055 line-ending errors#59
Merged
Merged
Conversation
…rors Split AddIosCommand into per-subcommand methods (build/package/upload) so it no longer exceeds the CA1506 class-coupling threshold (was coupled with 42 types, limit 41). The three handlers are extracted into AddIosBuildSubcommand, AddIosPackageSubcommand, and AddIosUploadSubcommand, matching the existing per-command decomposition pattern in Program.cs. Add explicit eol=crlf .gitattributes rules for .NET source files so they are checked out with CRLF on every platform, matching .editorconfig's end_of_line = crlf. Previously text=auto produced LF working trees on Linux/macOS, causing the IDE0055 formatting analyzer to fail on every line of every source file during non-Windows checkouts (including CI). https://claude.ai/code/session_01R3sUvtkhQACQPZF9ejMgv9
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Addresses all CA1506 (avoid excessive class coupling) violations, and fixes the root cause that was masking them on non-Windows checkouts.
CA1506
Program.AddIosCommandwas coupled with 42 different types (threshold is 41 / more than 40 for a method) because it inlined all three iOS subcommand handlers (build,package,upload). It is now split intoAddIosBuildSubcommand,AddIosPackageSubcommand, andAddIosUploadSubcommand, distributing the coupling so each method stays under the threshold. This matches the existing per-command decomposition pattern already used throughoutProgram.cs.The core library and test project had no CA1506 violations.
IDE0055 line endings (the reason CA1506 was hard to see)
.editorconfigdeclaresend_of_line = crlf, but.gitattributesused only* text=auto, which checks.csfiles out with LF on Linux/macOS. On those platforms (including CI) the IDE0055 formatting analyzer then failed on every line of every source file — ~2000 errors per project — drowning out real diagnostics like CA1506.Added explicit
eol=crlfrules for .NET source files (*.cs,*.csx,*.cake,*.fs,*.fsx,*.vb,*.vbx) so the working tree is consistent with.editorconfigon every platform. The stored blobs are unchanged (git keeps them normalized to LF); only the checkout smudge changes, so this is a clean, content-free fix that holds forever across all OSes.Verification
https://claude.ai/code/session_01R3sUvtkhQACQPZF9ejMgv9
Generated by Claude Code