Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected Missing-Docs on extension declaration #2851

cmillani opened this issue Aug 30, 2019 · 0 comments · Fixed by #2852


Copy link

commented Aug 30, 2019

New Issue Checklist

Describe the bug

When defining an extension of a Class the missing_docs triggers a warning even if the Class definition is documented.

I think we could check and avoid triggering this error on extension declarations, since the class itself will trigger the warning if there is no doc.

Complete output when running SwiftLint, including the stack trace and command used
Loading configuration from '.swiftlint.yml'
Linting Swift files at paths 
Linting 'main.swift' (1/1)
/Users/carlos/Projects/SwiftLinter/TestProject/main.swift:5:8: warning: Missing Docs Violation: public declarations should be documented. (missing_docs)
Done linting! Found 1 violation, 0 serious in 1 file.


  • SwiftLint version (run swiftlint version to be sure)? 0.34.0
  • Installation method used (Homebrew, CocoaPods, building from source, etc)? HomeBrew
  • Paste your configuration file:
opt_in_rules: # some rules are only opt-in
   - missing_docs
  • Are you using nested configurations? no
  • Which Xcode version are you using? Version 10.2.1 (10E1001)
  • Do you have a sample that shows the issue?

echo -e "///Docs\npublic class Foo {\n}\n public extension Foo {\n} " | swiftlint lint --no-cache --use-stdin --enable-all-rules

/// Foo Docs
public class Foo {

public extension Foo {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
2 participants
You can’t perform that action at this time.