slimcop 0.13.0 → 0.16.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 583b9f7c6ea2e90edb94a7ed4c84762881cac6937374dc747f55db4c4e6c3e58
4
- data.tar.gz: fc8d197b9b6b469281a99d49b62a57cf6674895376d3f549ceb4fbb82bb24260
3
+ metadata.gz: 3e16754c31e6d11c791a29a4de0901992917071dfb277f0535f11eb18673a5e5
4
+ data.tar.gz: 65f520d3498b9ba4aff643e3c858783ab8040009e74a02306e7cdeceea877d5a
5
5
  SHA512:
6
- metadata.gz: 564ce43ebcf8fcd8d18a0834f98cc23a779de0bb1db57eb332a3694486ffd4ec567066a2b8e544c3ed2b3c42357ef27346fa19beff58f45b4bd5fcb0d902abf6
7
- data.tar.gz: 33db301ef4145581fcff267e9def94f7ef3e6bd6f34e75f4e31e82605e9c58479b360429ef313db582fedda09f3b06121a4095f5b7d1c6ab139669bba25abc5b
6
+ metadata.gz: e7e1045da7fe86267a1c7f92a68533da838d4a5c9b00683f5e230b0e5958f803114a80f61fcddee0fa324f63d17fb0a61d224e6cfc2b8c2c6a34615433668594
7
+ data.tar.gz: c05b54d13cf8b220f32101c3f12371f3792ca5f5abef79273ca428f6ec7dde516159829610bc995156824e4ffafb5cd8d43d3ba6a464337f455fa2cef6c4e315
data/CHANGELOG.md CHANGED
@@ -2,6 +2,35 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 0.16.0 - 2022-01-25
6
+
7
+ ### Chnaged
8
+
9
+ - Disable Layout/FirstArrayElementLineBreak by default.
10
+ - Disable Layout/FirstHashElementLineBreak by default.
11
+ - Disable Layout/FirstMethodArgumentLineBreak by default.
12
+ - Disable Style/TrailingCommaInArrayLiteral by default.
13
+ - Disable Style/TrailingCommaInArguments by default.
14
+ - Disable Style/TrailingCommaInHashLiteral by default.
15
+
16
+ ## 0.15.0 - 2022-01-22
17
+
18
+ ### Changed
19
+
20
+ - Disable Style/NestedTernaryOperator by default.
21
+
22
+ ## 0.14.0 - 2022-01-22
23
+
24
+ ### Changed
25
+
26
+ - Disable Style/MultilineTernaryOperator by default.
27
+
28
+ ## 0.13.1 - 2022-01-18
29
+
30
+ ### Fixed
31
+
32
+ - Fix missing some metadata in gemspec.
33
+
5
34
  ## 0.13.0 - 2022-01-15
6
35
 
7
36
  ### Changed
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- slimcop (0.13.0)
4
+ slimcop (0.16.0)
5
5
  slimi (>= 0.5.1)
6
6
  templatecop
7
7
 
@@ -44,11 +44,12 @@ GEM
44
44
  rubocop-rspec (2.6.0)
45
45
  rubocop (~> 1.19)
46
46
  ruby-progressbar (1.11.0)
47
- slimi (0.7.0)
47
+ slimi (0.7.2)
48
48
  temple
49
49
  thor
50
50
  tilt
51
- templatecop (0.1.0)
51
+ templatecop (0.2.2)
52
+ parallel
52
53
  parser
53
54
  rubocop (>= 0.87)
54
55
  temple (0.8.2)
data/default.yml CHANGED
@@ -25,9 +25,18 @@ Layout/FirstArgumentIndentation:
25
25
  Layout/FirstArrayElementIndentation:
26
26
  Enabled: false
27
27
 
28
+ Layout/FirstArrayElementLineBreak:
29
+ Enabled: false
30
+
28
31
  Layout/FirstHashElementIndentation:
29
32
  Enabled: false
30
33
 
34
+ Layout/FirstHashElementLineBreak:
35
+ Enabled: false
36
+
37
+ Layout/FirstMethodArgumentLineBreak:
38
+ Enabled: false
39
+
31
40
  Layout/FirstParameterIndentation:
32
41
  Enabled: false
