-
-
Notifications
You must be signed in to change notification settings - Fork 774
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Running formatting checks without formatting the code on CI #159
Comments
So you already running How do your build settings look like ? I turned off formatting weights in the build failure check, try turning it on build:
warningThreshold: 5
failThreshold: 10
weights:
complexity: 2
formatting: 0
LongParameterList: 1
comments: 0.5 |
This is our current detekt.yml autoCorrect: false
build:
warningThreshold: 1
failThreshold: 1
potential-bugs:
active: true
LateinitUsage:
active: false
exceptions:
active: true
empty-blocks:
active: true
complexity:
active: true
code-smell:
active: true
formatting:
active: true
useTabs: true
style:
active: true
comments:
active: true
UndocumentedPublicClass:
active: false
UndocumentedPublicFunction:
active: false We simply want a way to fail the build if the code isn't formatted properly. We've tried increasing weight for |
Ah I see, shouldn't be so hard to add. Will try to add this to next release. |
Ok fixed. After the last two PR are merged, I will release a new version. |
Great, thanks! |
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. |
We would like to run detekt on our CI with all checks, including formatting. The problem is that we don't want to actually reformat code on CI, just fail the build if there are any errors. But if we run
detektFormat
withautoCorrect: false
, it prints format errors, but doesn't fail the build.Is it possible to either add formatting checks to
detektCheck
or makedetektFormat
fail the build (possibly enabled by some flag) if there are any formatting errors?The text was updated successfully, but these errors were encountered: