Отключить multiline_arguments SwiftLint для некоторых методов глобально

Есть ли возможность отключить правило multiline_arguments только для некоторых классов/методов?

я мог написать

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

Но тогда мне пришлось бы писать это при каждом звонке, а это именно то, чего я хотел бы избежать.


person Jaroslav    schedule 10.05.2019    source источник


Ответы (1)


В зависимости от того, как вы все организовали, вы можете использовать вложенные yml-файлы SwiftLine!

Вот что говорят документы:

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.
person Akash Kundu    schedule 22.08.2020