paraxial 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
 - data/lib/paraxial/version.rb +1 -1
 - data/lib/rubocop/cop/paraxial/sql.rb +6 -0
 - metadata +1 -1
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 3849213ba15a24d63699e026fbf59c0c3633d66c2f9c3a20a787ecbb43d6a727
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: ea7d9cf3fcd4909b51c98c0922b83e834c7d04a5df204cfc64e44b2701e0eb09
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 860660578753aa78749fbadedcf1fc5789bc41ad1d89d1afbf17b60c10dfc6ddc8f6900a082d99b4e915db65e3e99c9c36ee490c05e49853dd681071865546a7
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: fb5bfb5f315482914d0fad182489180558be34975f8e1224ce07f906b29ca59c7642d153505b0ec6cb5903e8c7b24e492ca301e91a2015c64b0379ae93d01e8d
         
     | 
    
        data/lib/paraxial/version.rb
    CHANGED
    
    
| 
         @@ -86,6 +86,10 @@ module RuboCop 
     | 
|
| 
       86 
86 
     | 
    
         
             
                      where
         
     | 
| 
       87 
87 
     | 
    
         
             
                    ].freeze
         
     | 
| 
       88 
88 
     | 
    
         | 
| 
      
 89 
     | 
    
         
            +
                    def_node_matcher :object_manipulation?, <<~'PATTERN'
         
     | 
| 
      
 90 
     | 
    
         
            +
                      (send _ _ (send ...)) # Matches object methods (send node within a send)
         
     | 
| 
      
 91 
     | 
    
         
            +
                    PATTERN
         
     | 
| 
      
 92 
     | 
    
         
            +
             
     | 
| 
       89 
93 
     | 
    
         
             
                    def_node_matcher :non_literal_condition?, <<~'PATTERN'
         
     | 
| 
       90 
94 
     | 
    
         
             
                      (
         
     | 
| 
       91 
95 
     | 
    
         
             
                        send _ _                             # Match `where` and `Model.find_by`
         
     | 
| 
         @@ -100,6 +104,8 @@ module RuboCop 
     | 
|
| 
       100 
104 
     | 
    
         
             
                    end
         
     | 
| 
       101 
105 
     | 
    
         | 
| 
       102 
106 
     | 
    
         
             
                    def on_send(node)
         
     | 
| 
      
 107 
     | 
    
         
            +
                      return if object_manipulation?(node)
         
     | 
| 
      
 108 
     | 
    
         
            +
             
     | 
| 
       103 
109 
     | 
    
         
             
                      return unless non_literal_condition?(node)
         
     | 
| 
       104 
110 
     | 
    
         | 
| 
       105 
111 
     | 
    
         
             
                      add_offense(node)
         
     |