Skip to content

chore: add .editorconfig for consistent formatting #1571

@SchoolyB

Description

@SchoolyB

Summary

The project has no .editorconfig file. While ezc/.clang-format handles C formatting, there is no editor-agnostic config for basic settings like indent style, trailing whitespace, and final newlines. An .editorconfig ensures contributors using any editor (VS Code, Vim, Emacs, JetBrains, etc.) get consistent defaults.

Implementation guidance

  1. Inspect existing code to determine current conventions:
    • C files (ezc/src/): check indent style (spaces vs tabs) and width
    • Go files (cmd/ez/, internal/, pkg/): tabs per Go standard
    • Makefiles: tabs (required by make)
    • YAML (.github/workflows/): 2-space indent
    • Shell scripts (scripts/): check current style
  2. Create a root .editorconfig capturing these conventions
  3. Standard settings to include: indent_style, indent_size, end_of_line, charset, trim_trailing_whitespace, insert_final_newline

Example

root = true

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

[*.c]
indent_style = space
indent_size = 4

[*.h]
indent_style = space
indent_size = 4

[*.go]
indent_style = tab

[Makefile]
indent_style = tab

[*.yml]
indent_style = space
indent_size = 2

[*.sh]
indent_style = space
indent_size = 2

Files to create

  • .editorconfig

Metadata

Metadata

Assignees

No one assigned

    Labels

    code-qualityCode cleanup, linting, and static analysis fixesgood first issueGood for newcomershelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions