mirror of
				https://gitea.invidious.io/iv-org/shard-ameba.git
				synced 2024-08-15 00:53:29 +00:00 
			
		
		
		
	Ignore alternative names starting with _
				
					
				
			This commit is contained in:
		
							parent
							
								
									d6c6af883d
								
							
						
					
					
						commit
						21a3850a65
					
				
					 1 changed files with 1 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -41,7 +41,7 @@ module Ameba::Rule
 | 
			
		|||
    def test(source, node : Crystal::Def)
 | 
			
		||||
      if node.name =~ /^(is|has)_(\w+)\?/
 | 
			
		||||
        alternative = $2
 | 
			
		||||
        return unless alternative =~ /^[a-z_][a-zA-Z_0-9]*$/
 | 
			
		||||
        return unless alternative =~ /^[a-z][a-zA-Z_0-9]*$/
 | 
			
		||||
 | 
			
		||||
        source.error self, node.location,
 | 
			
		||||
          "Favour method name '#{alternative}?' over '#{node.name}'"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue