This is editorconfig:
This is the checker:
Install Link to heading
The CLI tool:
# Manjaro / Arch
sudo pacman -S git editorconfig-checker
# Alpine
apk add --update git editorconfig-checker
Check your text editor’s plugins for editorconfig integration. Spacemacs has it already built in.
Usage Link to heading
Add an .editorconfig
file to your project root:
root = true
[*]
charset = utf-8
end_of_line = lf
indent_style = space
insert_final_newline = true
tab_width = 2
trim_trailing_whitespace = true
[Makefile]
indent_style = tab
[{tmp/**/*,cache/**/*}]
charset = unset
end_of_line = unset
indent_style = unset
insert_final_newline = unset
tab_width = unset
trim_trailing_whitespace = unset
Now you can lint your repository:
editorconfig-checker $(git ls-files)
Use my docker image so you don’t have to build your own:
docker run --rm -it -v "$PWD":/work -w /work sdwolfz/editorconfig editorconfig-checker .