https://github.com/JuliaLang/julia
Raw File
Tip revision: f57d29dd51944d513d5d9b7992520b25fd22d7f0 authored by Rafael Fourquet on 26 April 2021, 13:29:35 UTC
add `zeros!` and `ones!`, mutating versions of `zeros` and `ones`
Tip revision: f57d29d
check-whitespace.sh
#!/bin/sh
# This file is a part of Julia. License is MIT: https://julialang.org/license

# Check for trailing white space in source files;
# report an error if so

# Files to check:
set -f # disable glob expansion in this script
file_patterns='
*.1
*.c
*.cpp
*.h
*.jl
*.lsp
*.scm
*.inc
*.make
*.mk
*.md
*.rst
*.sh
*.yml
*Makefile
'

# TODO: Look also for trailing empty lines, and missing '\n' after the last line
if git --no-pager grep --color -n --full-name -e ' $' -- $file_patterns; then
    echo "Error: trailing whitespace found in source file(s)"
    echo ""
    echo "This can often be fixed with:"
    echo "    git rebase --whitespace=fix HEAD~1"
    echo "or"
    echo "    git rebase --whitespace=fix master"
    echo "and then a forced push of the correct branch"
    exit 1
fi
back to top