皮绒迅速掉毛时不排除豆荚

时间:2018-12-28 10:27:50

标签: ios iphone swiftlint

我已将swiftLint添加到我的项目中,还添加了.swiftlint.yml文件,其中包含所有规则,但是文件规则中的某些规则在我的项目中不起作用,例如排除的行长。我想从Linting中排除pod,所以我在.swiftlint.yml文件中添加了以下代码

excluded: # paths to ignore during linting. Takes precedence over已包含. - Carthage - Pods

在我的.yml文件中,但pod仍然不被忽略。

任何人都不知道我在哪里做错了。

预先感谢

1 个答案:

答案 0 :(得分:0)

例如, 您的.yml文件应如下所示,其中包含opt_in_rulesdisabled_rulesfile_lengthtype_body_lengthidentifier_nameline_lengthnumber_separatorfunction_parameter_count规则,

excluded:
  - Carthage
  - Pods
opt_in_rules:
  - force_unwrapping
  - empty_count
  - explicit_init
  - closure_spacing
  - overridden_super_call
  - redundant_nil_coalescing
  - nimble_operator
  - attributes
  - operator_usage_whitespace
  - closure_end_indentation
  - first_where
  - object_literal
  - number_separator
  - prohibited_super_call
  - fatal_error_message
disabled_rules:
  - type_name
  - trailing_whitespace
  - identifier_name
  - class_delegate_protocol
  - nesting
file_length:
  warning: 1000
  error: 1200
type_body_length:
 - 200 # warning
 - 300 # error
identifier_name:
  excluded:
    - id
line_length: 300
number_separator:
  minimum_length: 5
function_parameter_count:
  warning: 6
  error: 9

希望有帮助。