Skip to content

Instantly share code, notes, and snippets.

@ignazioc
Created March 2, 2018 08:54
Show Gist options
  • Save ignazioc/ec6740ae2067f6648ca85c319da6d663 to your computer and use it in GitHub Desktop.
Save ignazioc/ec6740ae2067f6648ca85c319da6d663 to your computer and use it in GitHub Desktop.
disabled_rules: # rule identifiers to exclude from running
- line_length
- function_body_length
- cyclomatic_complexity
- multiple_closures_with_trailing_closure
- xctfail_message
# Swift 3 rules that do not make sense for Swift 2.3
- implicit_getter
identifier_name:
min_length:
warning: 1
error: 1
max_length:
warning: 60
error: 80
type_name:
max_length:
warning: 60
error: 100
type_body_length:
warning: 300
error: 400
file_length:
warning: 700
error: 800
excluded:
- eBay Kleinanzeigen/External
- eBay Kleinanzeigen/GeneratedCode
- Unit Tests/GeneratedCode
- Pods
function_parameter_count:
warning: 7
error: 10
large_tuple:
warning: 3
opt_in_rules: # some rules are only opt-in
- closure_end_indentation
- closure_spacing
- syntactic_sugar
- redundant_nil_coalescing
- number_separator
# - sorted_imports I would like to have this rule, but there is no autocorrection...therefore is quite annoying.
- overridden_super_call
- object_literal
- explicit_init
- first_where
number_separator:
minimum_length: 7
custom_rules:
double_space: # from https://github.com/IBM-Swift/Package-Builder
include: "*.swift"
name: "Double space"
regex: '([a-z,A-Z] \s+)'
message: "Double space between keywords"
match_kinds: keyword
severity: warning
comments_space: # from https://github.com/brandenr/swiftlintconfig
name: "Space After Comment"
regex: '(^ *//\w+)'
message: "There should be a space after //"
severity: error
empty_line_after_guard: # from https://github.com/brandenr/swiftlintconfig
name: "Empty Line After Guard"
regex: '(^ *guard[ a-zA-Z0-9=?.\(\),><!]*\{[ a-zA-Z0-9=?.\(\),><!]*\}\n *(?!(?:return|guard))\S+)'
message: "There should be an empty line after a guard"
severity: error
unnecessary_type: # from https://github.com/brandenr/swiftlintconfig
name: "Unnecessary Type"
regex: '[ a-zA-Z0-9]*(?:let|var) [ a-zA-Z0-9]*: ([a-zA-Z0-9]*)[ ]*= \1'
message: "Type Definition Not Needed"
severity: error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment