mirror of
				https://github.com/zulip/zulip.git
				synced 2025-10-31 03:53:50 +00:00 
			
		
		
		
	Adds the --frontend and --backend options to replace --pep8. Significantly modified by tabbott to use a cleaner framework.
		
			
				
	
	
		
			26 lines
		
	
	
		
			853 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			26 lines
		
	
	
		
			853 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
| #!/bin/bash
 | |
| 
 | |
| # This hook runs the Zulip code linter ./tools/lint and returns true
 | |
| # regardless of linter results so that your commit may continue.
 | |
| 
 | |
| # Messages from the linter will be printed out to the screen.
 | |
| #
 | |
| # If you are running this one machine hosting a Vagrant guest that
 | |
| # contains your provisioned Zulip development environment, the linter
 | |
| # will automatically be run through `vagrant ssh`.
 | |
| 
 | |
| changed_files=$(git diff --cached --name-only --diff-filter=ACM)
 | |
| if [ -z "$changed_files" ]; then
 | |
|     echo "No changed files to lint."
 | |
|     exit 0
 | |
| fi
 | |
| 
 | |
| if [ -z "$VIRTUAL_ENV" ] && `which vagrant > /dev/null` && [ -e .vagrant ]; then
 | |
|     vcmd="/srv/zulip/tools/lint --no-gitlint --force $changed_files || true"
 | |
|     echo "Running lint using vagrant..."
 | |
|     vagrant ssh -c "$vcmd"
 | |
| else
 | |
|     ./tools/lint --no-gitlint --force $changed_files || true
 | |
| fi
 | |
| exit 0
 |