You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add linting for trailing whitespaces, newline symbols, etc.
This PR adds configuration for `pre-commit` tool, which can run `rustfmt`
and a few other tools to ensure code style. Contrary to its name,
`pre-commit` doesn't have to be installed as a pre-commit hook.
Instead, it can be invoked manually instead of `cargo fmt`, or registered
as a pre-push hook.
I've enabled several useful checks/fixes: trailing whitespace,
trailing newlines, line encoding, validity of json/yaml/toml files,
lint that finds files broken by merge conflicts, and a few others.
I've also added settings for VSCode to fix trailing whitespaces and newlines
on file save.
# Motivation
Some contributors have their editors configured to trim trailing whitespaces
and newlines on save, while others don't. This results in spurious changes
because somebody's editor added or removed a newline at the end of file.
Hopefully this change will make them less prevalent, if at all.
0 commit comments