| 
									
										
										
										
											2020-04-03 01:10:02 +02:00
										 |  |  | #!/usr/bin/env bash
 | 
					
						
							| 
									
										
										
										
											2022-09-08 08:48:30 +02:00
										 |  |  | set -euo pipefail | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | if [ ! -x "$(command -v astyle_py)" ]; then | 
					
						
							|  |  |  | 	echo "astyle_py not found, please install astyle_py:" | 
					
						
							|  |  |  | 	echo "  pip install -U astyle_py==VERSION" | 
					
						
							|  |  |  | 	echo "where VERSION is the same as in .pre-commit-config.yaml." | 
					
						
							|  |  |  | 	exit 1 | 
					
						
							|  |  |  | fi | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # "--astyle-version" here has to be in sync with pre-commit-config.yaml. | 
					
						
							|  |  |  | # The rest of the options have to be in sync with the default rules in tools/ci/astyle-rules.yml. | 
					
						
							|  |  |  | astyle_py --astyle-version=3.4.7 \
 | 
					
						
							| 
									
										
										
										
											2016-09-01 12:32:05 +08:00
										 |  |  | 	--style=otbs \
 | 
					
						
							| 
									
										
										
										
											2019-09-25 11:08:21 +08:00
										 |  |  | 	--attach-namespaces \
 | 
					
						
							|  |  |  | 	--attach-classes \
 | 
					
						
							| 
									
										
										
										
											2016-09-01 12:32:05 +08:00
										 |  |  | 	--indent=spaces=4 \
 | 
					
						
							|  |  |  | 	--convert-tabs \
 | 
					
						
							|  |  |  | 	--align-reference=name \
 | 
					
						
							|  |  |  | 	--keep-one-line-statements \
 | 
					
						
							|  |  |  | 	--pad-header \
 | 
					
						
							|  |  |  | 	--pad-oper \
 | 
					
						
							| 
									
										
										
										
											2022-09-08 08:48:30 +02:00
										 |  |  | 	--unpad-paren \
 | 
					
						
							|  |  |  | 	--max-continuation-indent=120 \
 | 
					
						
							| 
									
										
										
										
											2016-09-01 12:32:05 +08:00
										 |  |  | 	"$@" |