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

[Feature] Support editorconfig #734

Open
xenoterracide opened this issue Nov 14, 2020 · 8 comments
Open

[Feature] Support editorconfig #734

xenoterracide opened this issue Nov 14, 2020 · 8 comments

Comments

@xenoterracide
Copy link

xenoterracide commented Nov 14, 2020

Support https://editorconfig.org

instead of this

spotless {
  // optional: limit format enforcement to just the files changed by this feature branch
  ratchetFrom 'origin/main'

  format 'misc', {
    // define the files to apply `misc` to
    target '*.gradle', '*.md', '.gitignore'

    // define the steps to apply to those files
    trimTrailingWhitespace()
    indentWithTabs() // or spaces. Takes an integer argument if you don't like 4
    endWithNewline()
}

you could simply do

spotless {
  editorConfig()
}

which would simply figure out all the same information, and also presumably pass it to other things like

spotless {
   java {
}

would inherit it.

possibly code or coordination of a general library for editor config in java here.

https://github.com/ec4j/editorconfig-gradle-plugin

@nedtwigg
Copy link
Member

Partial dupe of #142, but each issue is unique enough to stand on its own.

@JavierSegoviaCordoba
Copy link
Contributor

I would like to see this. My use case is using the official Android XML format, and should be easy to just export the editorconfig from IntelliJ and that Spotless read it to know how to sort the xml fields for example.

@andriewski
Copy link

That would be really convinient to have such thing in spotless.
.editorconfig is widely spread amoung Java community, which uses Intellij Idea
Basically, it's placed in the root of the project

I would be great if you add this support for Maven and Gradle :)

@archongum
Copy link

Need this for using .editorconfig for all file types (*.yml, *.sh, etc.)

@sharath2106
Copy link

This would really solve a lot of headaches for our team's overall formatting style as we rely on .editorconfig. Would be nice to see an update coming supporting this.

@sonus21
Copy link

sonus21 commented Dec 1, 2023

Need this feature to solve all the headache we've due to different formatting style used in .editorconfig and spotless. Please add support for this.

@derekobrien27
Copy link

+1 for this feature!

@mhagnumdw
Copy link

Certainly, it's definitely a valuable feature!

Initially, I even tried to configure Spotless to comply with the .editorconfig, but I already stumbled upon <includes><include>**</include></includes> which doesn't respect the .gitignore. Another obstacle is that with **, Spotless tried to process the .mvn/wrapper/maven-wrapper.jar binary file while the editorconfig disregards it. I know it's possible to be more specific with <include> and <exclude>, but depending on the project, it can get quite verbose, and files may be added or excluded from folders not referenced in the <include> and <exclude>.

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

9 participants