CI: Add workflow for codebase formatting (#7382)
* Add workflow for codebase formatting * stash * review comments * Swap to a more complete push action
This commit is contained in:
		
							parent
							
								
									82bb47a2f1
								
							
						
					
					
						commit
						6c4b6531fe
					
				
					 5 changed files with 48 additions and 6 deletions
				
			
		| 
						 | 
				
			
			@ -10,12 +10,7 @@ echo "Using git hash ${rev}"
 | 
			
		|||
 | 
			
		||||
if [[ "$TRAVIS_BRANCH" == "master" && "$TRAVIS_PULL_REQUEST" == "false" ]] ; then
 | 
			
		||||
 | 
			
		||||
# fix formatting
 | 
			
		||||
git checkout master
 | 
			
		||||
git diff --diff-filter=AM --name-only -n 1 -z ${TRAVIS_COMMIT_RANGE} | xargs -0 dos2unix
 | 
			
		||||
git diff --diff-filter=AM --name-only -n 1 -z ${TRAVIS_COMMIT_RANGE} '*.c' '*.h' '*.cpp' | grep -z -e '^drivers' -e '^quantum' -e '^tests' -e '^tmk_core' | grep -zv -e 'quantum/template' -e 'tmk_core/protocol/usb_hid' -e 'platforms/chibios' | xargs -0 clang-format-7 -i
 | 
			
		||||
git diff --diff-filter=AM --name-only -n 1 -z ${TRAVIS_COMMIT_RANGE} | xargs -0 git add
 | 
			
		||||
git commit -m "format code according to conventions [skip ci]" && git push git@github.com:qmk/qmk_firmware.git master
 | 
			
		||||
 | 
			
		||||
git diff --name-only -n 1 ${TRAVIS_COMMIT_RANGE}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue