Skip to content

Commit

Permalink
Only enable opt-in rules (+ found some more!)
Browse files Browse the repository at this point in the history
  • Loading branch information
djbe committed Jan 28, 2019
1 parent f1bb3da commit abc29f6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
10 changes: 6 additions & 4 deletions .swiftlint.yml
Expand Up @@ -8,12 +8,14 @@ opt_in_rules:
- closure_end_indentation
- closure_spacing
- collection_alignment
- conditional_returns_on_newline
- contains_over_first_not_nil
- convenience_type
- discouraged_optional_boolean
- discouraged_optional_collection
- empty_count
- empty_string
- empty_xctest_method
- fallthrough
- fatal_error_message
- file_header
Expand All @@ -22,10 +24,8 @@ opt_in_rules:
- identical_operands
- implicit_return
- implicitly_unwrapped_optional
- inert_defer
- joined_default_parameter
- last_where
- legacy_hashing
- legacy_random
- literal_expression_end_indentation
- lower_acl_than_parent
Expand All @@ -45,23 +45,25 @@ opt_in_rules:
- private_outlet
- prohibited_super_call
- redundant_nil_coalescing
- redundant_objc_attribute
- sorted_first_last
- sorted_imports
- static_operator
- strong_iboutlet
- switch_case_on_newline
- toggle_bool
- trailing_closure
- unavailable_function
- unneeded_parentheses_in_closure_argument
- unused_control_flow_label
- vertical_parameter_alignment_on_call
- vertical_whitespace_closing_braces
- vertical_whitespace_opening_braces
- xct_specific_matcher
- yoda_condition

# Rules customization
conditional_returns_on_newline:
if_only: true

file_header:
required_pattern: |
\/\/(
Expand Down
2 changes: 1 addition & 1 deletion Sources/SwiftGenKit/Parsers/Plist/PlistFile.swift
Expand Up @@ -7,7 +7,7 @@
import Foundation
import PathKit

public extension Plist {
extension Plist {
struct File {
let path: Path
let name: String
Expand Down
3 changes: 2 additions & 1 deletion Sources/SwiftGenKit/Stencil/CoreDataContext.swift
Expand Up @@ -127,7 +127,8 @@ extension CoreData.Parser {
baseEntity: CoreData.Entity,
model: CoreData.Model
) -> [String: String] {
if predicateString.isEmpty { return [:] }
guard !predicateString.isEmpty else { return [:] }

let predicate = NSPredicate(format: predicateString, argumentArray: nil)
return substitutionVariables(in: predicate, baseEntity: baseEntity, model: model)
}
Expand Down

0 comments on commit abc29f6

Please sign in to comment.