SwiftLint警告:配置包含无效键:[“功能”级别]
Jus更新了播客并收到警告SwiftLint警告:配置包含无效键:[“功能”级别],swift,cocoapods,swiftlint,Swift,Cocoapods,Swiftlint,Jus更新了播客并收到警告 warning: Configuration contains invalid keys: ["function_level"] 根据更改日志更改了.swiftlint.yml 内部:.swiftlint.yml colon: severity: error line_length: ignores_comments: true warning: 260 error: 300 type_body_length: warn
warning: Configuration contains invalid keys:
["function_level"]
根据更改日志更改了.swiftlint.yml
内部:.swiftlint.yml
colon:
severity: error
line_length:
ignores_comments: true
warning: 260
error: 300
type_body_length:
warning: 300
error: 500
file_length:
warning: 800
error: 1000
function_parameter_count:
warning: 20
error: 30
function_body_length:
warning: 120
error: 150
cyclomatic_complexity:
warning: 40
error: 50
disabled_rules:
- implicit_getter
- redundant_string_enum_value
nesting:
type_level:
warning: 3
error: 6
function_level:
warning: 5
error: 10
#implicitly_unwrapped_optional:
# severity: warning
force_unwrapping:
severity: error
vertical_whitespace:
severity: error
#optional_try:
# severity: error
force_try:
severity: error
type_name:
min_length: 3
max_length: 60
error: 80
identifier_name:
min_length: 1
max_length: 60
excluded:
- id
# Disable rules from the default enabled set.
disabled_rules:
- trailing_whitespace
- implicit_getter
- redundant_string_enum_value
- switch_case_alignment
# Enable rules not from the default set.
opt_in_rules:
# - function_default_parameter_at_end
- empty_count
# - index_at_zero
- legacy_constant
# - implicitly_unwrapped_optional
- force_unwrapping
# Acts as a whitelist, only the rules specified in this list will be enabled. Can not be specified alongside disabled_rules or opt_in_rules.
only_rules:
# This is an entirely separate list of rules that are only run by the analyze command. All analyzer rules are opt-in, so this is the only configurable rule list (there is no disabled/whitelist equivalent).
analyzer_rules:
# This section is for defining custom rules
# custom_rules:
# constant_zero:
# included: ".*\\.swift"
# excluded: ".*Test\\.swift"
# name: "Constant Zero"
# regex: "(^0$)"
# match_kinds:
# - number
# message: "Use .zero instead of 0"
# severity: warning
# optional_try:
# included: ".*\\.swift"
# excluded: ".*Test\\.swift"
# name: "Optional Try"
# regex: ".*try?.*"
# match_kinds:
# - idiomatic
# message: "Optional tries should be avoided."
# severity: warning
# paths to ignore during linting. Takes precedence over `included`.
excluded:
- Carthage
- Pods
这里有问题吗?您得到的SwiftLint版本是什么?@Larme SwiftLint(0.43.1),它在0.42.0版本中根据ChangeLog进行了更改。不应该缩进
功能级别
,使其与类型级别
的缩进相同吗@安德鲁:是的,缩进问题已经解决,不再有警告了。谢谢