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

Rule Request: Quick Discouraged Pending Test #1909

Closed
ornithocoder opened this Issue Oct 17, 2017 · 1 comment

Comments

Projects
None yet
2 participants
@ornithocoder
Contributor

ornithocoder commented Oct 17, 2017

There are hella reasons to mark a test as pending. But not many reasons to keep tests as pending forever in the code base. Tests that aren't running are dead code; they make sense as a temporary solution, but not for the eternity. Pending tests should be monitored, reviewed, and refactored every now and then.

This is a rule request to introduce a new opt-in rule, quick_discouraged_pending_test, to warn against pending tests. While some teams might want to have this always on (or off), others might prefer to run it sporadically.

Triggering Examples

class TotoTests: QuickSpec {
   override func spec() {
       xdescribe("foo") { }
   }
}
class TotoTests: QuickSpec {
   override func spec() {
       xcontext("foo") { }
   }
}
class TotoTests: QuickSpec {
   override func spec() {
       xit("foo") { }
   }
}
class TotoTests: QuickSpec {
   override func spec() {
       describe("foo") {
           xit("bar") { }
       }
   }
}
class TotoTests: QuickSpec {
   override func spec() {
       context("foo") {
           xit("bar") { }
       }
   }
}
class TotoTests: QuickSpec {
   override func spec() {
       describe("foo") {
           context("bar") {
               xit("toto") { }
           }
       }
   }
}
class TotoTests: QuickSpec {
   override func spec() {
       pending("foo")
   }
}
class TotoTests: QuickSpec {
   override func spec() {
       xitBehavesLike("foo")
   }
}

ornithocoder added a commit to ornithocoder/personal-fork-swiftlint that referenced this issue Oct 17, 2017

ornithocoder added a commit to ornithocoder/personal-fork-swiftlint that referenced this issue Oct 17, 2017

@ornithocoder

This comment has been minimized.

Show comment
Hide comment
@ornithocoder

ornithocoder Oct 19, 2017

Contributor

Merged in #1911.

Contributor

ornithocoder commented Oct 19, 2017

Merged in #1911.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment