Skip to content

feat(lint-configs): Add .editorconfig derived from the existing formatter and linter configs. - #124

Open
LinZhihao-723 wants to merge 1 commit into
y-scope:mainfrom
LinZhihao-723:add-editorconfig
Open

LinZhihao-723 wants to merge 1 commit into
y-scope:mainfrom
LinZhihao-723:add-editorconfig

Conversation

@LinZhihao-723

Copy link
Copy Markdown
Member

Description

This PR adds an .editorconfig to exports/lint-configs so that editors apply the same basic whitespace and line-length rules our formatters and linters enforce, before any of those tools run.

Each setting is derived from the existing configs:

Setting Value Source
charset utf-8 Default encoding for C++/Rust/Python/YAML sources.
end_of_line lf .clang-format (LineEnding: LF), .rustfmt.toml (newline_style = "Unix"), yamllint's default new-lines rule.
indent_style space .clang-format (UseTab: Never), markdownlint MD010.
indent_size 4 .clang-format (IndentWidth: 4), .rustfmt.toml (tab_spaces = 4), Ruff's default indent width.
tab_width 4 .clang-format (TabWidth: 4), markdownlint MD010 (spaces_per_tab: 4).
insert_final_newline true .clang-format (InsertNewlineAtEOF: true), yamllint's default new-line-at-end-of-file rule.
trim_trailing_whitespace true markdownlint MD009 (strict: true), yamllint's default trailing-spaces rule.
max_line_length 100 .clang-format (ColumnLimit), .rustfmt.toml (max_width), Ruff (line-length), markdownlint MD013, yamllint line-length.

Overrides:

  • YAML files (*.yaml, *.yml, and the extension-less YAML configs .clang-format, .clang-tidy, and .yamllint) use indent_size = 2, following yamllint's indentation.spaces: 2.
  • Markdown files use indent_size = 2, following markdownlint's default MD007 list indentation.

The file sets root = true since EditorConfig doesn't support extending a config from another path; similar to .clang-format and .clang-tidy, projects are expected to symlink it into their root directory.

Checklist

  • The PR satisfies the contribution guidelines.
  • This is a breaking change and that has been indicated in the PR title, OR this isn't a
    breaking change.
  • Necessary docs have been updated, OR no docs need to be updated.

Validation performed

  • Resolved the properties for sample paths (.cpp, .hpp, .rs, .py, .sh, .toml, .md, .yaml, .yml, .clang-format, .clang-tidy, .yamllint) using the reference EditorConfig core (EditorConfig 0.17.1) and confirmed each path gets the expected values. Also confirmed that paths such as foo.clang-format and .clang-tidy.bak don't match the YAML section.
  • Ran editorconfig-checker (v3.11.1) against a copy of this repo with the file placed at the root. No reported violation indicates an incorrect setting; the reports are either pre-existing issues in the repo (e.g., CRLF line endings in exports/lint-configs/lint-requirements.txt, a missing final newline in taskfiles/boost/.clang-format) or expected false positives (e.g., the centered layout of LICENSE, 3-space continuation indents under ordered Markdown list items, and clang-format's operand alignment).
  • Confirmed both overrides are necessary: removing the YAML section causes every YAML file in the repo to be flagged, and removing the Markdown section flags the 2-space nested list items in the repo's docs.

@LinZhihao-723
LinZhihao-723 requested a review from a team as a code owner October 12, 2026 23:17
@coderabbitai

coderabbitai Bot commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: e0463507-6076-4f65-a593-7fcb773aba6c
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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

Successfully merging this pull request may close these issues.

1 participant