mirror of
				https://gitea.invidious.io/iv-org/shard-ameba.git
				synced 2024-08-15 00:53:29 +00:00 
			
		
		
		
	Merge branch 'develop'
This commit is contained in:
		
						commit
						9a25214bb5
					
				
					 2 changed files with 11 additions and 2 deletions
				
			
		|  | @ -47,11 +47,11 @@ module Ameba::Rule::Style | |||
|     end | ||||
| 
 | ||||
|     context "macro" do | ||||
|       it "reports in macro scope" do | ||||
|       it "doesn't report in macro scope" do | ||||
|         source = Source.new %( | ||||
|           {{ [1, 2, nil].reject(&.nil?) }} | ||||
|         ) | ||||
|         subject.catch(source).should_not be_valid | ||||
|         subject.catch(source).should be_valid | ||||
|       end | ||||
|     end | ||||
| 
 | ||||
|  |  | |||
|  | @ -46,6 +46,15 @@ module Ameba::Rule::Style | |||
| 
 | ||||
|     MSG = "Use `%s(%s)` instead of `%s {...}`" | ||||
| 
 | ||||
|     def test(source) | ||||
|       AST::NodeVisitor.new self, source, skip: [ | ||||
|         Crystal::Macro, | ||||
|         Crystal::MacroExpression, | ||||
|         Crystal::MacroIf, | ||||
|         Crystal::MacroFor, | ||||
|       ] | ||||
|     end | ||||
| 
 | ||||
|     def test(source, node : Crystal::Call) | ||||
|       return unless node.name.in?(filter_names) | ||||
|       return unless (block = node.block) | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue