Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add support for apply-to-idea-project formating command #91

Closed
igorwojda opened this issue Apr 30, 2018 · 5 comments
Closed

Add support for apply-to-idea-project formating command #91

igorwojda opened this issue Apr 30, 2018 · 5 comments
Assignees

Comments

@igorwojda
Copy link

igorwojda commented Apr 30, 2018

I added a plugin to the project.
Now every developer in the team must manually run this ktlint command
./ktlint --apply-to-idea-project --android

This is fine, but I wonder can it be achieved without separatley downloading (and keeping) ktlint binaries? I would be nice to provide ability to configure IDE out of the box.

hmm Maybe plugin could somehow link ./ktlint command to project root or add new gradle task that would allow passing parameters to ktlint script ./gradlew ktlint 🤔

(we could, of course, add new grade task but I feel this would not be flexible enough if new ktlint parameters will be added in future)

@igorwojda igorwojda changed the title Apply formating command Add support for apply-to-idea-project formating command Apr 30, 2018
@JLLeitschuh
Copy link
Owner

Oooooh. I really like this idea. @Tapchicoma What do you think?

@Tapchicoma
Copy link
Collaborator

I don't have strong opinion on it, but I don't think that adding some generic task that will passes parameters to ktlint is a good idea. Then better to use ktlint directly.

Regarding the --apply-to-idea-project - plugin can add one separate task to root project ktlintApplyToIDEA that will use extension configuration to apply rules to IDEA.

@igorwojda
Copy link
Author

You are right, this makes perfect sense

@igorwojda
Copy link
Author

Thanks for implementing this 👍

@Tapchicoma
Copy link
Collaborator

Reopening this as implementation is slightly wrong: pinterest/ktlint#178

I am thinking of introducing second task ktlintApplyToIdeaGlobally and adding the current one if ktlint version is >=0.22.0

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

No branches or pull requests

3 participants