I understand that ktlint relaxes certain rules (e....
# ktlint
d
I understand that ktlint relaxes certain rules (e.g. function naming) in tests based on the presence of specific imports (e.g. junit). What is the best way to keep that relaxes behavior even if the imports are moved to a common testing library?
p
The list of test libraries is hard coded. If your test are annotated you can (try to) use
ktlint_function_naming_ignore_when_annotated_with
https://pinterest.github.io/ktlint/latest/rules/standard/#function-naming
d
Yeah, that makes sense and it's good to know that there's an option for that. Unfortunately, I don't have a single suitable annotation to use here so I opted for a workaround by explicitly using some default annotation to force include the unit import, e.g.
@TestInstance(TestInstance.Lifecycle.PER_METHOD)