rubocop-erb 0.2.4 → 0.3.1
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/Gemfile.lock +60 -40
 - data/README.md +4 -5
 - data/config/default.yml +4 -0
 - data/gemfiles/ruby_2.7.gemfile +12 -0
 - data/gemfiles/ruby_2.7.gemfile.lock +131 -0
 - data/lib/rubocop/erb/keyword_remover.rb +70 -33
 - data/lib/rubocop/erb/version.rb +1 -1
 - metadata +4 -2
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz: ' 
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 8dd1a38dc89ce7ae5d7234726efd075da3475197ef392869ce3a6c3091049829
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: '016658e07334e120f4b3a5a099df1533ca5dc806106d66a4dcb883852ba0812f'
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 660537eddd2dbfddde1f6f318b086eaa99ff567f7b90998947efcdc5cdbeea05c9ab97e87263aa0a2b15f4eec35996f9c9e95576bd2711047acc6300a6dd075b
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 6756de8632f08c1640735251bd3225ead59072aea590f234caf7fca37ca888212eacfedc44228b51508357536b6dbda99cc5585f3e1e9775ee0cde1b7e51083a
         
     | 
    
        data/Gemfile.lock
    CHANGED
    
    | 
         @@ -1,99 +1,119 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            PATH
         
     | 
| 
       2 
2 
     | 
    
         
             
              remote: .
         
     | 
| 
       3 
3 
     | 
    
         
             
              specs:
         
     | 
