Skip to content

Add .editorconfig for consistent code formatting #70

Description

@sfloess

Description

Add an .editorconfig file to ensure consistent code formatting across different editors and IDEs.

Benefits

  • Consistent formatting: All contributors use the same indentation, line endings, charset
  • IDE support: Works in VS Code, IntelliJ IDEA, Eclipse, Vim, etc.
  • Zero configuration: Works automatically when file is present
  • Prevents formatting debates: Codifies formatting rules

Recommended Configuration

# EditorConfig: https://EditorConfig.org

root = true

# All files
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

# Java files
[*.java]
indent_style = space
indent_size = 4
max_line_length = 120

# XML files (pom.xml, etc.)
[*.xml]
indent_style = space
indent_size = 4

# YAML files (GitHub Actions, etc.)
[*.{yml,yaml}]
indent_style = space
indent_size = 2

# Markdown files
[*.md]
trim_trailing_whitespace = false
max_line_length = off

# Shell scripts
[*.sh]
indent_style = space
indent_size = 2

Files to Create

  • .editorconfig (root directory)

Priority

Low - Quality of life improvement

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions