-
Notifications
You must be signed in to change notification settings - Fork 506
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 ability to specify editorconfig path #207
Add ability to specify editorconfig path #207
Conversation
888893f
to
e593dcf
Compare
Hi @charbgr. How about we change .editorconfig lookup logic so that instead of checking only the workdir it would check the directory of every matched file?
I realise it would require 1 more What do you think? Would you be willing to give it a try? |
Sure, I will give a try! What if I find two or more |
Yes. Given
A.kt should observe |
Hi again, sorry for being late on this. I was busy these weeks. I pushed my first implementation for custom What I did is that I am iterating files found from klob and for each of them I am going backwards till I find the working directory( Let me know what you think! |
9e81478
to
726b0a7
Compare
726b0a7
to
88beb05
Compare
Hey @shyiko, did you have the time to check the last update? |
Sorry, I've been busy the last couple of weeks. Merging in! 👍 |
Is there any chance you might reconsider the flag to specify the configuration file? In our use case, we are attempting to create a consistent style across a broad spectrum of projects. Prior to this change, it was possible to enforce compliance by having one .editorconfig in the directory from which ktlint was run. After this change, it is possible for any project to circumvent the configuration just by adding their own .editorconfig file in their directory. |
@bethcutler sure. PR is welcome. |
.editorconfig
path.The problem:
I setup ktlint in my project and then I installed the pre-commit hook. "Real" code is under
cliffhanger/
folder and the.editorconfig.
is placed under that folder.The issue is that pre-commit hook is being installed in the parent git directory (where not "Real" code exists) and the
.editorconfig
is placed in a different folder, resulting to wrong lint warnings.With this fix I can modify my pre-commit hook and set editoconfig path by
Let me know what you think and looking forward to your constructive feedback!