mirror of
				https://gitea.invidious.io/iv-org/shard-ameba.git
				synced 2024-08-15 00:53:29 +00:00 
			
		
		
		
	ChainedCallsWithNoBang -> ChainedCallWithNoBang
This commit is contained in:
		
							parent
							
								
									79ff1f75db
								
							
						
					
					
						commit
						6acb8ad2eb
					
				
					 2 changed files with 5 additions and 5 deletions
				
			
		| 
						 | 
					@ -1,9 +1,9 @@
 | 
				
			||||||
require "../../../spec_helper"
 | 
					require "../../../spec_helper"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
module Ameba::Rule::Performance
 | 
					module Ameba::Rule::Performance
 | 
				
			||||||
  subject = ChainedCallsWithNoBang.new
 | 
					  subject = ChainedCallWithNoBang.new
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  describe ChainedCallsWithNoBang do
 | 
					  describe ChainedCallWithNoBang do
 | 
				
			||||||
    it "passes if there is no potential performance improvements" do
 | 
					    it "passes if there is no potential performance improvements" do
 | 
				
			||||||
      source = Source.new %(
 | 
					      source = Source.new %(
 | 
				
			||||||
        (1..3).select { |e| e > 1 }.sort!
 | 
					        (1..3).select { |e| e > 1 }.sort!
 | 
				
			||||||
| 
						 | 
					@ -35,7 +35,7 @@ module Ameba::Rule::Performance
 | 
				
			||||||
        source = Source.new %(
 | 
					        source = Source.new %(
 | 
				
			||||||
          [1, 2, 3].select { |e| e > 2 }.reverse
 | 
					          [1, 2, 3].select { |e| e > 2 }.reverse
 | 
				
			||||||
        )
 | 
					        )
 | 
				
			||||||
        rule = ChainedCallsWithNoBang.new
 | 
					        rule = ChainedCallWithNoBang.new
 | 
				
			||||||
        rule.call_names = %w(uniq)
 | 
					        rule.call_names = %w(uniq)
 | 
				
			||||||
        rule.catch(source).should be_valid
 | 
					        rule.catch(source).should be_valid
 | 
				
			||||||
      end
 | 
					      end
 | 
				
			||||||
| 
						 | 
					@ -25,7 +25,7 @@ module Ameba::Rule::Performance
 | 
				
			||||||
  # YAML configuration example:
 | 
					  # YAML configuration example:
 | 
				
			||||||
  #
 | 
					  #
 | 
				
			||||||
  # ```
 | 
					  # ```
 | 
				
			||||||
  # Performance/ChainedCallsWithNoBang
 | 
					  # Performance/ChainedCallWithNoBang
 | 
				
			||||||
  #   Enabled: true
 | 
					  #   Enabled: true
 | 
				
			||||||
  #   CallNames:
 | 
					  #   CallNames:
 | 
				
			||||||
  #     - uniq
 | 
					  #     - uniq
 | 
				
			||||||
| 
						 | 
					@ -34,7 +34,7 @@ module Ameba::Rule::Performance
 | 
				
			||||||
  #     - shuffle
 | 
					  #     - shuffle
 | 
				
			||||||
  #     - reverse
 | 
					  #     - reverse
 | 
				
			||||||
  # ```
 | 
					  # ```
 | 
				
			||||||
  class ChainedCallsWithNoBang < Base
 | 
					  class ChainedCallWithNoBang < Base
 | 
				
			||||||
    properties do
 | 
					    properties do
 | 
				
			||||||
      description "Identifies usage of chained calls not utilizing the bang method variants."
 | 
					      description "Identifies usage of chained calls not utilizing the bang method variants."
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue