mirror of
				https://gitea.invidious.io/iv-org/shard-ameba.git
				synced 2024-08-15 00:53:29 +00:00 
			
		
		
		
	Tweak reported location for Lint/UnusedBlockArgument
				
					
				
			This commit is contained in:
		
							parent
							
								
									2d9e328d97
								
							
						
					
					
						commit
						bbbfdfc5a2
					
				
					 2 changed files with 5 additions and 5 deletions
				
			
		| 
						 | 
				
			
			@ -38,7 +38,7 @@ module Ameba::Rule::Lint
 | 
			
		|||
    it "reports if block arg is not used" do
 | 
			
		||||
      source = expect_issue subject, <<-CRYSTAL
 | 
			
		||||
        def method(a, b, c, &block)
 | 
			
		||||
                           # ^ error: Unused block argument `block`. [...]
 | 
			
		||||
                           # ^^^^^ error: Unused block argument `block`. [...]
 | 
			
		||||
        end
 | 
			
		||||
        CRYSTAL
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -51,7 +51,7 @@ module Ameba::Rule::Lint
 | 
			
		|||
    it "reports if unused and there is yield" do
 | 
			
		||||
      source = expect_issue subject, <<-CRYSTAL
 | 
			
		||||
        def method(a, b, c, &block)
 | 
			
		||||
                           # ^ error: Use `&` as an argument name to indicate that it won't be referenced.
 | 
			
		||||
                           # ^^^^^ error: Use `&` as an argument name to indicate that it won't be referenced.
 | 
			
		||||
          3.times do |i|
 | 
			
		||||
            i.try do
 | 
			
		||||
              yield i
 | 
			
		||||
| 
						 | 
				
			
			@ -94,7 +94,7 @@ module Ameba::Rule::Lint
 | 
			
		|||
        source = expect_issue subject, <<-CRYSTAL
 | 
			
		||||
          class Bar < Foo
 | 
			
		||||
            def method(a, b, c, &block)
 | 
			
		||||
                               # ^ error: Unused block argument `block`. [...]
 | 
			
		||||
                               # ^^^^^ error: Unused block argument `block`. [...]
 | 
			
		||||
              super a, b, c
 | 
			
		||||
            end
 | 
			
		||||
          end
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue