[packages] Enforce final newlines on files
- Dominant language
- Dart
- Stars
- 179k
- Forks
- 31.1k
- PR merge metrics
- PR metrics pending
Description
It would be nice if the tooling enforced, as part of formatting, that all files had trailing newlines; GitHub's UI will show a sort of error icon in the review UI if there isn't one, and also it's not uncommon for people to have editors set to auto-add them when missing whenever saving a file (I have that, for instance) which causes churn in diffs when files without trailing newlines are touched.
For code, where we use autoformatters, it probably already is enforced, but things like .md and .yaml files we don't. It would be easy enough to have a check that any touched file that's not a binary ends with a newline character.
(Obviously this is low priority, but filing because I've thought it would be nice to have for a while when I notice in reviews, but hadn't ever remembered to file it.)
Contributor guide
Research direction
Start by locating the repository’s formatting tooling and how it processes touched files, especially non-binary .md and .yaml files. Done means the check enforces a trailing newline on every touched non-binary file without introducing unwanted changes to binary files.
Written by the indexing model from the issue text.
Assessment
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 65/100