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

Introduce ktlint configuration file, ktlintrc.toml #603

Closed
yukukotani opened this issue Oct 4, 2019 · 4 comments
Closed

Introduce ktlint configuration file, ktlintrc.toml #603

yukukotani opened this issue Oct 4, 2019 · 4 comments

Comments

@yukukotani
Copy link
Contributor

Proposal

I'd like to propose ktlint configuration file. For now, ktlint configurations are included in EditorConfig.
However, ktlint is not an editor.
ktlint configurations such as disable_rules and codestyle set(#548) should be configured in ktlint's own config file.

Implementation Details

  • While ktlint configuration should be separated from EditorConfig, refering to EditorConfig settings such as indent_size is good idea. It will be nice to refer EditorConfig if it's not configured in ktlint config. Thir approach is used in Prettier.
  • Multiple configuration format can be supported, such as toml and yaml.
@Tapchicoma
Copy link
Collaborator

Personally, I will vote against this proposal:

  • having ktlint settings in yaml or toml file is going into the same direction as having it in the .editorconfig file. It is just extracting them into separate file and using that file syntax.
  • Ktlint uses .editorconfig files for settings for already long time and migrating to another file would break already existing tooling around it
  • Supporting multiple configuration files would increase complexity of the project.
  • usually projects use several languages and keep code styles for them in one place - .editorconfig is nice
  • .editorconfig allows to override some settings in nested folders .editorconfig files
  • .editorconfig files are supported by editors for defining programming language code style and ktlint project is about code style. While now no editor uses ktlint settings, we (or editor developers) could add such support in the future.

@yukukotani
Copy link
Contributor Author

@Tapchicoma
I see. I don't have a strong will to do this, so I close this.
Thanks for telling your opinion!

@magic-akari
Copy link

How to enable experimental ktlint feature in .editorconfig?

@Tapchicoma
Copy link
Collaborator

@magic-akari it is currently not possible to enable them via .editorconfig, you need to pass --experimental flag to ktlint. Allowing to enable them in .editorconfig would be possible via #548 issue implementation.

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