https://kotlinlang.org logo
#detekt
Title
# detekt
e

Eduard Boloș

03/20/2024, 3:00 PM
Hello! Is it possible to have a rule (e.g. ForbiddenMethodCall) multiple times but with different rule properties? In my case, I want to forbid different methods but in different sourceset, so ideally I could do something like
Copy code
ForbiddenMethodCall:
    active: true
    excludes: ['**/main/**'
    methods:
      - value: 'kotlin.assert'
  ForbiddenMethodCall:
    active: true
    excludes: ['**/test/**']
    methods:
      - value: 'kotlin.io.print'
n

Nicholas Doglio

03/20/2024, 3:03 PM
Not currently no but it's on the roadmap for detekt 2.0 https://github.com/detekt/detekt/issues/6738
👍 3
thank you color 2
g

gammax

03/22/2024, 2:47 PM
Nope this is not possible tody
4 Views