Skip to content

Commit

Permalink
add changelog entry and generalize tests for opt-in rules
Browse files Browse the repository at this point in the history
  • Loading branch information
jpsim committed Jan 13, 2016
1 parent eca546d commit 324fa7e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@
[JP Simard](https://github.com/jpsim)
[#256](https://github.com/realm/SwiftLint/issues/256)

* Add opt-in "Missing Docs" rule to detect undocumented public declarations.
[JP Simard](https://github.com/jpsim)

##### Bug Fixes

* AutoCorrect for TrailingNewlineRule only removes at most one line.
Expand Down
6 changes: 4 additions & 2 deletions Source/SwiftLintFrameworkTests/ConfigurationTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import SwiftLintFramework
import SourceKittenFramework
import XCTest

let optInRules = masterRuleList.list.filter({ $0.1.init() is OptInRule }).map({ $0.0 })

class ConfigurationTests: XCTestCase {
func testInit() {
XCTAssert(Configuration(dict: [:]) != nil,
Expand All @@ -36,7 +38,7 @@ class ConfigurationTests: XCTestCase {
["nesting", "todo"],
"initializing Configuration with valid rules in Dictionary should succeed")
let expectedIdentifiers = Array(masterRuleList.list.keys)
.filter({ !["nesting", "todo", "missing_docs"].contains($0) })
.filter({ !(["nesting", "todo"] + optInRules).contains($0) })
let configuredIdentifiers = disabledConfig.rules.map {
$0.dynamicType.description.identifier
}
Expand All @@ -57,7 +59,7 @@ class ConfigurationTests: XCTestCase {
[validRule],
"initializing Configuration with valid rules in YAML string should succeed")
let expectedIdentifiers = Array(masterRuleList.list.keys)
.filter({ ![validRule, "missing_docs"].contains($0) })
.filter({ !([validRule] + optInRules).contains($0) })
let configuredIdentifiers = configuration.rules.map {
$0.dynamicType.description.identifier
}
Expand Down

0 comments on commit 324fa7e

Please sign in to comment.