mirror of
				https://github.com/matrix-org/gomatrix
				synced 2025-11-03 22:08:04 +00:00 
			
		
		
		
	Add misspell and ineffassign to the pre-commit hooks
This commit is contained in:
		
							parent
							
								
									27ae91d1b3
								
							
						
					
					
						commit
						735a423c76
					
				
					 2 changed files with 18 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -3,6 +3,23 @@
 | 
			
		|||
set -eu
 | 
			
		||||
 | 
			
		||||
golint
 | 
			
		||||
misspell --error .
 | 
			
		||||
 | 
			
		||||
# gofmt doesn't exit with an error code if the files don't match the expected
 | 
			
		||||
# format. So we have to run it and see if it outputs anything.
 | 
			
		||||
if gofmt -l -s . 2>&1 | read
 | 
			
		||||
then
 | 
			
		||||
    echo "Error: not all code had been formatted with gofmt."
 | 
			
		||||
    echo "Fixing the following files"
 | 
			
		||||
    gofmt -s -w -l .
 | 
			
		||||
    echo
 | 
			
		||||
    echo "Please add them to the commit"
 | 
			
		||||
    git status --short
 | 
			
		||||
    exit 1
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
ineffassign .
 | 
			
		||||
 | 
			
		||||
go fmt
 | 
			
		||||
go tool vet --all --shadow .
 | 
			
		||||
gocyclo -over 12 .
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue