openrewrite / openrewrite/rewrite

Pick TabsAndIndentsStyle from .editorconfig

Open
#3,666 9 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Java
Stars
3.7k
Forks
570
Avg merge
13h 12m
Merged PRs (30d)
261

Description

What problem are you trying to solve?

I am trying to duplicate the configuration between .editorcofig and OpenRewrite.

Describe the solution you'd like

I would like OpenRewrite to infer TabsAndIndentsStyle settings from https://editorconfig.org/ settings

Have you considered any alternatives or workarounds?

Frankly speaking, I have not.

Additional context

https://editorconfig.org/ is a well-known standard for configuring common IDE settings, and many IDEs support .editorconfig files natively.
It would be great if OpenRewrite could reuse the settings from there.

.editorconfig settings are flexible: the settings can be divided into several files, and the indent style can vary across files.

See https://github.com/pgjdbc/pgjdbc/blob/9cf9f36a1d3a1edd9286721f9c0b9cfa9e8422e3/.editorconfig#L31-L43

Are you interested in contributing this feature to OpenRewrite?

I am about to integrate OpenRerwite, so I am not sure I would have time to implement editorconfig support.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating TabsAndIndentsStyle and the existing style-configuration entry points in OpenRewrite, then compare them with the linked .editorconfig example. Determine how settings from multiple files and file-specific sections should be selected. Done means .editorconfig settings can be used to infer the relevant TabsAndIndentsStyle values for each applicable file.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
developer-experience, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.