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

Allow Unit in .editorconfig #313

Closed
gmariotti opened this issue Nov 13, 2018 · 4 comments
Closed

Allow Unit in .editorconfig #313

gmariotti opened this issue Nov 13, 2018 · 4 comments

Comments

@gmariotti
Copy link

Hi, looking at the Jetbrains coding conventions, for libraries is suggested to always explicitly specify the return type of a function, even if it's Unit. However, as far as I know, ktlint doesn't allow to disable the check on useless Unit globably. Do you think it make sense to have it as an option i the .editorconfig file? And if not, what would be your suggestion to disable the Unit check globably for a library project?

@vietj
Copy link

vietj commented Dec 1, 2018

does ktlint fails or warns ?

the idea of ktlint in the generated code, is to reformat the code to be more kotlin-ish.

@gmariotti
Copy link
Author

ktlint can do both, the only problem is that it will remove Unit from the return type of all the generated methods unless you disable the rule for the file.

@shyiko
Copy link
Collaborator

shyiko commented Feb 12, 2019

Ability to disable rules on per-file basis is coming in #208.

@shyiko shyiko closed this as completed Feb 12, 2019
@gmariotti
Copy link
Author

That's great news, thanks @shyiko!!

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

No branches or pull requests

3 participants