CotEditor/.swiftlint.yml
2024-06-30 23:46:07 +09:00

138 lines
2.7 KiB
YAML

deployment_target:
macOS_deployment_target: 14
excluded:
- "*/.build"
analyzer_rules:
- capture_variable
- typesafe_array_init
- unused_declaration
- unused_import
opt_in_rules:
- array_init
- closure_end_indentation
- closure_spacing
- collection_alignment
- contains_over_filter_count
- contains_over_filter_is_empty
- contains_over_first_not_nil
- discarded_notification_center_observer
- discouraged_assert
- empty_collection_literal
- empty_string
- empty_xctest_method
- explicit_init
- fallthrough
- file_header
- file_name_no_space
- first_where
- flatmap_over_map_reduce
- ibinspectable_in_extension
- identical_operands
- joined_default_parameter
- last_where
- legacy_multiple
- let_var_whitespace
- lower_acl_than_parent
- multiline_function_chains
- multiline_parameters
- multiline_parameters_brackets
- nimble_operator
- optional_enum_case_matching
- overridden_super_call
- prefer_self_type_over_type_of_self
- prefer_zero_over_explicit_init
- private_outlet
- prohibited_super_call
- quick_discouraged_call
- quick_discouraged_focused_test
- quick_discouraged_pending_test
- raw_value_for_camel_cased_codable_enum
- reduce_into
- redundant_nil_coalescing
- required_enum_case
- single_test_class
- sorted_first_last
- toggle_bool
- vertical_parameter_alignment_on_call
- xct_specific_matcher
- yoda_condition
disabled_rules:
- block_based_kvo
- control_statement
- force_cast
- force_try
- identifier_name
- opening_brace
- static_over_final_class
- switch_case_alignment
- trailing_comma
- unneeded_override
trailing_whitespace:
ignores_empty_lines: true
function_parameter_count:
warning: 6
nesting:
type_level:
warning: 2
vertical_whitespace:
max_empty_lines: 3
file_length:
warning: 2000
line_length:
warning: 1000
type_body_length:
warning: 1000
function_body_length:
warning: 350
large_tuple:
warning: 3
cyclomatic_complexity:
warning: 30
identifier_name:
max_length:
warning: 50
min_length:
warning: 2
excluded:
- x
- y
custom_rules:
comment_space:
name: "Space After Comment"
regex: '//\S'
match_kinds:
- comment
message: "There should be a space after a comment delimiter."
severity: warning
inline_comment_spaces:
name: "Spaces Before Inline Comment"
regex: '\S ?//'
match_kinds:
- comment
message: "There should be more than 2 spaces before an inline comment."
severity: warning
empty_first_line:
name: "Empty First Line"
regex: '(^[ a-zA-Z ]*(?:protocol|extension|class|struct) (?!(?:var|let))[ a-zA-Z:]*\{\n *\S+)'
message: "There should be an empty line after a declaration"
severity: warning