End of line whitespace & git

I would like to ask if there is a robust and/or recommended solution for stripping EOL whitespace of Julia code in Git repos, more or less automatically, before commits.

I read a bit about various solutions, and there are various pre-commit hooks floating around on the net, but I am not sure which one to choose/adapt to Julia.

This is for use in a multi-user team, for my personal use I have Emacs do this automatically. But I would also consider enabling it for public repos, so that PRs I get don’t have spurious whitespace changes.

Not exactly what you’re asking, but in julia repository there is this script to check whitespace: https://github.com/JuliaLang/julia/blob/master/contrib/check-whitespace.sh

1 Like