 import SourceKittenFramework
 
 private let fileManager = NSFileManager.defaultManager()
+
+private enum ConfigurationKey: String {
+    case DisabledRules = "disabled_rules"
+    case EnabledRules = "enabled_rules" // deprecated in favor of OptInRules
+    case Excluded = "excluded"
+    case Included = "included"
+    case OptInRules = "opt_in_rules"
+    case Reporter = "reporter"
+    case UseNestedConfigs = "use_nested_configs"
+    case WhitelistRules = "whitelist_rules"
+}
 
 public struct Configuration: Equatable {
     public static let fileName = ".swiftlint.yml"

    }

    public init?(dict: [String: AnyObject]) {

        // Deprecation warning for "enabled_rules"
        if dict["enabled_rules"] != nil {
            queuedPrint("'enabled_rules' has been renamed to 'opt_in_rules' " +
                "and will be completely removed in a future release.")
        }

        // Use either new 'opt_in_rules' or deprecated 'enabled_rules' for now.
        let optInRules = dict["opt_in_rules"] as? [String] ??
            dict["enabled_rules"] as? [String] ?? []

        self.init(
            disabledRules: dict["disabled_rules"] as? [String] ?? [],
            optInRules: optInRules,
            whitelistRules: dict["whitelist_rules"] as? [String] ?? [],
            included: dict["included"] as? [String] ?? [],
            excluded: dict["excluded"] as? [String] ?? [],
            reporter: dict["reporter"] as? String ?? XcodeReporter.identifier,
            useNestedConfigs: dict["use_nested_configs"] as? Bool ?? false,
            configuredRules: masterRuleList.configuredRulesWithDictionary(dict)
        )
    }

        // white_list rules take precendence over all else.
        if !whitelistRules.isEmpty {
            if !disabledRules.isEmpty || !optInRules.isEmpty {
                queuedPrintError("'\(ConfigurationKey.DisabledRules.rawValue)' or " +
                    "'\(ConfigurationKey.OptInRules.rawValue)' cannot be used in combination " +
                    "with '\(ConfigurationKey.WhitelistRules.rawValue)'")
                return nil
            }

