Skip to content

Match .editorconfig and pre commit hook on trailing white space#24266

Closed
Glyphack wants to merge 1 commit intoastral-sh:mainfrom
Glyphack:shaygan-trim-trailing-whitespace
Closed

Match .editorconfig and pre commit hook on trailing white space#24266
Glyphack wants to merge 1 commit intoastral-sh:mainfrom
Glyphack:shaygan-trim-trailing-whitespace

Conversation

@Glyphack
Copy link
Copy Markdown
Contributor

@Glyphack Glyphack commented Mar 28, 2026

Summary

While I was working on a change on crates/ty_ide/src/hover.rs I noticed trailing new lines are trimmed on saving the file. I'm using neovim.
I searched around and found out the reason is .editorconfig. Without this setting editor won't reformat the code anymore.

But since it's not bad to trim new lines we just need it to be consistent I added it to pre commit hooks. Not a lot of files have trailing whitespace.

Update: I didn't realize this initially but the whitespace is in the result snapshot not the source code so trimming it will make tests fail. I'm checking what can I do.

Test Plan

@astral-sh-bot
Copy link
Copy Markdown

astral-sh-bot bot commented Mar 28, 2026

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

Formatter (stable)

✅ ecosystem check detected no format changes.

Formatter (preview)

✅ ecosystem check detected no format changes.

@Glyphack
Copy link
Copy Markdown
Contributor Author

So the whitespaces where there on purpose. For now I exclude that file from .editorconfig to discuss this and see what's the solution.

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

2 participants