86 lines
2.2 KiB
YAML
86 lines
2.2 KiB
YAML
# Отключаемые условия
|
|
disabled_rules:
|
|
- trailing_whitespace # Табы на пустых строках
|
|
- comma # Перед запятыми и после возможны пробелы - у нас так оформляются все if
|
|
- vertical_whitespace # Пустые строки, больше одной. Ввел свое правило - больше 3х
|
|
- fallthrough # Разрешить fallthrough в switch
|
|
|
|
force_unwrapping: warning
|
|
|
|
opt_in_rules:
|
|
- force_unwrapping
|
|
|
|
# Настройка длины строк в файле
|
|
line_length:
|
|
warning: 450
|
|
error: 650
|
|
ignores_function_declarations: true
|
|
ignores_comments: true
|
|
|
|
file_length:
|
|
warning: 800
|
|
error: 1000
|
|
|
|
type_body_length:
|
|
- 400 # warning
|
|
- 600 # error
|
|
|
|
function_body_length:
|
|
warning: 40
|
|
error: 200
|
|
|
|
identifier_name:
|
|
min_length:
|
|
warning: 2
|
|
max_length:
|
|
warning: 50
|
|
error: 60
|
|
excluded:
|
|
- f
|
|
- a
|
|
- b
|
|
- x
|
|
- y
|
|
- i
|
|
- j
|
|
- k
|
|
- v
|
|
|
|
large_tuple:
|
|
- 4 #warning
|
|
- 6 #error
|
|
|
|
nesting:
|
|
type_level:
|
|
warning: 2 #Поднял количество вложений, что бы не было ложных срабатываний на вложенные структуры и энамы (по-умолчанию допустимо только однократное вложение).
|
|
|
|
cyclomatic_complexity:
|
|
ignores_case_statements: true
|
|
|
|
function_parameter_count:
|
|
- 4
|
|
|
|
custom_rules:
|
|
whitespace_limits:
|
|
name: "Empty lines"
|
|
message: "Please do not use more then 2 empty lines"
|
|
regex: '((?:\s*\n){4,})'
|
|
|
|
unnecessary_leading_void_in:
|
|
name: "Unnecessary -> Void in at the end of the line"
|
|
regex: "(-> (Void|()) in$)"
|
|
message: "Unnecessary '-> Void in' at the end of the line. Use only 'in'"
|
|
severity: warning
|
|
|
|
unnecessary_type:
|
|
name: "Unnecessary Type"
|
|
regex: '(?sm)[ \ta-zA-Z0-9]?(?:let|var){1} [ \ta-zA-Z0-9]+?:[ \t]+?([a-zA-Z0-9]+?)[\t ]+?=[\t ]?\1'
|
|
message: "Type Definition Not Needed"
|
|
severity: warning
|
|
|
|
invalid_mark_format:
|
|
name: "Invalid MARK Format"
|
|
regex: '(?m-s)(\/\/[\s]*?MARK(?!(\:([\s]{1}\-[\s]{1}){0,1}){1}))'
|
|
message: "Use format: MARK: - Your Info"
|
|
severity: warning
|