chore: add .editorconfig for consistent formatting#1068
chore: add .editorconfig for consistent formatting#1068aniruddhaadak80 wants to merge 1 commit intof:mainfrom
Conversation
📝 WalkthroughWalkthroughA new Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Pull request overview
Adds an .editorconfig to standardize basic formatting across the repository so contributors’ editors apply consistent whitespace/EOL settings.
Changes:
- Introduces root
.editorconfigwith UTF-8, LF line endings, final newline, 2-space indentation, and trailing whitespace trimming defaults. - Adds Markdown-specific overrides to keep trailing whitespace.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| trim_trailing_whitespace = true | ||
|
|
||
| [*.md] | ||
| ignore_format = true |
There was a problem hiding this comment.
ignore_format is not a standard EditorConfig property and there’s no evidence in this repo that any formatter/linter reads it. If the intent is to prevent formatting Markdown, consider removing this key (to avoid a misleading no-op) and instead configure the actual formatter (e.g., Prettier/ESLint/IDE settings) to ignore *.md, or add a brief note/tooling reference explaining what consumes ignore_format here.
| ignore_format = true | |
| # Note: Markdown formatting exclusions are configured in the formatter (e.g., Prettier), not via EditorConfig. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.editorconfig:
- Around line 11-13: Remove the non-standard EditorConfig property
"ignore_format" from the .editorconfig block and either delete that line or
replace it with a tool-specific setting (e.g., use your formatter's ignore
mechanism such as .prettierignore or an IDE-specific key like
disable_formatter=true in the tool's config) while keeping only valid
EditorConfig properties like "trim_trailing_whitespace" in the [*.md] section;
ensure no other non-standard keys remain.
| [*.md] | ||
| ignore_format = true | ||
| trim_trailing_whitespace = false |
There was a problem hiding this comment.
🧩 Analysis chain
🌐 Web query:
Is ignore_formata supported standard property in the EditorConfig specification, and which popular editors or formatters, if any, recognize it in.editorconfig files?
💡 Result:
No. ignore_format is not a standard (spec-defined) EditorConfig property. The EditorConfig spec defines a fixed set of keys (e.g., indent_style, indent_size, end_of_line, etc.), and explicitly says plugins must ignore unrecognized keys—so a conforming EditorConfig implementation will treat ignore_format as an unknown no-op unless a specific tool adds custom support for it. [1]
As for popular editors/formatters recognizing ignore_format specifically in .editorconfig: I couldn’t find any mainstream editor/formatter that documents support for an ignore_format key. Instead, common tools use other mechanisms:
- JetBrains IDEs / ReSharper / Rider: support disabling their formatter via
disable_formatter=truein matching EditorConfig sections (notignore_format). [2] - Prettier: respects certain standard EditorConfig keys (like
indent_styleandend_of_line), but uses.prettierignoreand// prettier-ignore-style pragmas for excluding formatting (notignore_format). [3][4]
Sources: EditorConfig spec [1], JetBrains docs [2], Prettier ignore docs [3], Prettier options/docs on EditorConfig integration [4].
Remove or replace ignore_format — it is not a standard EditorConfig property.
Line 12 defines a non-standard key that EditorConfig implementations will silently ignore per spec. If disabling Markdown formatting is required, use tool-specific configuration instead (e.g., disable_formatter=true for JetBrains IDEs, or .prettierignore for Prettier).
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In @.editorconfig around lines 11 - 13, Remove the non-standard EditorConfig
property "ignore_format" from the .editorconfig block and either delete that
line or replace it with a tool-specific setting (e.g., use your formatter's
ignore mechanism such as .prettierignore or an IDE-specific key like
disable_formatter=true in the tool's config) while keeping only valid
EditorConfig properties like "trim_trailing_whitespace" in the [*.md] section;
ensure no other non-standard keys remain.
📝 Why is this useful?
Currently, the repository does not have an .editorconfig file.
This PR adds a standard .editorconfig to enforce foundational coding styles across different editors and IDEs (indentations, newlines, whitespace). This makes the open-source contributor experience smoother and avoids whitespace/line-ending differences in future Pull Requests.
🛠️ Key Changes