mirror of
				https://gitea.invidious.io/iv-org/shard-ameba.git
				synced 2024-08-15 00:53:29 +00:00 
			
		
		
		
	Correct trailing blank line position
This commit is contained in:
		
							parent
							
								
									1d96319506
								
							
						
					
					
						commit
						32ac199162
					
				
					 2 changed files with 2 additions and 2 deletions
				
			
		| 
						 | 
					@ -30,7 +30,7 @@ module Ameba::Rule::Layout
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      issue = source.issues.first
 | 
					      issue = source.issues.first
 | 
				
			||||||
      issue.rule.should_not be_nil
 | 
					      issue.rule.should_not be_nil
 | 
				
			||||||
      issue.location.to_s.should eq "source.cr:3:1"
 | 
					      issue.location.to_s.should eq "source.cr:2:1"
 | 
				
			||||||
      issue.end_location.should be_nil
 | 
					      issue.end_location.should be_nil
 | 
				
			||||||
      issue.message.should eq "Blank lines detected at the end of the file"
 | 
					      issue.message.should eq "Blank lines detected at the end of the file"
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -17,7 +17,7 @@ module Ameba::Rule::Layout
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def test(source)
 | 
					    def test(source)
 | 
				
			||||||
      if source.lines.size > 1 && source.lines[-2, 2].join.strip.empty?
 | 
					      if source.lines.size > 1 && source.lines[-2, 2].join.strip.empty?
 | 
				
			||||||
        issue_for({source.lines.size, 1}, MSG)
 | 
					        issue_for({source.lines.size - 1, 1}, MSG)
 | 
				
			||||||
      end
 | 
					      end
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue