Detekt: Config file paths should be recognized cross-platform

Created on 22 Dec 2017  路  3Comments  路  Source: detekt/detekt

Detekt check should be able to recognize correct path to ignore from config file, when using of different operating systems.
Config file was created for unix:

test-pattern:
  active: true
  patterns:
    - '.*/test/.*'
    - '.*/androidTest/.*'
    - '.*Test.kt'
    - '.*Spec.kt'

But when run on Windows its reporting syntax errors for paths like app\src\test\....
How to configure detekt so it can be used across team with different OSs?

api feature help wanted

All 3 comments

It should be possible to add both:

patterns:
    - '.*/test/.*'
    - '.*\test\.*'

I'm wondering if we should do this in detekt internally, adding a Windows config for every Unix config and the other way around.

Thanks, small correction, for Windows we need to escape the backslash

patterns:
    - '.*\\test\\.*'

One argument in favor - seems that other tools like Lint supports having single path config

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related topics.

Was this page helpful?
0 / 5 - 0 ratings