| 
									
										
										
										
											2022-03-26 23:52:52 +00:00
										 |  |  | # EXAMPLE USAGE
 | 
					
						
							|  |  |  | # Refer for explanation to following link:
 | 
					
						
							|  |  |  | # https://github.com/evilmartians/lefthook/blob/master/docs/full_guide.md
 | 
					
						
							|  |  |  | #
 | 
					
						
							| 
									
										
										
										
											2022-03-26 23:52:52 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | color: true
 | 
					
						
							|  |  |  | extends: {}
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | pre-push:
 | 
					
						
							|  |  |  |   parallel: true
 | 
					
						
							|  |  |  |   commands:
 | 
					
						
							|  |  |  |     packages-audit:
 | 
					
						
							|  |  |  |       tags: security
 | 
					
						
							|  |  |  |       run: yarn audit
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | pre-commit:
 | 
					
						
							|  |  |  |   parallel: true
 | 
					
						
							|  |  |  |   commands:
 | 
					
						
							|  |  |  |     format documents:
 | 
					
						
							|  |  |  |       glob: '*.{md,mdx}'
 | 
					
						
							|  |  |  |       run: yarn prettier --write {staged_files}
 | 
					
						
							|  |  |  |     format configs:
 | 
					
						
							|  |  |  |       glob: '*.{json,yml,yaml}'
 | 
					
						
							|  |  |  |       run: yarn prettier --write {staged_files}
 | 
					
						
							|  |  |  |     format code:
 | 
					
						
							|  |  |  |       glob: '*.{js,jsx,ts,tsx}'
 | 
					
						
							|  |  |  |       exclude: 'dist/'
 | 
					
						
							|  |  |  |       run: yarn prettier --write {staged_files} && yarn eslint {staged_files} && git add {staged_files}
 | 
					
						
							|  |  |  |     run tests:
 | 
					
						
							|  |  |  |       glob: '*.{js,jsx,ts,tsx}'
 | 
					
						
							|  |  |  |       exclude: 'dist/'
 | 
					
						
							|  |  |  |       run: yarn jest --passWithNoTests --findRelatedTests {staged_files}
 | 
					
						
							|  |  |  |     build distributables:
 | 
					
						
							|  |  |  |       skip: ['merge', 'rebase']
 | 
					
						
							|  |  |  |       run: yarn build && git add dist
 | 
					
						
							|  |  |  |     make shell script executable:
 | 
					
						
							|  |  |  |       glob: '*.sh'
 | 
					
						
							|  |  |  |       run: git update-index --chmod=+x
 |