Skip to content

chore: add .editorconfig to all templates - #155

Closed
dchaudhari7177 wants to merge 1 commit into
Create-Python-App:mainfrom
dchaudhari7177:chore/editorconfig
Closed

chore: add .editorconfig to all templates#155
dchaudhari7177 wants to merge 1 commit into
Create-Python-App:mainfrom
dchaudhari7177:chore/editorconfig

Conversation

@dchaudhari7177

Copy link
Copy Markdown

Closes#152. One PR covering all six templates.

Based on this repo's own file, not a generic snippet

cpa-templates already has a root .editorconfig, and it differs slightly from the one sketched in the issue (it also covers md, and adds a Makefile rule). Scaffolded projects and this repo agreeing seemed more useful than either, so each template's file follows the root one:

root = true
[*]charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = space
indent_size = 4
[*.{yml,yaml,toml,md,json}]indent_size = 2

[Makefile] indent_style = tab is included only in uv-workspace-starter, the one template that actually ships a Makefile — a rule matching nothing is just noise in the other five.

Two additions worth flagging

max_line_length per template. Each file sets it for *.py from that template's own [tool.ruff] line-length: 100 everywhere except uv-workspace-starter, which is 88. Without it the editor draws its ruler at 80 while ruff reflows at 100, which is the exact confusion .editorconfig exists to prevent.

trim_trailing_whitespace = false for Markdown. Two trailing spaces are a hard line break in Markdown, so globally trimming them silently changes rendering. Every template ships 9–12 .md files, so this would have bitten.

Verified

Resolution checked with the reference editorconfig parser, not by eye — real paths in real templates:

pathpropertyresolved
uv-workspace-starter/app/main.pymax_line_length88
celery-worker/worker/tasks.pymax_line_length100
celery-worker/pyproject.tomlindent_size2
celery-worker/README.mdtrim_trailing_whitespacefalse
uv-workspace-starter/Makefileindent_styletab
mlops-sklearn-starter/config.yamlindent_size2

All files are LF with a trailing newline. python scripts/ci/validate-registry.py passes: ✅ registry ok (6 templates, 18 extensions).

I also checked the declared widths against the existing code so the config isn't stating something the templates violate: every template's .py files are within their declared width, with one pre-existing exception — fastapi-starter/app/core/exception_handlers.py:60 is 107 chars, and the overflow is a trailing # type: ignore[arg-type]. max_line_length is a ruler rather than an enforcement, so nothing breaks; noting it in case you'd rather that line were wrapped.

No template shipped one, so a scaffolded project relied on whatever each
contributor's editor happened to default to for indentation, line endings and
charset.
Each template gets an .editorconfig following this repo's own root file rather
than a generic snippet, so a scaffolded project and cpa-templates itself agree:
utf-8, lf, final newline, trim trailing whitespace, 4-space indent, 2 for
yml/yaml/toml/md/json, and tab for Makefile in uv-workspace-starter (the only
template that has one).
Two additions beyond a straight copy. Each file sets max_line_length for *.py
to that template's own [tool.ruff] line-length — 100 everywhere except
uv-workspace-starter at 88 — so the editor's ruler agrees with the formatter
that will reflow the file. And trim_trailing_whitespace is turned back off for
Markdown, where two trailing spaces are a hard line break and stripping them
silently changes rendering; every template ships 9-12 .md files.
Resolution verified for .py, .toml, .md, .yaml and Makefile paths in each
template with the reference editorconfig parser.
ClosesCreate-Python-App#152
@coderabbitai

Copy link
Copy Markdown

Warning

Review limit reached

@dchaudhari7177, you've reached your PR review limit, so we couldn't start this review.

Next review available in:57 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 0a474acd-c296-4836-a53c-32db4a9ece9f

📥 Commits

Reviewing files that changed from the base of the PR and between 6986f9b and 7dcc953.

📒 Files selected for processing (6)
  • templates/celery-worker/.editorconfig
  • templates/cli-starter/.editorconfig
  • templates/django-api/.editorconfig
  • templates/fastapi-starter/.editorconfig
  • templates/mlops-sklearn-starter/.editorconfig
  • templates/uv-workspace-starter/.editorconfig

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.

@ulises-jeremias

ulises-jeremias commented Aug 9, 2026

Copy link
Copy Markdown
Member

Thanks @dchaudhari7177 — closing as duplicate of #159 (same fix #153.editorconfig). #159 combines #152+#153 and avoids duplication with #154/#156/#157/#158. Thanks for the PR!

Sign up for freeto 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.

chore: add .editorconfig to all templates

2 participants

@dchaudhari7177@ulises-jeremias