Skip to content

Fix orphaned_doc_comment for current doc comment attachment - #6904

Merged
SimplyDanny merged 4 commits into
realm:mainfrom
Hokila:fix-orphaned-doc-comment-6897
Sep 3, 2026
Merged

SimplyDanny merged 4 commits into
realm:mainfrom
Hokila:fix-orphaned-doc-comment-6897

Conversation

@Hokila

@Hokila Hokila commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Summary

Test Plan

  • swift test --filter OrphanedDocCommentRuleGeneratedTests
  • swift test --filter RulesTests/orphanedDocComment
  • swift run swiftlint lint --quiet --no-cache Source/SwiftLintBuiltInRules/Rules/Lint/OrphanedDocCommentRule.swift CHANGELOG.md

Fixes #6897

@SwiftLintBot

SwiftLintBot commented Aug 31, 2026 •

Copy link
Copy Markdown
1 Warning
⚠️ This PR may need tests.
20 Messages
📖 Building this branch resulted in a binary size of 28467.96 KiB vs 28451.68 KiB when built on main (0% larger).
📖 Linting Aerial with this PR took 0.12 s vs 0.11 s on main (9% slower).
📖 Linting Alamofire with this PR took 0.12 s vs 0.12 s on main (0% slower).
📖 Linting Brave with this PR took 0.42 s vs 0.4 s on main (4% slower).
📖 Linting Brigade with this PR took 1.03 s vs 1.03 s on main (0% slower).
📖 Linting DuckDuckGo with this PR took 2.2 s vs 2.13 s on main (3% slower).
📖 Linting Firefox with this PR took 0.87 s vs 0.81 s on main (7% slower).
📖 Linting Kickstarter with this PR took 0.51 s vs 0.51 s on main (0% slower).
📖 Linting Moya with this PR took 0.09 s vs 0.09 s on main (0% slower).
📖 Linting NetNewsWire with this PR took 0.21 s vs 0.2 s on main (4% slower).
📖 Linting Nimble with this PR took 0.1 s vs 0.1 s on main (0% slower).
📖 Linting PocketCasts with this PR took 0.58 s vs 0.56 s on main (3% slower).
📖 Linting Quick with this PR took 0.09 s vs 0.09 s on main (0% slower).
📖 Linting Realm with this PR took 0.23 s vs 0.22 s on main (4% slower).
📖 Linting Sourcery with this PR took 0.17 s vs 0.16 s on main (6% slower).
📖 Linting Swift with this PR took 0.28 s vs 0.26 s on main (7% slower).
📖 Linting SwiftLintPerformanceTests with this PR took 3.79 s vs 3.8 s on main (0% faster).
📖 Linting VLC with this PR took 0.19 s vs 0.19 s on main (0% slower).
📖 Linting Wire with this PR took 0.95 s vs 0.89 s on main (6% slower).
📖 Linting WordPress with this PR took 0.66 s vs 0.63 s on main (4% slower).

Generated by 🚫 Danger

@SimplyDanny

Copy link
Copy Markdown
Collaborator

Did you read my comment in the issue?

Address orphaned doc comment review feedback
@Hokila
Hokila force-pushed the fix-orphaned-doc-comment-6897 branch from cacd9cc to d9b7373 Compare September 2, 2026 02:58
@Hokila

Hokila commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

Sorry for that, I’ve updated the rule to:

  • Keep reporting doc comments separated by regular comments for readability.
  • Report earlier doc comments superseded by a later group after a blank line.
  • Update the examples and changelog.

@Hokila
Hokila force-pushed the fix-orphaned-doc-comment-6897 branch from 5223d6b to 939a28c Compare September 3, 2026 02:50
Comment thread CHANGELOG.md Resolved

@SimplyDanny SimplyDanny left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks @Hokila!

@SimplyDanny
SimplyDanny enabled auto-merge (squash) September 3, 2026 08:41
@SimplyDanny
SimplyDanny merged commit a510662 into realm:main Sep 3, 2026
21 checks passed
@Hokila
Hokila deleted the fix-orphaned-doc-comment-6897 branch September 4, 2026 03:52
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.

orphaned_doc_comment: every triggering example is a doc comment that Swift does attach (rule premise is outdated since Swift 5.10)

3 participants