mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-10-30 03:56:23 -05:00 
			
		
		
		
	 96738277d9
			
		
	
	96738277d9
	
	
	
		
			
			Ensure that no source files have trailing whitespace at end of lines and ensure that all files end with a single trailing newline. This also adds Github Actions to enforce whitespace conventions.
		
			
				
	
	
		
			27 lines
		
	
	
		
			504 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			27 lines
		
	
	
		
			504 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
| #!/bin/bash
 | |
| 
 | |
| # Check for trailing whitespace at end of lines.
 | |
| 
 | |
| # Exit on first failing command.
 | |
| set -e
 | |
| # Exit on unset variable.
 | |
| set -u
 | |
| 
 | |
| FOUND_TRAILING_WHITESPACE=0
 | |
| 
 | |
| while read -r line; do
 | |
|   if grep \
 | |
|     "\s$" \
 | |
|     --line-number \
 | |
|     --with-filename \
 | |
|     --binary-files=without-match \
 | |
|     --exclude="*.svg" \
 | |
|     --exclude="*.eps" \
 | |
|     "${line}"; then
 | |
|     echo "ERROR: Found trailing whitespace" >&2;
 | |
|     FOUND_TRAILING_WHITESPACE=1
 | |
|   fi
 | |
| done < <(git ls-files)
 | |
| 
 | |
| exit "${FOUND_TRAILING_WHITESPACE}"
 |