33
42
 
@@ -103,12 +112,27 @@ Style/IdenticalConditionalBranches:
103
112
  Style/IfUnlessModifier:
104
113
  Enabled: false
105
114
 
115
+ Style/MultilineTernaryOperator:
116
+ Enabled: false
117
+
118
+ Style/NestedTernaryOperator:
119
+ Enabled: false
120
+
106
121
  Style/Next:
107
122
  Enabled: false
108
123
 
109
124
  Style/RescueModifier:
110
125
  Enabled: false
111
126
 
127
+ Style/TrailingCommaInArguments:
128
+ Enabled: false
129
+
130
+ Style/TrailingCommaInArrayLiteral:
131
+ Enabled: false
132
+
133
+ Style/TrailingCommaInHashLiteral:
134
+ Enabled: false
135
+
112
136
  Style/WhileUntilDo:
113
137
  Enabled: false
114
138
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Slimcop
4
- VERSION = '0.13.0'
4
+ VERSION = '0.16.0'
5
5
  end
data/slimcop.gemspec CHANGED
@@ -16,6 +16,7 @@ Gem::Specification.new do |spec|
16
16
  spec.metadata['homepage_uri'] = spec.homepage
17
17
  spec.metadata['source_code_uri'] = spec.homepage
18
18
  spec.metadata['changelog_uri'] = "#{spec.homepage}/blob/main/CHANGELOG.md"
19
+ spec.metadata['rubygems_mfa_required'] = 'true'
19
20
 
20
21
  # Specify which files should be added to the gem when it is released.
21
22
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
@@ -27,9 +28,6 @@ Gem::Specification.new do |spec|
27
28
  spec.bindir = 'exe'
28
29
  spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
29
30
  spec.require_paths = ['lib']
30
- spec.metadata = {
31
- 'rubygems_mfa_required' => 'true'
32
- }
33
31
 
34
32
  spec.add_dependency 'slimi', '>= 0.5.1'
35
33
  spec.add_dependency 'templatecop'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slimcop
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.0
4
+ version: 0.16.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryo Nakamura
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-01-15 00:00:00.000000000 Z
11
+ date: 2022-01-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: slimi
@@ -61,13 +61,15 @@ files:
61
61
  - exe/slimcop
62
62
  - lib/slimcop.rb
63
63
  - lib/slimcop/ruby_extractor.rb
64
- - lib/slimcop/slim_corrector.rb
65
64
  - lib/slimcop/version.rb
66
65
  - slimcop.gemspec
67
66
  homepage: https://github.com/r7kamura/slimcop
68
67
  licenses:
69
68
  - MIT
70
69
  metadata:
70
+ homepage_uri: https://github.com/r7kamura/slimcop
71
+ source_code_uri: https://github.com/r7kamura/slimcop
72
+ changelog_uri: https://github.com/r7kamura/slimcop/blob/main/CHANGELOG.md
71
73
  rubygems_mfa_required: 'true'
72
74
  post_install_message:
73
75
  rdoc_options: []
@@ -1,42 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'parser'
4
- require 'rubocop/cop/legacy/corrector'
5
-
6
- module Slimcop
7
- # Apply auto-corrections to Slim file.
8
- class SlimCorrector
9
- # @param [String] file_path
10
- # @param [Array<Slimcop::Offense>] offenses
11
- # @param [String] source
12
- def initialize(file_path:, offenses:, source:)
13
- @file_path = file_path
14
- @offenses = offenses
15
- @source = source
16
- end
17
-
18
- # @return [String] Rewritten Slim code.
19
- def call
20
- ::RuboCop::Cop::Legacy::Corrector.new(source_buffer, corrections).rewrite
21
- end
22
-
23
- private
24
-
25
- # @return [Array<Proc>]
26
- def corrections
27
- @offenses.select(&:corrector).map do |offense|
28
- lambda do |corrector|
29
- corrector.import!(offense.corrector, offset: offense.offset)
30
- end
31
- end
32
- end
33
-
34
- # @return [Parser::Source::Buffer]
35
- def source_buffer
36
- ::Parser::Source::Buffer.new(
37
- @file_path,
38
- source: @source
39
- )
40
- end
41
- end
42
- end