mirror of
				https://git.proxmox.com/git/mirror_zfs.git
				synced 2025-10-26 18:05:04 +03:00 
			
		
		
		
	cstyle.pl: echo commands for github workflow
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: George Melikov <mail@gmelikov.ru> Closes #10705
This commit is contained in:
		
							parent
							
								
									2925ed6c70
								
							
						
					
					
						commit
						42d4a8e5fe
					
				| @ -58,8 +58,9 @@ use Getopt::Std; | |||||||
| use strict; | use strict; | ||||||
| 
 | 
 | ||||||
| my $usage = | my $usage = | ||||||
| "usage: cstyle [-chpvCP] [-o constructs] file ... | "usage: cstyle [-cghpvCP] [-o constructs] file ... | ||||||
| 	-c	check continuation indentation inside functions | 	-c	check continuation indentation inside functions | ||||||
|  | 	-g	print github actions' workflow commands | ||||||
| 	-h	perform heuristic checks that are sometimes wrong | 	-h	perform heuristic checks that are sometimes wrong | ||||||
| 	-p	perform some of the more picky checks | 	-p	perform some of the more picky checks | ||||||
| 	-v	verbose | 	-v	verbose | ||||||
| @ -73,12 +74,13 @@ my $usage = | |||||||
| 
 | 
 | ||||||
| my %opts; | my %opts; | ||||||
| 
 | 
 | ||||||
| if (!getopts("cho:pvCP", \%opts)) { | if (!getopts("cgho:pvCP", \%opts)) { | ||||||
| 	print $usage; | 	print $usage; | ||||||
| 	exit 2; | 	exit 2; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| my $check_continuation = $opts{'c'}; | my $check_continuation = $opts{'c'}; | ||||||
|  | my $github_workflow = $opts{'g'} || $ENV{'CI'}; | ||||||
| my $heuristic = $opts{'h'}; | my $heuristic = $opts{'h'}; | ||||||
| my $picky = $opts{'p'}; | my $picky = $opts{'p'}; | ||||||
| my $verbose = $opts{'v'}; | my $verbose = $opts{'v'}; | ||||||
| @ -198,6 +200,9 @@ sub err($) { | |||||||
| 		} else { | 		} else { | ||||||
| 			printf $fmt, $filename, $., $error; | 			printf $fmt, $filename, $., $error; | ||||||
| 		} | 		} | ||||||
|  | 		if ($github_workflow) { | ||||||
|  | 			printf "::error file=%s,line=%s::%s\n", $filename, $., $error; | ||||||
|  | 		} | ||||||
| 		$err_stat = 1; | 		$err_stat = 1; | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 George Melikov
						George Melikov