rfix 1.3.0.pre.199 → 1.4.0.pre.201
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/.travis.yml +0 -3
- data/Gemfile.lock +11 -4
- data/README.md +2 -2
- data/lib/rfix.rb +1 -0
- data/lib/rfix/formatter.rb +4 -2
- data/lib/rfix/indentation.rb +39 -0
- data/lib/rfix/version.rb +1 -1
- data/rfix.gemspec +2 -0
- metadata +31 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a9d00d88c31b789becaae582b5c7d6f3954ca694c643b3b8498d94bdf16c7e7d
|
4
|
+
data.tar.gz: af23b2635872fe812d20ba4995777dd03a079f8f2916d5a8c816d79c0a488637
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 501a500f81cb2a5d3740aba31426a76ba310c31beb8326f4162ed85be5c719a12e852b166ba63cfd1de913c3712e756f6347bd21bcb4cff2bab7ef75e2be50c1
|
7
|
+
data.tar.gz: fa3a37f18a7c47f47bc33f497581dc649e8ae41e248888a5de4a05959f18d030fe2803ed135c6b3f70796177dd158bb720de0123ffe8949601862ae57ba1ad86
|
data/.travis.yml
CHANGED
@@ -8,11 +8,8 @@ os:
|
|
8
8
|
- linux
|
9
9
|
gemfile:
|
10
10
|
- ci/Gemfile.rubocop-0.80
|
11
|
-
- ci/Gemfile.rubocop-0.81
|
12
11
|
- ci/Gemfile.rubocop-0.82
|
13
|
-
- ci/Gemfile.rubocop-0.83
|
14
12
|
- ci/Gemfile.rubocop-0.84
|
15
|
-
- ci/Gemfile.rubocop-0.85
|
16
13
|
- ci/Gemfile.rubocop-0.85.1
|
17
14
|
before_install:
|
18
15
|
- yes | gem update --system --force
|
data/Gemfile.lock
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
rfix (1.
|
4
|
+
rfix (1.4.0)
|
5
5
|
cri (~> 2.15.10)
|
6
|
+
dry-core (~> 0.5.0)
|
6
7
|
listen (~> 3.0)
|
7
8
|
rainbow (~> 3.0)
|
8
9
|
require_all (~> 3.0.0)
|
@@ -33,7 +34,7 @@ GEM
|
|
33
34
|
colorize (0.8.1)
|
34
35
|
concurrent-ruby (1.1.6)
|
35
36
|
contracts (0.16.0)
|
36
|
-
cri (2.15.
|
37
|
+
cri (2.15.11)
|
37
38
|
cucumber (4.0.1)
|
38
39
|
builder (~> 3.2, >= 3.2.3)
|
39
40
|
cucumber-core (~> 7.0, >= 7.0.0)
|
@@ -62,6 +63,8 @@ GEM
|
|
62
63
|
cucumber-cucumber-expressions (~> 10.1, >= 10.1.0)
|
63
64
|
cucumber-messages (~> 12.1, >= 12.1.1)
|
64
65
|
diff-lcs (1.3)
|
66
|
+
dry-core (0.5.0)
|
67
|
+
concurrent-ruby (~> 1.0)
|
65
68
|
faker (2.13.0)
|
66
69
|
i18n (>= 1.6, < 2)
|
67
70
|
ffi (1.13.1)
|
@@ -121,7 +124,7 @@ GEM
|
|
121
124
|
regexp_parser (1.7.1)
|
122
125
|
require_all (3.0.0)
|
123
126
|
rexml (3.2.4)
|
124
|
-
rouge (3.
|
127
|
+
rouge (3.26.0)
|
125
128
|
rspec (3.9.0)
|
126
129
|
rspec-core (~> 3.9.0)
|
127
130
|
rspec-expectations (~> 3.9.0)
|
@@ -131,6 +134,9 @@ GEM
|
|
131
134
|
rspec-expectations (3.9.2)
|
132
135
|
diff-lcs (>= 1.2.0, < 2.0)
|
133
136
|
rspec-support (~> 3.9.0)
|
137
|
+
rspec-its (1.3.0)
|
138
|
+
rspec-core (>= 3.0.0)
|
139
|
+
rspec-expectations (>= 3.0.0)
|
134
140
|
rspec-mocks (3.9.1)
|
135
141
|
diff-lcs (>= 1.2.0, < 2.0)
|
136
142
|
rspec-support (~> 3.9.0)
|
@@ -175,7 +181,8 @@ DEPENDENCIES
|
|
175
181
|
rake (~> 12.3)
|
176
182
|
rfix!
|
177
183
|
rspec (~> 3.0)
|
184
|
+
rspec-its (~> 1.3.0)
|
178
185
|
rubocop (~> 0.85)
|
179
186
|
|
180
187
|
BUNDLED WITH
|
181
|
-
2.
|
188
|
+
2.2.5
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# :bug:
|
1
|
+
# :bug: rfix [](https://travis-ci.org/oleander/rfix-rb) [](https://rubygems.org/gems/rfix)
|
2
2
|
|
3
3
|
RuboCop CLI that only lints and auto-fixes code you committed by utilizing `git-log` and `git-diff`. Rfix CLI makes it possible to lint (`rfix lint`) and auto-fix (`rfix local|origin|branch`) code changes since a certain point in history. You can auto-fix code committed since creating the current branch (`rfix origin`) or since pushing to upstream (`rfix local`).
|
4
4
|
|
@@ -46,8 +46,8 @@ $ rfix # Displays this list of supported commands
|
|
46
46
|
- `$ git clone https://github.com/oleander/rfix-rb`
|
47
47
|
- `$ cd rfix-rb`
|
48
48
|
2. Downloads fixtures and run time dependencies
|
49
|
-
- `$ make dir fetch`
|
50
49
|
- `$ bundle install`
|
50
|
+
- `$ rake rebuild
|
51
51
|
|
52
52
|
### Install from repository
|
53
53
|
|
data/lib/rfix.rb
CHANGED
data/lib/rfix/formatter.rb
CHANGED
@@ -113,11 +113,13 @@ module Rfix
|
|
113
113
|
def report_line(_file, offense, _location, highlighted_area)
|
114
114
|
extra = " "
|
115
115
|
src = highlighted_source_line(offense).lines.map { |line| extra + line }.join("\n")
|
116
|
+
indent = Indentation.new(src, extra_indentation: 2)
|
117
|
+
src = indent.call
|
116
118
|
lines = @formatter.format(@lexer.lex(src)).gsub('\\e', CLI::UI::ANSI::ESC).lines.map(&:chomp)
|
117
119
|
out("\n\n")
|
118
120
|
out(lines.join("\n"), format: false)
|
119
|
-
b_pos = highlighted_area.begin_pos + extra.length
|
120
|
-
e_pos = highlighted_area.end_pos + extra.length
|
121
|
+
b_pos = highlighted_area.begin_pos + extra.length * 2 - indent.min_indentation
|
122
|
+
e_pos = highlighted_area.end_pos + extra.length * 2 - indent.min_indentation
|
121
123
|
size = e_pos - b_pos
|
122
124
|
out((" " * b_pos) + Rainbow((" " * size)).underline.bold)
|
123
125
|
out("\n\n")
|
@@ -0,0 +1,39 @@
|
|
1
|
+
require "dry/core/memoizable"
|
2
|
+
|
3
|
+
module Rfix
|
4
|
+
class Indentation
|
5
|
+
include Dry::Core::Memoizable
|
6
|
+
SPACE = " ".freeze
|
7
|
+
|
8
|
+
attr_reader :extra_indentation, :input
|
9
|
+
|
10
|
+
def initialize(input, extra_indentation: 0)
|
11
|
+
@input = input
|
12
|
+
@extra_indentation = extra_indentation
|
13
|
+
end
|
14
|
+
|
15
|
+
def stripped
|
16
|
+
lines.map do |line|
|
17
|
+
line.sub(/^\s{#{min_indentation}}/, "")
|
18
|
+
end.map do |line|
|
19
|
+
[SPACE * extra_indentation, line].join
|
20
|
+
end.join
|
21
|
+
end
|
22
|
+
|
23
|
+
alias call stripped
|
24
|
+
|
25
|
+
private
|
26
|
+
|
27
|
+
def min_indentation
|
28
|
+
lines.map do |line|
|
29
|
+
line.match(/^\s*/)[0].length
|
30
|
+
end.min || 0
|
31
|
+
end
|
32
|
+
|
33
|
+
def lines
|
34
|
+
input.lines
|
35
|
+
end
|
36
|
+
|
37
|
+
memoize :min_indentation, :lines
|
38
|
+
end
|
39
|
+
end
|
data/lib/rfix/version.rb
CHANGED
data/rfix.gemspec
CHANGED
@@ -52,6 +52,7 @@ Gem::Specification.new do |spec|
|
|
52
52
|
spec.requirements << "git, v2.0+"
|
53
53
|
|
54
54
|
spec.add_runtime_dependency "cri", "~> 2.15.10"
|
55
|
+
spec.add_runtime_dependency "dry-core", "~> 0.5.0"
|
55
56
|
spec.add_runtime_dependency "listen", "~> 3.0"
|
56
57
|
spec.add_runtime_dependency "rainbow", "~> 3.0"
|
57
58
|
spec.add_runtime_dependency "require_all", "~> 3.0.0"
|
@@ -60,6 +61,7 @@ Gem::Specification.new do |spec|
|
|
60
61
|
spec.add_runtime_dependency "rugged", "~> 1.0.0"
|
61
62
|
|
62
63
|
spec.add_development_dependency "rspec", "~> 3.0"
|
64
|
+
spec.add_development_dependency "rspec-its", "~> 1.3.0"
|
63
65
|
spec.add_development_dependency "aruba", "~> 1.0"
|
64
66
|
spec.add_development_dependency "colorize", "~> 0.8.1"
|
65
67
|
spec.add_development_dependency "git", "~> 1.7.0"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rfix
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.0.pre.201
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Linus Oleander
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-02-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cri
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 2.15.10
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: dry-core
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 0.5.0
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 0.5.0
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: listen
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -128,6 +142,20 @@ dependencies:
|
|
128
142
|
- - "~>"
|
129
143
|
- !ruby/object:Gem::Version
|
130
144
|
version: '3.0'
|
145
|
+
- !ruby/object:Gem::Dependency
|
146
|
+
name: rspec-its
|
147
|
+
requirement: !ruby/object:Gem::Requirement
|
148
|
+
requirements:
|
149
|
+
- - "~>"
|
150
|
+
- !ruby/object:Gem::Version
|
151
|
+
version: 1.3.0
|
152
|
+
type: :development
|
153
|
+
prerelease: false
|
154
|
+
version_requirements: !ruby/object:Gem::Requirement
|
155
|
+
requirements:
|
156
|
+
- - "~>"
|
157
|
+
- !ruby/object:Gem::Version
|
158
|
+
version: 1.3.0
|
131
159
|
- !ruby/object:Gem::Dependency
|
132
160
|
name: aruba
|
133
161
|
requirement: !ruby/object:Gem::Requirement
|
@@ -281,6 +309,7 @@ files:
|
|
281
309
|
- lib/rfix/file_cache.rb
|
282
310
|
- lib/rfix/formatter.rb
|
283
311
|
- lib/rfix/git_helper.rb
|
312
|
+
- lib/rfix/indentation.rb
|
284
313
|
- lib/rfix/loader/bundler.rb
|
285
314
|
- lib/rfix/loader/env.rb
|
286
315
|
- lib/rfix/loader/spec.rb
|