| 
       4 
     | 
    
         
            -
                rubocop-erb (0. 
     | 
| 
      
 4 
     | 
    
         
            +
                rubocop-erb (0.3.1)
         
     | 
| 
       5 
5 
     | 
    
         
             
                  better_html
         
     | 
| 
       6 
6 
     | 
    
         
             
                  rubocop (~> 1.45)
         
     | 
| 
       7 
7 
     | 
    
         | 
| 
       8 
8 
     | 
    
         
             
            GEM
         
     | 
| 
       9 
9 
     | 
    
         
             
              remote: https://rubygems.org/
         
     | 
| 
       10 
10 
     | 
    
         
             
              specs:
         
     | 
| 
       11 
     | 
    
         
            -
                actionview (7. 
     | 
| 
       12 
     | 
    
         
            -
                  activesupport (= 7. 
     | 
| 
      
 11 
     | 
    
         
            +
                actionview (7.1.2)
         
     | 
| 
      
 12 
     | 
    
         
            +
                  activesupport (= 7.1.2)
         
     | 
| 
       13 
13 
     | 
    
         
             
                  builder (~> 3.1)
         
     | 
| 
       14 
     | 
    
         
            -
                  erubi (~> 1. 
     | 
| 
       15 
     | 
    
         
            -
                  rails-dom-testing (~> 2. 
     | 
| 
       16 
     | 
    
         
            -
                  rails-html-sanitizer (~> 1. 
     | 
| 
       17 
     | 
    
         
            -
                activesupport (7. 
     | 
| 
      
 14 
     | 
    
         
            +
                  erubi (~> 1.11)
         
     | 
| 
      
 15 
     | 
    
         
            +
                  rails-dom-testing (~> 2.2)
         
     | 
| 
      
 16 
     | 
    
         
            +
                  rails-html-sanitizer (~> 1.6)
         
     | 
| 
      
 17 
     | 
    
         
            +
                activesupport (7.1.2)
         
     | 
| 
      
 18 
     | 
    
         
            +
                  base64
         
     | 
| 
      
 19 
     | 
    
         
            +
                  bigdecimal
         
     | 
| 
       18 
20 
     | 
    
         
             
                  concurrent-ruby (~> 1.0, >= 1.0.2)
         
     | 
| 
      
 21 
     | 
    
         
            +
                  connection_pool (>= 2.2.5)
         
     | 
| 
      
 22 
     | 
    
         
            +
                  drb
         
     | 
| 
       19 
23 
     | 
    
         
             
                  i18n (>= 1.6, < 2)
         
     | 
| 
       20 
24 
     | 
    
         
             
                  minitest (>= 5.1)
         
     | 
| 
      
 25 
     | 
    
         
            +
                  mutex_m
         
     | 
| 
       21 
26 
     | 
    
         
             
                  tzinfo (~> 2.0)
         
     | 
| 
       22 
27 
     | 
    
         
             
                ast (2.4.2)
         
     | 
| 
       23 
     | 
    
         
            -
                 
     | 
| 
      
 28 
     | 
    
         
            +
                base64 (0.2.0)
         
     | 
| 
      
 29 
     | 
    
         
            +
                better_html (2.0.2)
         
     | 
| 
       24 
30 
     | 
    
         
             
                  actionview (>= 6.0)
         
     | 
| 
       25 
31 
     | 
    
         
             
                  activesupport (>= 6.0)
         
     | 
| 
       26 
32 
     | 
    
         
             
                  ast (~> 2.0)
         
     | 
| 
       27 
33 
     | 
    
         
             
                  erubi (~> 1.4)
         
     | 
| 
       28 
34 
     | 
    
         
             
                  parser (>= 2.4)
         
     | 
| 
       29 
35 
     | 
    
         
             
                  smart_properties
         
     | 
| 
      
 36 
     | 
    
         
            +
                bigdecimal (3.1.5)
         
     | 
| 
       30 
37 
     | 
    
         
             
                builder (3.2.4)
         
     | 
| 
       31 
     | 
    
         
            -
                concurrent-ruby (1.2. 
     | 
| 
      
 38 
     | 
    
         
            +
                concurrent-ruby (1.2.2)
         
     | 
| 
      
 39 
     | 
    
         
            +
                connection_pool (2.4.1)
         
     | 
| 
       32 
40 
     | 
    
         
             
                crass (1.0.6)
         
     | 
| 
       33 
41 
     | 
    
         
             
                diff-lcs (1.5.0)
         
     | 
| 
      
 42 
     | 
    
         
            +
                drb (2.2.0)
         
     | 
| 
      
 43 
     | 
    
         
            +
                  ruby2_keywords
         
     | 
| 
       34 
44 
     | 
    
         
             
                erubi (1.12.0)
         
     | 
| 
       35 
     | 
    
         
            -
                i18n (1. 
     | 
| 
      
 45 
     | 
    
         
            +
                i18n (1.14.1)
         
     | 
| 
       36 
46 
     | 
    
         
             
                  concurrent-ruby (~> 1.0)
         
     | 
| 
       37 
     | 
    
         
            -
                json (2. 
     | 
| 
       38 
     | 
    
         
            -
                 
     | 
| 
      
 47 
     | 
    
         
            +
                json (2.7.1)
         
     | 
| 
      
 48 
     | 
    
         
            +
                language_server-protocol (3.17.0.3)
         
     | 
| 
      
 49 
     | 
    
         
            +
                loofah (2.22.0)
         
     | 
| 
       39 
50 
     | 
    
         
             
                  crass (~> 1.0.2)
         
     | 
| 
       40 
     | 
    
         
            -
                  nokogiri (>= 1. 
     | 
| 
       41 
     | 
    
         
            -
                minitest (5. 
     | 
| 
       42 
     | 
    
         
            -
                 
     | 
| 
      
 51 
     | 
    
         
            +
                  nokogiri (>= 1.12.0)
         
     | 
| 
      
 52 
     | 
    
         
            +
                minitest (5.20.0)
         
     | 
| 
      
 53 
     | 
    
         
            +
                mutex_m (0.2.0)
         
     | 
| 
      
 54 
     | 
    
         
            +
                nokogiri (1.16.0-x86_64-linux)
         
     | 
| 
       43 
55 
     | 
    
         
             
                  racc (~> 1.4)
         
     | 
| 
       44 
     | 
    
         
            -
                parallel (1. 
     | 
| 
       45 
     | 
    
         
            -
                parser (3. 
     | 
| 
      
 56 
     | 
    
         
            +
                parallel (1.24.0)
         
     | 
| 
      
 57 
     | 
    
         
            +
                parser (3.3.0.2)
         
     | 
| 
       46 
58 
     | 
    
         
             
                  ast (~> 2.4.1)
         
     | 
| 
       47 
     | 
    
         
            -
             
     | 
| 
       48 
     | 
    
         
            -
                 
     | 
| 
       49 
     | 
    
         
            -
             
     | 
| 
      
 59 
     | 
    
         
            +
                  racc
         
     | 
| 
      
 60 
     | 
    
         
            +
                racc (1.7.3)
         
     | 
| 
      
 61 
     | 
    
         
            +
                rails-dom-testing (2.2.0)
         
     | 
| 
      
 62 
     | 
    
         
            +
                  activesupport (>= 5.0.0)
         
     | 
| 
      
 63 
     | 
    
         
            +
                  minitest
         
     | 
| 
       50 
64 
     | 
    
         
             
                  nokogiri (>= 1.6)
         
     | 
| 
       51 
     | 
    
         
            -
                rails-html-sanitizer (1. 
     | 
| 
       52 
     | 
    
         
            -
                  loofah (~> 2. 
     | 
| 
      
 65 
     | 
    
         
            +
                rails-html-sanitizer (1.6.0)
         
     | 
| 
      
 66 
     | 
    
         
            +
                  loofah (~> 2.21)
         
     | 
| 
      
 67 
     | 
    
         
            +
                  nokogiri (~> 1.14)
         
     | 
| 
       53 
68 
     | 
    
         
             
                rainbow (3.1.1)
         
     | 
| 
       54 
     | 
    
         
            -
                rake (13.0 
     | 
| 
       55 
     | 
    
         
            -
                regexp_parser (2. 
     | 
| 
       56 
     | 
    
         
            -
                rexml (3.2. 
     | 
| 
      
 69 
     | 
    
         
            +
                rake (13.1.0)
         
     | 
| 
      
 70 
     | 
    
         
            +
                regexp_parser (2.8.3)
         
     | 
| 
      
 71 
     | 
    
         
            +
                rexml (3.2.6)
         
     | 
| 
       57 
72 
     | 
    
         
             
                rspec (3.12.0)
         
     | 
| 
       58 
73 
     | 
    
         
             
                  rspec-core (~> 3.12.0)
         
     | 
| 
       59 
74 
     | 
    
         
             
                  rspec-expectations (~> 3.12.0)
         
     | 
| 
       60 
75 
     | 
    
         
             
                  rspec-mocks (~> 3.12.0)
         
     | 
| 
       61 
     | 
    
         
            -
                rspec-core (3.12. 
     | 
| 
      
 76 
     | 
    
         
            +
                rspec-core (3.12.2)
         
     | 
| 
       62 
77 
     | 
    
         
             
                  rspec-support (~> 3.12.0)
         
     | 
| 
       63 
     | 
    
         
            -
                rspec-expectations (3.12. 
     | 
| 
      
 78 
     | 
    
         
            +
                rspec-expectations (3.12.3)
         
     | 
| 
       64 
79 
     | 
    
         
             
                  diff-lcs (>= 1.2.0, < 2.0)
         
     | 
| 
       65 
80 
     | 
    
         
             
                  rspec-support (~> 3.12.0)
         
     | 
| 
       66 
     | 
    
         
            -
                rspec-mocks (3.12. 
     | 
| 
      
 81 
     | 
    
         
            +
                rspec-mocks (3.12.6)
         
     | 
| 
       67 
82 
     | 
    
         
             
                  diff-lcs (>= 1.2.0, < 2.0)
         
     | 
| 
       68 
83 
     | 
    
         
             
                  rspec-support (~> 3.12.0)
         
     | 
| 
       69 
     | 
    
         
            -
                rspec-support (3.12. 
     | 
| 
       70 
     | 
    
         
            -
                rubocop (1. 
     | 
| 
      
 84 
     | 
    
         
            +
                rspec-support (3.12.1)
         
     | 
| 
      
 85 
     | 
    
         
            +
                rubocop (1.59.0)
         
     | 
| 
       71 
86 
     | 
    
         
             
                  json (~> 2.3)
         
     | 
| 
      
 87 
     | 
    
         
            +
                  language_server-protocol (>= 3.17.0)
         
     | 
| 
       72 
88 
     | 
    
         
             
                  parallel (~> 1.10)
         
     | 
| 
       73 
     | 
    
         
            -
                  parser (>= 3.2. 
     | 
| 
      
 89 
     | 
    
         
            +
                  parser (>= 3.2.2.4)
         
     | 
| 
       74 
90 
     | 
    
         
             
                  rainbow (>= 2.2.2, < 4.0)
         
     | 
| 
       75 
91 
     | 
    
         
             
                  regexp_parser (>= 1.8, < 3.0)
         
     | 
| 
       76 
92 
     | 
    
         
             
                  rexml (>= 3.2.5, < 4.0)
         
     | 
| 
       77 
     | 
    
         
            -
                  rubocop-ast (>= 1. 
     | 
| 
      
 93 
     | 
    
         
            +
                  rubocop-ast (>= 1.30.0, < 2.0)
         
     | 
| 
       78 
94 
     | 
    
         
             
                  ruby-progressbar (~> 1.7)
         
     | 
| 
       79 
95 
     | 
    
         
             
                  unicode-display_width (>= 2.4.0, < 3.0)
         
     | 
| 
       80 
     | 
    
         
            -
                rubocop-ast (1. 
     | 
| 
       81 
     | 
    
         
            -
                  parser (>= 3. 
     | 
| 
       82 
     | 
    
         
            -
                rubocop-capybara (2. 
     | 
| 
      
 96 
     | 
    
         
            +
                rubocop-ast (1.30.0)
         
     | 
| 
      
 97 
     | 
    
         
            +
                  parser (>= 3.2.1.0)
         
     | 
| 
      
 98 
     | 
    
         
            +
                rubocop-capybara (2.20.0)
         
     | 
| 
      
 99 
     | 
    
         
            +
                  rubocop (~> 1.41)
         
     | 
| 
      
 100 
     | 
    
         
            +
                rubocop-factory_bot (2.25.1)
         
     | 
| 
       83 
101 
     | 
    
         
             
                  rubocop (~> 1.41)
         
     | 
| 
       84 
102 
     | 
    
         
             
                rubocop-rake (0.6.0)
         
     | 
| 
       85 
103 
     | 
    
         
             
                  rubocop (~> 1.0)
         
     | 
| 
       86 
     | 
    
         
            -
                rubocop-rspec (2. 
     | 
| 
       87 
     | 
    
         
            -
                  rubocop (~> 1. 
     | 
| 
      
 104 
     | 
    
         
            +
                rubocop-rspec (2.26.1)
         
     | 
| 
      
 105 
     | 
    
         
            +
                  rubocop (~> 1.40)
         
     | 
| 
       88 
106 
     | 
    
         
             
                  rubocop-capybara (~> 2.17)
         
     | 
| 
       89 
     | 
    
         
            -
             
     | 
| 
       90 
     | 
    
         
            -
                 
     | 
| 
      
 107 
     | 
    
         
            +
                  rubocop-factory_bot (~> 2.22)
         
     | 
| 
      
 108 
     | 
    
         
            +
                ruby-progressbar (1.13.0)
         
     | 
| 
      
 109 
     | 
    
         
            +
                ruby2_keywords (0.0.5)
         
     | 
| 
      
 110 
     | 
    
         
            +
                sevencop (0.35.1)
         
     | 
| 
       91 
111 
     | 
    
         
             
                  activesupport
         
     | 
| 
       92 
112 
     | 
    
         
             
                  rubocop
         
     | 
| 
       93 
113 
     | 
    
         
             
                smart_properties (1.17.0)
         
     | 
| 
       94 
114 
     | 
    
         
             
                tzinfo (2.0.6)
         
     | 
| 
       95 
115 
     | 
    
         
             
                  concurrent-ruby (~> 1.0)
         
     | 
| 
       96 
     | 
    
         
            -
                unicode-display_width (2. 
     | 
| 
      
 116 
     | 
    
         
            +
                unicode-display_width (2.5.0)
         
     | 
| 
       97 
117 
     | 
    
         | 
| 
       98 
118 
     | 
    
         
             
            PLATFORMS
         
     | 
| 
       99 
119 
     | 
    
         
             
              x86_64-linux
         
     | 
    
        data/README.md
    CHANGED
    
    | 
         @@ -33,7 +33,7 @@ Now you can use RuboCop also for ERB templates. 
     | 
|
| 
       33 
33 
     | 
    
         
             
            ```
         
     | 
| 
       34 
34 
     | 
    
         
             
            $ bundle exec rubocop spec/fixtures/dummy.erb
         
     | 
| 
       35 
35 
     | 
    
         
             
            Inspecting 1 file
         
     | 
| 
       36 
     | 
    
         
            -
             
     | 
| 
      
 36 
     | 
    
         
            +
            C
         
     | 
| 
       37 
37 
     | 
    
         | 
| 
       38 
38 
     | 
    
         
             
            Offenses:
         
     | 
| 
       39 
39 
     | 
    
         | 
| 
         @@ -46,12 +46,11 @@ spec/fixtures/dummy.erb:4:9: C: [Correctable] Style/ZeroLengthPredicate: Use !em 
     | 
|
| 
       46 
46 
     | 
    
         
             
            spec/fixtures/dummy.erb:5:4: C: [Correctable] Style/NegatedIf: Favor unless over if for negative conditions.
         
     | 
| 
       47 
47 
     | 
    
         
             
            <% a if !b %>
         
     | 
| 
       48 
48 
     | 
    
         
             
               ^^^^^^^
         
     | 
| 
       49 
     | 
    
         
            -
            spec/fixtures/dummy.erb:7: 
     | 
| 
       50 
     | 
    
         
            -
            (Using Ruby 2.6 parser; configure using TargetRubyVersion parameter, under AllCops)
         
     | 
| 
      
 49 
     | 
    
         
            +
            spec/fixtures/dummy.erb:7:7: C: [Correctable] Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
         
     | 
| 
       51 
50 
     | 
    
         
             
            <% if "a" %>
         
     | 
| 
      
 51 
     | 
    
         
            +
                  ^^^
         
     | 
| 
       52 
52 
     | 
    
         | 
| 
       53 
     | 
    
         
            -
             
     | 
| 
       54 
     | 
    
         
            -
            1 file inspected, 4 offenses detected, 3 offenses autocorrectable
         
     | 
| 
      
 53 
     | 
    
         
            +
            1 file inspected, 4 offenses detected, 4 offenses autocorrectable
         
     | 
| 
       55 
54 
     | 
    
         
             
            ```
         
     | 
| 
       56 
55 
     | 
    
         | 
| 
       57 
56 
     | 
    
         
             
            ## Workaround
         
     | 
    
        data/config/default.yml
    CHANGED
    
    
| 
         @@ -0,0 +1,131 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            PATH
         
     | 
| 
      
 2 
     | 
    
         
            +
              remote: ..
         
     | 
| 
      
 3 
     | 
    
         
            +
              specs:
         
     | 
| 
      
 4 
     | 
    
         
            +
                rubocop-erb (0.3.0)
         
     | 
| 
      
 5 
     | 
    
         
            +
                  better_html
         
     | 
| 
      
 6 
     | 
    
         
            +
                  rubocop (~> 1.45)
         
     | 
| 
      
 7 
     | 
    
         
            +
             
     | 
| 
      
 8 
     | 
    
         
            +
            GEM
         
     | 
| 
      
 9 
     | 
    
         
            +
              remote: https://rubygems.org/
         
     | 
| 
      
 10 
     | 
    
         
            +
              specs:
         
     | 
| 
      
 11 
     | 
    
         
            +
                actionview (7.1.2)
         
     | 
| 
      
 12 
     | 
    
         
            +
                  activesupport (= 7.1.2)
         
     | 
| 
      
 13 
     | 
    
         
            +
                  builder (~> 3.1)
         
     | 
| 
      
 14 
     | 
    
         
            +
                  erubi (~> 1.11)
         
     | 
| 
      
 15 
     | 
    
         
            +
                  rails-dom-testing (~> 2.2)
         
     | 
| 
      
 16 
     | 
    
         
            +
                  rails-html-sanitizer (~> 1.6)
         
     | 
| 
      
 17 
     | 
    
         
            +
                activesupport (7.1.2)
         
     | 
| 
      
 18 
     | 
    
         
            +
                  base64
         
     | 
| 
      
 19 
     | 
    
         
            +
                  bigdecimal
         
     | 
| 
      
 20 
     | 
    
         
            +
                  concurrent-ruby (~> 1.0, >= 1.0.2)
         
     | 
| 
      
 21 
     | 
    
         
            +
                  connection_pool (>= 2.2.5)
         
     | 
| 
      
 22 
     | 
    
         
            +
                  drb
         
     | 
| 
      
 23 
     | 
    
         
            +
                  i18n (>= 1.6, < 2)
         
     | 
| 
      
 24 
     | 
    
         
            +
                  minitest (>= 5.1)
         
     | 
| 
      
 25 
     | 
    
         
            +
                  mutex_m
         
     | 
| 
      
 26 
     | 
    
         
            +
                  tzinfo (~> 2.0)
         
     | 
| 
      
 27 
     | 
    
         
            +
                ast (2.4.2)
         
     | 
| 
      
 28 
     | 
    
         
            +
                base64 (0.2.0)
         
     | 
| 
      
 29 
     | 
    
         
            +
                better_html (2.0.2)
         
     | 
| 
      
 30 
     | 
    
         
            +
                  actionview (>= 6.0)
         
     | 
| 
      
 31 
     | 
    
         
            +
                  activesupport (>= 6.0)
         
     | 
| 
      
 32 
     | 
    
         
            +
                  ast (~> 2.0)
         
     | 
| 
      
 33 
     | 
    
         
            +
                  erubi (~> 1.4)
         
     | 
| 
      
 34 
     | 
    
         
            +
                  parser (>= 2.4)
         
     | 
| 
      
 35 
     | 
    
         
            +
                  smart_properties
         
     | 
| 
      
 36 
     | 
    
         
            +
                bigdecimal (3.1.5)
         
     | 
| 
      
 37 
     | 
    
         
            +
                builder (3.2.4)
         
     | 
| 
      
 38 
     | 
    
         
            +
                concurrent-ruby (1.2.2)
         
     | 
| 
      
 39 
     | 
    
         
            +
                connection_pool (2.4.1)
         
     | 
| 
      
 40 
     | 
    
         
            +
                crass (1.0.6)
         
     | 
| 
      
 41 
     | 
    
         
            +
                diff-lcs (1.5.0)
         
     | 
| 
      
 42 
     | 
    
         
            +
                drb (2.2.0)
         
     | 
| 
      
 43 
     | 
    
         
            +
                  ruby2_keywords
         
     | 
| 
      
 44 
     | 
    
         
            +
                erubi (1.12.0)
         
     | 
| 
      
 45 
     | 
    
         
            +
                i18n (1.14.1)
         
     | 
| 
      
 46 
     | 
    
         
            +
                  concurrent-ruby (~> 1.0)
         
     | 
| 
      
 47 
     | 
    
         
            +
                json (2.7.1)
         
     | 
| 
      
 48 
     | 
    
         
            +
                language_server-protocol (3.17.0.3)
         
     | 
| 
      
 49 
     | 
    
         
            +
                loofah (2.22.0)
         
     | 
| 
      
 50 
     | 
    
         
            +
                  crass (~> 1.0.2)
         
     | 
| 
      
 51 
     | 
    
         
            +
                  nokogiri (>= 1.12.0)
         
     | 
| 
      
 52 
     | 
    
         
            +
                minitest (5.20.0)
         
     | 
| 
      
 53 
     | 
    
         
            +
                mutex_m (0.2.0)
         
     | 
| 
      
 54 
     | 
    
         
            +
                nokogiri (1.15.5-x86_64-linux)
         
     | 
| 
      
 55 
     | 
    
         
            +
                  racc (~> 1.4)
         
     | 
| 
      
 56 
     | 
    
         
            +
                parallel (1.24.0)
         
     | 
| 
      
 57 
     | 
    
         
            +
                parser (3.3.0.2)
         
     | 
| 
      
 58 
     | 
    
         
            +
                  ast (~> 2.4.1)
         
     | 
| 
      
 59 
     | 
    
         
            +
                  racc
         
     | 
| 
      
 60 
     | 
    
         
            +
                racc (1.7.3)
         
     | 
| 
      
 61 
     | 
    
         
            +
                rails-dom-testing (2.2.0)
         
     | 
| 
      
 62 
     | 
    
         
            +
                  activesupport (>= 5.0.0)
         
     | 
| 
      
 63 
     | 
    
         
            +
                  minitest
         
     | 
| 
      
 64 
     | 
    
         
            +
                  nokogiri (>= 1.6)
         
     | 
| 
      
 65 
     | 
    
         
            +
                rails-html-sanitizer (1.6.0)
         
     | 
| 
      
 66 
     | 
    
         
            +
                  loofah (~> 2.21)
         
     | 
| 
      
 67 
     | 
    
         
            +
                  nokogiri (~> 1.14)
         
     | 
| 
      
 68 
     | 
    
         
            +
                rainbow (3.1.1)
         
     | 
| 
      
 69 
     | 
    
         
            +
                rake (13.1.0)
         
     | 
| 
      
 70 
     | 
    
         
            +
                regexp_parser (2.8.3)
         
     | 
| 
      
 71 
     | 
    
         
            +
                rexml (3.2.6)
         
     | 
| 
      
 72 
     | 
    
         
            +
                rspec (3.12.0)
         
     | 
| 
      
 73 
     | 
    
         
            +
                  rspec-core (~> 3.12.0)
         
     | 
| 
      
 74 
     | 
    
         
            +
                  rspec-expectations (~> 3.12.0)
         
     | 
| 
      
 75 
     | 
    
         
            +
                  rspec-mocks (~> 3.12.0)
         
     | 
| 
      
 76 
     | 
    
         
            +
                rspec-core (3.12.2)
         
     | 
| 
      
 77 
     | 
    
         
            +
                  rspec-support (~> 3.12.0)
         
     | 
| 
      
 78 
     | 
    
         
            +
                rspec-expectations (3.12.3)
         
     | 
| 
      
 79 
     | 
    
         
            +
                  diff-lcs (>= 1.2.0, < 2.0)
         
     | 
| 
      
 80 
     | 
    
         
            +
                  rspec-support (~> 3.12.0)
         
     | 
| 
      
 81 
     | 
    
         
            +
                rspec-mocks (3.12.6)
         
     | 
| 
      
 82 
     | 
    
         
            +
                  diff-lcs (>= 1.2.0, < 2.0)
         
     | 
| 
      
 83 
     | 
    
         
            +
                  rspec-support (~> 3.12.0)
         
     | 
| 
      
 84 
     | 
    
         
            +
                rspec-support (3.12.1)
         
     | 
| 
      
 85 
     | 
    
         
            +
                rubocop (1.59.0)
         
     | 
| 
      
 86 
     | 
    
         
            +
                  json (~> 2.3)
         
     | 
| 
      
 87 
     | 
    
         
            +
                  language_server-protocol (>= 3.17.0)
         
     | 
| 
      
 88 
     | 
    
         
            +
                  parallel (~> 1.10)
         
     | 
| 
      
 89 
     | 
    
         
            +
                  parser (>= 3.2.2.4)
         
     | 
| 
      
 90 
     | 
    
         
            +
                  rainbow (>= 2.2.2, < 4.0)
         
     | 
| 
      
 91 
     | 
    
         
            +
                  regexp_parser (>= 1.8, < 3.0)
         
     | 
| 
      
 92 
     | 
    
         
            +
                  rexml (>= 3.2.5, < 4.0)
         
     | 
| 
      
 93 
     | 
    
         
            +
                  rubocop-ast (>= 1.30.0, < 2.0)
         
     | 
| 
      
 94 
     | 
    
         
            +
                  ruby-progressbar (~> 1.7)
         
     | 
| 
      
 95 
     | 
    
         
            +
                  unicode-display_width (>= 2.4.0, < 3.0)
         
     | 
| 
      
 96 
     | 
    
         
            +
                rubocop-ast (1.30.0)
         
     | 
| 
      
 97 
     | 
    
         
            +
                  parser (>= 3.2.1.0)
         
     | 
| 
      
 98 
     | 
    
         
            +
                rubocop-capybara (2.20.0)
         
     | 
| 
      
 99 
     | 
    
         
            +
                  rubocop (~> 1.41)
         
     | 
| 
      
 100 
     | 
    
         
            +
                rubocop-factory_bot (2.25.1)
         
     | 
| 
      
 101 
     | 
    
         
            +
                  rubocop (~> 1.41)
         
     | 
| 
      
 102 
     | 
    
         
            +
                rubocop-rake (0.6.0)
         
     | 
| 
      
 103 
     | 
    
         
            +
                  rubocop (~> 1.0)
         
     | 
| 
      
 104 
     | 
    
         
            +
                rubocop-rspec (2.26.1)
         
     | 
| 
      
 105 
     | 
    
         
            +
                  rubocop (~> 1.40)
         
     | 
| 
      
 106 
     | 
    
         
            +
                  rubocop-capybara (~> 2.17)
         
     | 
| 
      
 107 
     | 
    
         
            +
                  rubocop-factory_bot (~> 2.22)
         
     | 
| 
      
 108 
     | 
    
         
            +
                ruby-progressbar (1.13.0)
         
     | 
| 
      
 109 
     | 
    
         
            +
                ruby2_keywords (0.0.5)
         
     | 
| 
      
 110 
     | 
    
         
            +
                sevencop (0.35.1)
         
     | 
| 
      
 111 
     | 
    
         
            +
                  activesupport
         
     | 
| 
      
 112 
     | 
    
         
            +
                  rubocop
         
     | 
| 
      
 113 
     | 
    
         
            +
                smart_properties (1.17.0)
         
     | 
| 
      
 114 
     | 
    
         
            +
                tzinfo (2.0.6)
         
     | 
| 
      
 115 
     | 
    
         
            +
                  concurrent-ruby (~> 1.0)
         
     | 
| 
      
 116 
     | 
    
         
            +
                unicode-display_width (2.5.0)
         
     | 
| 
      
 117 
     | 
    
         
            +
             
     | 
| 
      
 118 
     | 
    
         
            +
            PLATFORMS
         
     | 
| 
      
 119 
     | 
    
         
            +
              x86_64-linux
         
     | 
| 
      
 120 
     | 
    
         
            +
             
     | 
| 
      
 121 
     | 
    
         
            +
            DEPENDENCIES
         
     | 
| 
      
 122 
     | 
    
         
            +
              nokogiri (~> 1.15.0)
         
     | 
| 
      
 123 
     | 
    
         
            +
              rake
         
     | 
| 
      
 124 
     | 
    
         
            +
              rspec
         
     | 
| 
      
 125 
     | 
    
         
            +
              rubocop-erb!
         
     | 
| 
      
 126 
     | 
    
         
            +
              rubocop-rake
         
     | 
| 
      
 127 
     | 
    
         
            +
              rubocop-rspec
         
     | 
| 
      
 128 
     | 
    
         
            +
              sevencop
         
     | 
| 
      
 129 
     | 
    
         
            +
             
     | 
| 
      
 130 
     | 
    
         
            +
            BUNDLED WITH
         
     | 
| 
      
 131 
     | 
    
         
            +
               2.3.19
         
     | 
| 
         @@ -21,6 +21,9 @@ module RuboCop 
     | 
|
| 
       21 
21 
     | 
    
         
             
                  def call
         
     | 
| 
       22 
22 
     | 
    
         
             
                    [
         
     | 
| 
       23 
23 
     | 
    
         
             
                      PrecedingKeywordRemover,
         
     | 
| 
      
 24 
     | 
    
         
            +
                      PrecedingBraceRemover,
         
     | 
| 
      
 25 
     | 
    
         
            +
                      TrailingBraceRemover,
         
     | 
| 
      
 26 
     | 
    
         
            +
                      TrailingThenRemover,
         
     | 
| 
       24 
27 
     | 
    
         
             
                      TrailingDoRemover
         
     | 
| 
       25 
28 
     | 
    
         
             
                    ].reduce(@ruby_clip) do |previous, callable|
         
     | 
| 
       26 
29 
     | 
    
         
             
                      result = callable.call(previous.code)
         
     | 
| 
         @@ -31,29 +34,7 @@ module RuboCop 
     | 
|
| 
       31 
34 
     | 
    
         
             
                    end
         
     | 
| 
       32 
35 
     | 
    
         
             
                  end
         
     | 
| 
       33 
36 
     | 
    
         | 
| 
       34 
     | 
    
         
            -
                   
     | 
| 
       35 
     | 
    
         
            -
                  class PrecedingKeywordRemover
         
     | 
| 
       36 
     | 
    
         
            -
                    REGEXP = /
         
     | 
| 
       37 
     | 
    
         
            -
                      \A
         
     | 
| 
       38 
     | 
    
         
            -
                      \s*
         
     | 
| 
       39 
     | 
    
         
            -
                      (?:
         
     | 
| 
       40 
     | 
    
         
            -
                        begin
         
     | 
| 
       41 
     | 
    
         
            -
                        | case
         
     | 
| 
       42 
     | 
    
         
            -
                        | else
         
     | 
| 
       43 
     | 
    
         
            -
                        | elsif
         
     | 
| 
       44 
     | 
    
         
            -
                        | end
         
     | 
| 
       45 
     | 
    
         
            -
                        | ensure
         
     | 
| 
       46 
     | 
    
         
            -
                        | if
         
     | 
| 
       47 
     | 
    
         
            -
                        | rescue
         
     | 
| 
       48 
     | 
    
         
            -
                        | unless
         
     | 
| 
       49 
     | 
    
         
            -
                        | until
         
     | 
| 
       50 
     | 
    
         
            -
                        | when
         
     | 
| 
       51 
     | 
    
         
            -
                        | while
         
     | 
| 
       52 
     | 
    
         
            -
                        | for[ \t]+\w+[ \t]+in
         
     | 
| 
       53 
     | 
    
         
            -
                      )
         
     | 
| 
       54 
     | 
    
         
            -
                      \b[ \t]*
         
     | 
| 
       55 
     | 
    
         
            -
                    /x.freeze
         
     | 
| 
       56 
     | 
    
         
            -
             
     | 
| 
      
 37 
     | 
    
         
            +
                  class PrecedingSourceRemover
         
     | 
| 
       57 
38 
     | 
    
         
             
                    class << self
         
     | 
| 
       58 
39 
     | 
    
         
             
                      # @param [String] code
         
     | 
| 
       59 
40 
     | 
    
         
             
                      # @return [RubyClip]
         
     | 
| 
         @@ -69,7 +50,7 @@ module RuboCop 
     | 
|
| 
       69 
50 
     | 
    
         | 
| 
       70 
51 
     | 
    
         
             
                    # @return [Hash]
         
     | 
| 
       71 
52 
     | 
    
         
             
                    def call
         
     | 
| 
       72 
     | 
    
         
            -
                      data = @code.match(REGEXP)
         
     | 
| 
      
 53 
     | 
    
         
            +
                      data = @code.match(self.class::REGEXP)
         
     | 
| 
       73 
54 
     | 
    
         
             
                      if data
         
     | 
| 
       74 
55 
     | 
    
         
             
                        offset = data[0].length
         
     | 
| 
       75 
56 
     | 
    
         
             
                        RubyClip.new(
         
     | 
| 
         @@ -85,17 +66,40 @@ module RuboCop 
     | 
|
| 
       85 
66 
     | 
    
         
             
                    end
         
     | 
| 
       86 
67 
     | 
    
         
             
                  end
         
     | 
| 
       87 
68 
     | 
    
         | 
| 
       88 
     | 
    
         
            -
                  # Remove  
     | 
| 
       89 
     | 
    
         
            -
                  class  
     | 
| 
      
 69 
     | 
    
         
            +
                  # Remove preceding keyword.
         
     | 
| 
      
 70 
     | 
    
         
            +
                  class PrecedingKeywordRemover < PrecedingSourceRemover
         
     | 
| 
       90 
71 
     | 
    
         
             
                    REGEXP = /
         
     | 
| 
       91 
     | 
    
         
            -
                       
     | 
| 
       92 
     | 
    
         
            -
                       
     | 
| 
       93 
     | 
    
         
            -
                       
     | 
| 
       94 
     | 
    
         
            -
             
     | 
| 
       95 
     | 
    
         
            -
             
     | 
| 
       96 
     | 
    
         
            -
             
     | 
| 
      
 72 
     | 
    
         
            +
                      \A
         
     | 
| 
      
 73 
     | 
    
         
            +
                      \s*
         
     | 
| 
      
 74 
     | 
    
         
            +
                      (?:
         
     | 
| 
      
 75 
     | 
    
         
            +
                        begin
         
     | 
| 
      
 76 
     | 
    
         
            +
                        | case
         
     | 
| 
      
 77 
     | 
    
         
            +
                        | else
         
     | 
| 
      
 78 
     | 
    
         
            +
                        | elsif
         
     | 
| 
      
 79 
     | 
    
         
            +
                        | end
         
     | 
| 
      
 80 
     | 
    
         
            +
                        | ensure
         
     | 
| 
      
 81 
     | 
    
         
            +
                        | if
         
     | 
| 
      
 82 
     | 
    
         
            +
                        | rescue
         
     | 
| 
      
 83 
     | 
    
         
            +
                        | unless
         
     | 
| 
      
 84 
     | 
    
         
            +
                        | until
         
     | 
| 
      
 85 
     | 
    
         
            +
                        | when
         
     | 
| 
      
 86 
     | 
    
         
            +
                        | while
         
     | 
| 
      
 87 
     | 
    
         
            +
                        | for[ \t]+\w+[ \t]+in
         
     | 
| 
      
 88 
     | 
    
         
            +
                      )
         
     | 
| 
      
 89 
     | 
    
         
            +
                      \b[ \t]*
         
     | 
| 
       97 
90 
     | 
    
         
             
                    /x.freeze
         
     | 
| 
      
 91 
     | 
    
         
            +
                  end
         
     | 
| 
       98 
92 
     | 
    
         | 
| 
      
 93 
     | 
    
         
            +
                  # Remove preceding `}`.
         
     | 
| 
      
 94 
     | 
    
         
            +
                  class PrecedingBraceRemover < PrecedingSourceRemover
         
     | 
| 
      
 95 
     | 
    
         
            +
                    REGEXP = /
         
     | 
| 
      
 96 
     | 
    
         
            +
                      \A
         
     | 
| 
      
 97 
     | 
    
         
            +
                      \s*
         
     | 
| 
      
 98 
     | 
    
         
            +
                      }
         
     | 
| 
      
 99 
     | 
    
         
            +
                    /x.freeze
         
     | 
| 
      
 100 
     | 
    
         
            +
                  end
         
     | 
| 
      
 101 
     | 
    
         
            +
             
     | 
| 
      
 102 
     | 
    
         
            +
                  class TrailingSourceRemover
         
     | 
| 
       99 
103 
     | 
    
         
             
                    class << self
         
     | 
| 
       100 
104 
     | 
    
         
             
                      # @param [String] code
         
     | 
| 
       101 
105 
     | 
    
         
             
                      # @return [RubyClip]
         
     | 
| 
         @@ -112,11 +116,44 @@ module RuboCop 
     | 
|
| 
       112 
116 
     | 
    
         
             
                    # @return [Hash]
         
     | 
| 
       113 
117 
     | 
    
         
             
                    def call
         
     | 
| 
       114 
118 
     | 
    
         
             
                      RubyClip.new(
         
     | 
| 
       115 
     | 
    
         
            -
                        code: @code.sub(REGEXP, ''),
         
     | 
| 
      
 119 
     | 
    
         
            +
                        code: @code.sub(self.class::REGEXP, ''),
         
     | 
| 
       116 
120 
     | 
    
         
             
                        offset: 0
         
     | 
| 
       117 
121 
     | 
    
         
             
                      )
         
     | 
| 
       118 
122 
     | 
    
         
             
                    end
         
     | 
| 
       119 
123 
     | 
    
         
             
                  end
         
     | 
| 
      
 124 
     | 
    
         
            +
             
     | 
| 
      
 125 
     | 
    
         
            +
                  # Remove trailing `{`.
         
     | 
| 
      
 126 
     | 
    
         
            +
                  class TrailingBraceRemover < TrailingSourceRemover
         
     | 
| 
      
 127 
     | 
    
         
            +
                    REGEXP = /
         
     | 
| 
      
 128 
     | 
    
         
            +
                      {
         
     | 
| 
      
 129 
     | 
    
         
            +
                      [ \t]*
         
     | 
| 
      
 130 
     | 
    
         
            +
                      (?:\|[^|]*\|)?
         
     | 
| 
      
 131 
     | 
    
         
            +
                      \s*
         
     | 
| 
      
 132 
     | 
    
         
            +
                      \z
         
     | 
| 
      
 133 
     | 
    
         
            +
                    /x.freeze
         
     | 
| 
      
 134 
     | 
    
         
            +
                  end
         
     | 
| 
      
 135 
     | 
    
         
            +
             
     | 
| 
      
 136 
     | 
    
         
            +
                  # Remove trailing `then`.
         
     | 
| 
      
 137 
     | 
    
         
            +
                  class TrailingThenRemover < TrailingSourceRemover
         
     | 
| 
      
 138 
     | 
    
         
            +
                    REGEXP = /
         
     | 
| 
      
 139 
     | 
    
         
            +
                      [ \t]*\b
         
     | 
| 
      
 140 
     | 
    
         
            +
                      then
         
     | 
| 
      
 141 
     | 
    
         
            +
                      \s*
         
     | 
| 
      
 142 
     | 
    
         
            +
                      \z
         
     | 
| 
      
 143 
     | 
    
         
            +
                    /x.freeze
         
     | 
| 
      
 144 
     | 
    
         
            +
                  end
         
     | 
| 
      
 145 
     | 
    
         
            +
             
     | 
| 
      
 146 
     | 
    
         
            +
                  # Remove trailing `do`.
         
     | 
| 
      
 147 
     | 
    
         
            +
                  class TrailingDoRemover < TrailingSourceRemover
         
     | 
| 
      
 148 
     | 
    
         
            +
                    REGEXP = /
         
     | 
| 
      
 149 
     | 
    
         
            +
                      [ \t]
         
     | 
| 
      
 150 
     | 
    
         
            +
                      do
         
     | 
| 
      
 151 
     | 
    
         
            +
                      [ \t]*
         
     | 
| 
      
 152 
     | 
    
         
            +
                      (?:\|[^|]*\|)?
         
     | 
| 
      
 153 
     | 
    
         
            +
                      \s*
         
     | 
| 
      
 154 
     | 
    
         
            +
                      \z
         
     | 
| 
      
 155 
     | 
    
         
            +
                    /x.freeze
         
     | 
| 
      
 156 
     | 
    
         
            +
                  end
         
     | 
| 
       120 
157 
     | 
    
         
             
                end
         
     | 
| 
       121 
158 
     | 
    
         
             
              end
         
     | 
| 
       122 
159 
     | 
    
         
             
            end
         
     | 
    
        data/lib/rubocop/erb/version.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: rubocop-erb
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.3.1
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Ryo Nakamura
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: exe
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date:  
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2024-01-11 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: better_html
         
     | 
| 
         @@ -54,6 +54,8 @@ files: 
     | 
|
| 
       54 
54 
     | 
    
         
             
            - README.md
         
     | 
| 
       55 
55 
     | 
    
         
             
            - Rakefile
         
     | 
| 
       56 
56 
     | 
    
         
             
            - config/default.yml
         
     | 
| 
      
 57 
     | 
    
         
            +
            - gemfiles/ruby_2.7.gemfile
         
     | 
| 
      
 58 
     | 
    
         
            +
            - gemfiles/ruby_2.7.gemfile.lock
         
     | 
| 
       57 
59 
     | 
    
         
             
            - lib/rubocop/erb.rb
         
     | 
| 
       58 
60 
     | 
    
         
             
            - lib/rubocop/erb/config_loader.rb
         
     | 
| 
       59 
61 
     | 
    
         
             
            - lib/rubocop/erb/keyword_remover.rb
         
     |