Update --suite-name-format default value to preserve#2441
Merged
Conversation
- Add testKeepSuiteWithDisplayNameWhenSuiteNameFormatIsPreserve in RedundantSwiftTestingSuiteTests: verifies both rules together with suiteNameFormat: .preserve keep @suite("Name") intact - Add testSuitePreserveKeepsDisplayNameWithBothRules in SwiftTestingTestCaseNamesTests: verifies both rules with preserve leave the display name unchanged Co-authored-by: calda <1811727+calda@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add option to disable name removal in swiftTestingTestCaseNames
Add tests verifying Mar 11, 2026
suiteNameFormat: .preserve prevents @Suite("Name") removal
Collaborator
|
@copilot, let's also make |
Collaborator
|
Fixes #2439 |
- Update default value in Options.swift - Update tests that relied on standardIdentifiers default to explicitly pass suiteNameFormat: .standardIdentifiers Co-authored-by: calda <1811727+calda@users.noreply.github.com>
Contributor
Author
Copilot
AI
changed the title
Add tests verifying
Make Mar 11, 2026
suiteNameFormat: .preserve prevents @Suite("Name") removalsuiteNameFormat default to preserve and add tests for @Suite("Name") interaction
suiteNameFormat default to preserve and add tests for @Suite("Name") interaction--suite-name-format default value to preserve
Collaborator
|
@copilot please fix test failures |
Rules.md is auto-generated; running MetadataTests.testGenerateRulesDocumentation regenerated it to show "preserve (default)" instead of "standard-identifiers (default)". Co-authored-by: calda <1811727+calda@users.noreply.github.com>
Contributor
Author
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #2441 +/- ##
========================================
Coverage 95.28% 95.29%
========================================
Files 165 165
Lines 25147 25147
========================================
+ Hits 23962 23964 +2
+ Misses 1185 1183 -2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
calda
added a commit
that referenced
this pull request
Apr 11, 2026
Co-authored-by: calda <1811727+calda@users.noreply.github.com>
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.
swiftTestingTestCaseNamessupportssuiteNameFormat: .preserveto prevent stripping display name strings from@Suite. This PR makespreservethe default forsuiteNameFormat, and adds tests to document the interaction between the two rules—specifically thatredundantSwiftTestingSuiteonly removes@Suite("Name")afterswiftTestingTestCaseNamesstrips the string argument, not independently.Changes
Options.swift: Changed the default value ofsuiteNameFormatfrom.standardIdentifiersto.preserve. This means@Suite("Name")is preserved by default; users must opt into--suite-name-format standard-identifiersorraw-identifiersto have the display name stripped.Rules.md: Regenerated to reflect the updated default, now showing"preserve" (default)for--suite-name-format.RedundantSwiftTestingSuiteTests: AddedtestKeepSuiteWithDisplayNameWhenSuiteNameFormatIsPreserve— runs both rules together withsuiteNameFormat: .preserveand verifies@Suite("Display Name")is left untouched (the string stays, so the attribute isn't redundant).SwiftTestingTestCaseNamesTests: AddedtestSuitePreserveKeepsDisplayNameWithBothRules— same scenario from the other rule's perspective; both rules active withsuiteNameFormat: .preserveleave@Suite("My Feature Tests")unchanged.Test updates: Updated tests that previously relied on the
.standardIdentifiersdefault to explicitly passsuiteNameFormat: .standardIdentifiers.The existing
testRemovesTestSuiteWithOnlyStringArgument(both rules, with explicitsuiteNameFormat: .standardIdentifiers) covers the opt-in case:swiftTestingTestCaseNamesstrips the string →redundantSwiftTestingSuiteremoves the now-empty@Suite.Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.