1

是否有可能multiline_arguments仅在某些类/方法上禁用规则?

我可以写

// swiftlint:disable multiline_arguments
someMethod(self, a: a,
b: b c: c)
// swiftlint:enable multiline_arguments

但是我必须在每次通话中都写它,而这正是我想要避免的。

4

1 回答 1

0

根据您组织事物的方式,您可以使用嵌套的 SwiftLine yml 文件!

这是文档所说的:

Nested Configurations

SwiftLint supports nesting configuration files for more granular control over the linting process.

Include additional .swiftlint.yml files where necessary in your directory structure.
Each file will be linted using the configuration file that is in its directory or at the deepest level of its parent directories. Otherwise the root configuration will be used.
included is ignored for nested configurations.
于 2020-08-22T23:37:50.357 回答