Disable Metrics/LineLength for long URL lines in patches_spec.rb
- The final two `brew style` offenses were for Metrics/LineLength where parsing the GitHub diff URL as a regex took 119/118 lines. - This disables the cop for each of those long, problematic lines, and re-enables them straight afterwards, else they'd apply to the whole file from the first occurrence onwards, which we probably don't want? - I wondered about increasing the LineLength limit to 119 or 120, but it appears to have been set for a justifiable reason in 80d75bc0d8.
This commit is contained in:
		
							parent
							
								
									3570cb6e77
								
							
						
					
					
						commit
						fed1bbe029
					
				@ -88,7 +88,9 @@ describe RuboCop::Cop::FormulaAudit::Patches do
 | 
				
			|||||||
             line:     5,
 | 
					             line:     5,
 | 
				
			||||||
             column:   5,
 | 
					             column:   5,
 | 
				
			||||||
             source:   source }]
 | 
					             source:   source }]
 | 
				
			||||||
 | 
					        # rubocop:disable Metrics/LineLength
 | 
				
			||||||
        elsif %r{https?://patch-diff\.githubusercontent\.com/raw/(.+)/(.+)/pull/(.+)\.(?:diff|patch)}.match?(patch_url)
 | 
					        elsif %r{https?://patch-diff\.githubusercontent\.com/raw/(.+)/(.+)/pull/(.+)\.(?:diff|patch)}.match?(patch_url)
 | 
				
			||||||
 | 
					          # rubocop:enable Metrics/LineLength
 | 
				
			||||||
          [{ message:
 | 
					          [{ message:
 | 
				
			||||||
                       <<~EOS,
 | 
					                       <<~EOS,
 | 
				
			||||||
                         use GitHub pull request URLs:
 | 
					                         use GitHub pull request URLs:
 | 
				
			||||||
@ -223,7 +225,9 @@ describe RuboCop::Cop::FormulaAudit::Patches do
 | 
				
			|||||||
             line:     5,
 | 
					             line:     5,
 | 
				
			||||||
             column:   9,
 | 
					             column:   9,
 | 
				
			||||||
             source:   source }]
 | 
					             source:   source }]
 | 
				
			||||||
 | 
					        # rubocop:disable Metrics/LineLength
 | 
				
			||||||
        elsif %r{https?://patch-diff\.githubusercontent\.com/raw/(.+)/(.+)/pull/(.+)\.(?:diff|patch)}.match?(patch_url)
 | 
					        elsif %r{https?://patch-diff\.githubusercontent\.com/raw/(.+)/(.+)/pull/(.+)\.(?:diff|patch)}.match?(patch_url)
 | 
				
			||||||
 | 
					          # rubocop:enable Metrics/LineLength
 | 
				
			||||||
          [{ message:
 | 
					          [{ message:
 | 
				
			||||||
                       <<~EOS,
 | 
					                       <<~EOS,
 | 
				
			||||||
                         use GitHub pull request URLs:
 | 
					                         use GitHub pull request URLs:
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user