Skip to content
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

detekt does not always inject the required EDITOR_CONFIG_USER_DATA_KEY for ktlint #2339

Closed
sschuberth opened this issue Feb 10, 2020 · 1 comment

Comments

@sschuberth
Copy link
Contributor

sschuberth commented Feb 10, 2020

This is a follow-up issue for #1803 as I believe @schalkms' statement of "Since detekt provides a wrapper over ktlint, this is not directly a problem of detekt" is not correct, and the issue seems to be in detekt, not in ktlint, as detekt does not properly inject EDITOR_CONFIG_USER_DATA_KEY before calling ktlint.

Expected Behavior

Enabling ktlint's FinalNewline rule should not crash detekt.

Observed Behavior

Enabling ktlint's FinalNewline rule does crash detekt.

Steps to Reproduce

Use

FinalNewline:
    active: true

on a file with missing final new line.

Context

ktlint expects the EDITOR_CONFIG_USER_DATA_KEY to be present, and detekt actually has code to add it, but that code does not seem to be called as FinalNewline does not override editorConfigUpdater to return something different than null.

Your Environment

@schalkms
Copy link
Member

schalkms commented Feb 10, 2020

Thanks for bringing up this issue again and describing the bug in detail with sample code, so that we can reproduce it!
Yes, my statement in the linked issue is wrong. Based on the issue report it wasn't possible to reproduce it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants