Repository navigation
feat(lint-configs): Add .editorconfig derived from the existing formatter and linter configs. - #124
Open
LinZhihao-723 wants to merge 1 commit into
Open
LinZhihao-723 wants to merge 1 commit into
LinZhihao-723 wants to merge 1 commit into
Conversation
…matter and linter configs.
Contributor
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
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. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR adds an
.editorconfigtoexports/lint-configsso 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:
charsetutf-8end_of_linelf.clang-format(LineEnding: LF),.rustfmt.toml(newline_style = "Unix"), yamllint's defaultnew-linesrule.indent_stylespace.clang-format(UseTab: Never), markdownlintMD010.indent_size4.clang-format(IndentWidth: 4),.rustfmt.toml(tab_spaces = 4), Ruff's default indent width.tab_width4.clang-format(TabWidth: 4), markdownlintMD010(spaces_per_tab: 4).insert_final_newlinetrue.clang-format(InsertNewlineAtEOF: true), yamllint's defaultnew-line-at-end-of-filerule.trim_trailing_whitespacetrueMD009(strict: true), yamllint's defaulttrailing-spacesrule.max_line_length100.clang-format(ColumnLimit),.rustfmt.toml(max_width), Ruff (line-length), markdownlintMD013, yamllintline-length.Overrides:
*.yaml,*.yml, and the extension-less YAML configs.clang-format,.clang-tidy, and.yamllint) useindent_size = 2, following yamllint'sindentation.spaces: 2.indent_size = 2, following markdownlint's defaultMD007list indentation.The file sets
root = truesince EditorConfig doesn't support extending a config from another path; similar to.clang-formatand.clang-tidy, projects are expected to symlink it into their root directory.Checklist
breaking change.
Validation performed
.cpp,.hpp,.rs,.py,.sh,.toml,.md,.yaml,.yml,.clang-format,.clang-tidy,.yamllint) using the reference EditorConfig core (EditorConfig0.17.1) and confirmed each path gets the expected values. Also confirmed that paths such asfoo.clang-formatand.clang-tidy.bakdon't match the YAML section.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 inexports/lint-configs/lint-requirements.txt, a missing final newline intaskfiles/boost/.clang-format) or expected false positives (e.g., the centered layout ofLICENSE, 3-space continuation indents under ordered Markdown list items, and clang-format's operand alignment).