Add .clang-format
Most options are configured to keep most of the current style. Signed-off-by: Tim Crawford <tcrawford@system76.com>
This commit is contained in:
		
				
					committed by
					
						 Jeremy Soller
						Jeremy Soller
					
				
			
			
				
	
			
			
			
						parent
						
							f21cc6d602
						
					
				
				
					commit
					04df6ae311
				
			
							
								
								
									
										16
									
								
								scripts/clang-format.sh
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										16
									
								
								scripts/clang-format.sh
									
									
									
									
									
										Executable file
									
								
							| @@ -0,0 +1,16 @@ | ||||
| #!/usr/bin/env bash | ||||
| # SPDX-License-Identifier: GPL-3.0-only | ||||
|  | ||||
| FILES=($(git ls-files '*.[ch]')) | ||||
|  | ||||
| FMT_OPTS=( | ||||
|     "-style=file" | ||||
|     "--fallback-style=none" | ||||
|     "--Werror" | ||||
| ) | ||||
|  | ||||
| if [[ "$1" = "apply" ]]; then | ||||
|     clang-format "${FMT_OPTS[@]}" -i "${FILES[@]}" | ||||
| else | ||||
|     clang-format "${FMT_OPTS[@]}" --dry-run "${FILES[@]}" | ||||
| fi | ||||
| @@ -19,6 +19,7 @@ if [[ "${ID}" =~ "debian" ]] || [[ "${ID_LIKE}" =~ "debian" ]]; then | ||||
|         --yes \ | ||||
|         avr-libc \ | ||||
|         avrdude \ | ||||
|         clang-format \ | ||||
|         curl \ | ||||
|         gcc \ | ||||
|         gcc-avr \ | ||||
| @@ -35,6 +36,7 @@ elif [[ "${ID}" =~ "fedora" ]] || [[ "${ID_LIKE}" =~ "fedora" ]]; then | ||||
|         avr-gcc \ | ||||
|         avr-libc \ | ||||
|         avrdude \ | ||||
|         clang-tools-extra \ | ||||
|         curl \ | ||||
|         gcc \ | ||||
|         make \ | ||||
| @@ -47,6 +49,7 @@ elif [[ "${ID}" =~ "arch" ]] || [[ "${ID_LIKE}" =~ "arch" ]]; then | ||||
|         avr-gcc \ | ||||
|         avr-libc \ | ||||
|         avrdude \ | ||||
|         clang \ | ||||
|         curl \ | ||||
|         gcc \ | ||||
|         make \ | ||||
|   | ||||
		Reference in New Issue
	
	Block a user