Skip to content

Instantly share code, notes, and snippets.

@eugeneego
Created May 1, 2017 18:22
Show Gist options
  • Save eugeneego/90d36f63743c9100022a52130ba15f64 to your computer and use it in GitHub Desktop.
Save eugeneego/90d36f63743c9100022a52130ba15f64 to your computer and use it in GitHub Desktop.
EE SwiftLint configuration
disabled_rules:
- todo
- nesting
- missing_docs
- valid_docs
- type_body_length
- redundant_string_enum_value
- trailing_comma
- vertical_parameter_alignment
opt_in_rules:
excluded:
- Carthage
- Pods
- ThirdParty
- Vendor
- Scripts
- Generated
force_cast: error
force_try: error
force_unwrapping: error
trailing_whitespace:
ignores_empty_lines: false
severity: warning
trailing_newline: error
trailing_semicolon: error
vertical_whitespace:
max_empty_lines: 1
severity: warning
comma: error
colon:
severity: error
opening_brace: error
empty_count: error
legacy_constructor: error
statement_position:
statement_mode: default
severity: error
legacy_constant: error
type_name:
min_length: 4
max_length:
warning: 45
error: 50
excluded:
- T
identifier_name:
max_length:
warning: 40
error: 50
min_length:
error: 3
excluded:
- x
- y
- at
- id
- db
- rs
- to
- in
- me
function_parameter_count:
warning: 10
error: 10
line_length:
warning: 140
error: 160
function_body_length:
warning: 100
error: 200
file_length:
warning: 500
error: 1000
cyclomatic_complexity:
warning: 20
error: 30
large_tuple:
warning: 4
error: 5
reporter: 'xcode'
custom_rules:
comments_space:
name: 'Space After Comment'
regex: '(^ *//\w+)'
message: 'There should be a space after //'
severity: warning
empty_first_line:
name: 'Empty First Line'
regex: '(^[ a-zA-Z ]*(?:protocol|extension|class|struct|func) [ a-zA-Z0-9:,<>\.\(\)\"-=`]*\{\n( *)?\n)'
message: 'There should not be an empty line after a declaration'
severity: error
empty_line_after_guard:
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
empty_line_after_super:
name: 'Empty Line After Super'
regex: '(^ *super\.[ a-zA-Z0-9=?.\(\)\{\}:,><!`\"]*\n *(?!(?:\}|return))\S+)'
message: 'There should be an empty line after super'
severity: error
custom_colon:
name: 'Custom Colon'
regex: '(?<!swiftlint|HH|mm|h|\"H|''H|\sH):([^\-\)\"\s\\\/\]])'
message: 'Colons should be next to the identifier when specifying a type.'
severity: error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment