122 lines
2.4 KiB
YAML
122 lines
2.4 KiB
YAML
# SwiftLint configuration
|
|
# Rule directory: https://realm.github.io/SwiftLint/rule-directory.html
|
|
# GitHub: https://github.com/realm/SwiftLint
|
|
|
|
excluded:
|
|
- Pods
|
|
- docs
|
|
- build
|
|
- scripts
|
|
- swiftpm
|
|
- .bundle
|
|
- vendor
|
|
|
|
disabled_rules:
|
|
# idiomatic
|
|
- force_cast
|
|
|
|
opt_in_rules:
|
|
# performance
|
|
- empty_count
|
|
- first_where
|
|
- sorted_first_last
|
|
- contains_over_first_not_nil
|
|
- last_where
|
|
- reduce_into
|
|
- contains_over_filter_count
|
|
- contains_over_filter_is_empty
|
|
- empty_collection_literal
|
|
- type_contents_order
|
|
|
|
# idiomatic
|
|
- fatal_error_message
|
|
- xctfail_message
|
|
- discouraged_object_literal
|
|
- discouraged_optional_boolean
|
|
- discouraged_optional_collection
|
|
- for_where
|
|
- function_default_parameter_at_end
|
|
- legacy_random
|
|
- no_extension_access_modifier
|
|
- redundant_type_annotation
|
|
- static_operator
|
|
- toggle_bool
|
|
- unavailable_function
|
|
- no_space_in_method_call
|
|
- discouraged_assert
|
|
- legacy_objc_type
|
|
- file_name
|
|
- file_name_no_space
|
|
- discouraged_none_name
|
|
|
|
# style
|
|
- attributes
|
|
- number_separator
|
|
- operator_usage_whitespace
|
|
- sorted_imports
|
|
- vertical_parameter_alignment_on_call
|
|
- void_return
|
|
- closure_spacing
|
|
- empty_enum_arguments
|
|
- implicit_return
|
|
- modifier_order
|
|
- multiline_parameters
|
|
- trailing_closure
|
|
- unneeded_parentheses_in_closure_argument
|
|
- vertical_whitespace_between_cases
|
|
- prefer_self_in_static_references
|
|
|
|
# lint
|
|
- overridden_super_call
|
|
- override_in_extension
|
|
- yoda_condition
|
|
- array_init
|
|
- empty_xctest_method
|
|
- identical_operands
|
|
- prohibited_super_call
|
|
- unused_capture_list
|
|
- duplicate_enum_cases
|
|
- legacy_multiple
|
|
|
|
# Rules run by `swiftlint analyze` (experimental)
|
|
analyzer_rules:
|
|
- unused_import
|
|
- unused_declaration
|
|
- explicit_self
|
|
- capture_variable
|
|
|
|
line_length: 200
|
|
file_length: 600
|
|
|
|
type_body_length: 500
|
|
function_body_length: 250
|
|
|
|
cyclomatic_complexity: 10
|
|
|
|
nesting:
|
|
type_level: 2
|
|
function_level: 2
|
|
check_nesting_in_closures_and_statements: true
|
|
always_allow_one_type_in_functions: false
|
|
|
|
identifier_name:
|
|
allowed_symbols: ['_']
|
|
|
|
type_contents_order:
|
|
order:
|
|
- associated_type
|
|
- type_alias
|
|
- case
|
|
- subtype
|
|
- type_property
|
|
- ib_outlet
|
|
- ib_inspectable
|
|
- instance_property
|
|
- initializer
|
|
- deinitializer
|
|
- subscript
|
|
- type_method
|
|
- view_life_cycle_method
|
|
- ib_action
|
|
- other_method
|