mirror of
				https://github.com/actions-rs/cargo.git
				synced 2025-10-31 16:23:50 +00:00 
			
		
		
		
	Enabling rustfmt problem matcher on demand
This commit is contained in:
		
							parent
							
								
									333d0cf286
								
							
						
					
					
						commit
						d45f23b72c
					
				| @ -2,11 +2,13 @@ | ||||
|     "problemMatcher": [ | ||||
|         { | ||||
|             "owner": "rustfmt", | ||||
|             "pattern": { | ||||
|                 "regexp": "^Diff in (\\S+) at line (\\d+):$", | ||||
|                 "file": 1, | ||||
|                 "line": 2 | ||||
|             } | ||||
|             "pattern": [ | ||||
|                 { | ||||
|                     "regexp": "^Diff in (\\S+) at line (\\d+):$", | ||||
|                     "file": 1, | ||||
|                     "line": 2 | ||||
|                 } | ||||
|             ] | ||||
|         } | ||||
|     ] | ||||
| } | ||||
|  | ||||
							
								
								
									
										12
									
								
								dist/.matchers/rustfmt.json
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										12
									
								
								dist/.matchers/rustfmt.json
									
									
									
									
										vendored
									
									
								
							| @ -2,11 +2,13 @@ | ||||
|     "problemMatcher": [ | ||||
|         { | ||||
|             "owner": "rustfmt", | ||||
|             "pattern": { | ||||
|                 "regexp": "^Diff in (\\S+) at line (\\d+):$", | ||||
|                 "file": 1, | ||||
|                 "line": 2 | ||||
|             } | ||||
|             "pattern": [ | ||||
|                 { | ||||
|                     "regexp": "^Diff in (\\S+) at line (\\d+):$", | ||||
|                     "file": 1, | ||||
|                     "line": 2 | ||||
|                 } | ||||
|             ] | ||||
|         } | ||||
|     ] | ||||
| } | ||||
|  | ||||
							
								
								
									
										2
									
								
								dist/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								dist/index.js
									
									
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							| @ -24,11 +24,14 @@ export async function run(actionInput: input.Input): Promise<void> { | ||||
| } | ||||
| 
 | ||||
| async function main(): Promise<void> { | ||||
|     const actionInput = input.get(); | ||||
| 
 | ||||
|     const matchersPath = path.join(__dirname, '.matchers'); | ||||
|     console.log(`::add-matcher::${path.join(matchersPath, 'rust.json')}`); | ||||
|     console.log(`::add-matcher::${path.join(matchersPath, 'rustfmt.json')}`); | ||||
| 
 | ||||
|     const actionInput = input.get(); | ||||
|     // Enabling `rustfmt` problem matcher only if `cargo fmt` is called
 | ||||
|     if (actionInput.command == 'fmt') { | ||||
|         console.log(`::add-matcher::${path.join(matchersPath, 'rustfmt.json')}`); | ||||
|     } | ||||
| 
 | ||||
|     try { | ||||
|         await run(actionInput); | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user