tooling/editorconfig@v1
Cross-editor standardization: an .editorconfig at the root
plus a .gitattributes that normalizes line endings. Both
are near-universal in well-run repos because they prevent
the most common style-churn PR comments before an author
even hits save.
Adopt with
Section titled "Adopt with"extends: - alint://bundled/tooling/editorconfig@v1 What it checks
Section titled "What it checks"3 rules. Each links to its section below, which explains the check and shows its definition.
| Rule | Reports |
|---|---|
tooling-editorconfig-existsinfo | Add a root .editorconfig so contributors on different editors produce files with consistent indentation and line endings. |
tooling-gitattributes-existsinfo | Add a root .gitattributes to normalize line endings across Windows/macOS/Linux checkouts. |
tooling-gitattributes-normalizes-line-endingsinfo | .gitattributes exists but has no * text=... line; line-ending normalization is the main reason to ship a .gitattributes in the first place. |
tooling-editorconfig-exists
Section titled "tooling-editorconfig-exists"- kind:
file_exists - level:
info - policy: https://editorconfig.org/
Add a root
.editorconfigso contributors on different editors produce files with consistent indentation and line endings.
- id: tooling-editorconfig-exists kind: file_exists paths: .editorconfig root_only: true level: info message: >- Add a root `.editorconfig` so contributors on different editors produce files with consistent indentation and line endings. policy_url: "https://editorconfig.org/" tooling-gitattributes-exists
Section titled "tooling-gitattributes-exists"- kind:
file_exists - level:
info - policy: https://git-scm.com/docs/gitattributes
Add a root
.gitattributesto normalize line endings across Windows/macOS/Linux checkouts. A typical minimum is* text=auto eol=lf.
- id: tooling-gitattributes-exists kind: file_exists paths: .gitattributes root_only: true level: info message: >- Add a root `.gitattributes` to normalize line endings across Windows/macOS/Linux checkouts. A typical minimum is `* text=auto eol=lf`. policy_url: "https://git-scm.com/docs/gitattributes" tooling-gitattributes-normalizes-line-endings
Section titled "tooling-gitattributes-normalizes-line-endings"When .gitattributes exists, it should contain the text normalization directive — otherwise it's providing little value beyond the file's existence.
- kind:
file_content_matches - level:
info
.gitattributesexists but has no* text=...line; line-ending normalization is the main reason to ship a.gitattributesin the first place.
- id: tooling-gitattributes-normalizes-line-endings kind: file_content_matches paths: .gitattributes pattern: '(?m)^\s*\*\s+text=' level: info message: >- `.gitattributes` exists but has no `* text=...` line; line-ending normalization is the main reason to ship a `.gitattributes` in the first place.Customize
Section titled "Customize"Every rule here can be overridden by id from your own .alint.yml: change its level, or set level: off to drop it. An id that doesn't exist is an error at config load, so a typo can't silently pass.
extends: - alint://bundled/tooling/editorconfig@v1 rules: - id: tooling-editorconfig-exists level: off - id: tooling-gitattributes-exists level: errorTo take only part of the ruleset, filter it where you extend it with only: or except::
extends: - url: alint://bundled/tooling/editorconfig@v1 except: [tooling-editorconfig-exists]Bundled rulesets covers versioning and how rulesets combine.
Source
Section titled "Source"The full ruleset definition, comments included, is committed at crates/alint-dsl/rulesets/v1/tooling/editorconfig.yml in the alint repo.