mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	gitlint has a bunch of pinned requirements that hold back important upgrades and conflict with other packages’ requirements. The gitlint author has rejected proposals to unpin them because it might increase the amount of maintenance he needs to do (https://github.com/jorisroovers/gitlint/pull/133). That decision is his to make, but _somebody_ needs to do the maintenance, so we delegate it to Debian and Ubuntu. If that means using a significantly older version of gitlint, that’s a tradeoff we need to make to keep the rest of our requirements current. Signed-off-by: Anders Kaseorg <anders@zulip.com>
		
			
				
	
	
		
			23 lines
		
	
	
		
			621 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			23 lines
		
	
	
		
			621 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
#!/usr/bin/env bash
 | 
						|
 | 
						|
# This hook runs gitlint on your commit message.
 | 
						|
 | 
						|
# If your machine contains a provisioned Zulip development environment, the
 | 
						|
# linter will be invoked through `vagrant ssh`.
 | 
						|
 | 
						|
# Do not invoke gitlint if commit message is empty
 | 
						|
if grep -q '^[^#]' "$1"; then
 | 
						|
    lint_cmd="cd ~/zulip && gitlint"
 | 
						|
    if
 | 
						|
        if [ -z "$VIRTUAL_ENV" ] && command -v vagrant >/dev/null && [ -e .vagrant ]; then
 | 
						|
            ! vagrant ssh -c "$lint_cmd"
 | 
						|
        else
 | 
						|
            ! eval "$lint_cmd"
 | 
						|
        fi <"$1"
 | 
						|
    then
 | 
						|
        echo "WARNING: Your commit message does not match Zulip's style guide."
 | 
						|
    fi
 | 
						|
fi
 | 
						|
 | 
						|
exit 0
 |