rfix 1.0.7 → 1.0.8.pre.108
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/.gitignore +20 -0
- data/.rubocop.yml +4 -0
- data/.travis.yml +8 -6
- data/Gemfile +2 -16
- data/Gemfile.base +7 -0
- data/Gemfile.lock +14 -44
- data/Makefile +13 -0
- data/README.md +66 -13
- data/Rakefile +56 -46
- data/bin/bundle +114 -0
- data/bin/console +23 -9
- data/bin/guard +29 -0
- data/bin/rake +29 -0
- data/bin/rfix +29 -0
- data/bin/rspec +29 -0
- data/bin/setup +27 -6
- data/ci/Gemfile.rubocop-0.80 +1 -1
- data/ci/Gemfile.rubocop-0.80.lock +15 -46
- data/ci/Gemfile.rubocop-0.81 +1 -1
- data/ci/Gemfile.rubocop-0.81.lock +15 -46
- data/ci/Gemfile.rubocop-0.82 +2 -2
- data/ci/Gemfile.rubocop-0.82.lock +16 -47
- data/ci/Gemfile.rubocop-0.83 +1 -1
- data/ci/Gemfile.rubocop-0.83.lock +15 -46
- data/ci/Gemfile.rubocop-0.84 +1 -1
- data/ci/Gemfile.rubocop-0.84.lock +15 -46
- data/ci/Gemfile.rubocop-0.85 +1 -1
- data/ci/Gemfile.rubocop-0.85.1 +1 -1
- data/ci/Gemfile.rubocop-0.85.1.lock +15 -46
- data/ci/Gemfile.rubocop-0.85.lock +15 -46
- data/exe/rfix +29 -41
- data/lib/rfix.rb +15 -2
- data/lib/rfix/cmd.rb +5 -1
- data/lib/rfix/extensions/extensions.rb +40 -0
- data/lib/rfix/extensions/offense.rb +77 -0
- data/lib/rfix/formatter.rb +1 -24
- data/lib/rfix/gem_helper.rb +12 -0
- data/lib/rfix/git_helper.rb +3 -1
- data/lib/rfix/log.rb +2 -2
- data/lib/rfix/rake_helper.rb +56 -0
- data/lib/rfix/rfix.rb +87 -4
- data/lib/rfix/version.rb +1 -1
- data/resources/ps.png +0 -0
- data/rfix.gemspec +19 -12
- metadata +100 -47
- data/lib/rfix/extensions.rb +0 -92
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.0.
|
4
|
+
version: 1.0.8.pre.108
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Linus Oleander
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-06-
|
11
|
+
date: 2020-06-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rainbow
|
@@ -42,24 +42,64 @@ dependencies:
|
|
42
42
|
name: rubocop
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0.80'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0.80'
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rspec
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '3.0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '3.0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: aruba
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '1.0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '1.0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rake
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '12.3'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '12.3'
|
97
|
+
description: |
|
98
|
+
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`).
|
99
|
+
|
100
|
+
Includes a RuboCop formatter with syntax highlighting and build in hyperlinks for offense documentation.
|
101
|
+
|
102
|
+
Holds the same CLI arguments as RuboCop. Run `rfix --help` for a complete list or `rfix` for supported commands.
|
63
103
|
email:
|
64
104
|
- linus@oleander.nu
|
65
105
|
executables:
|
@@ -72,12 +112,19 @@ files:
|
|
72
112
|
- ".rubocop.yml"
|
73
113
|
- ".travis.yml"
|
74
114
|
- Gemfile
|
115
|
+
- Gemfile.base
|
75
116
|
- Gemfile.lock
|
76
117
|
- Guardfile
|
77
118
|
- LICENSE.txt
|
119
|
+
- Makefile
|
78
120
|
- README.md
|
79
121
|
- Rakefile
|
122
|
+
- bin/bundle
|
80
123
|
- bin/console
|
124
|
+
- bin/guard
|
125
|
+
- bin/rake
|
126
|
+
- bin/rfix
|
127
|
+
- bin/rspec
|
81
128
|
- bin/setup
|
82
129
|
- ci/Gemfile.rubocop-0.80
|
83
130
|
- ci/Gemfile.rubocop-0.80.lock
|
@@ -96,51 +143,55 @@ files:
|
|
96
143
|
- exe/rfix
|
97
144
|
- lib/rfix.rb
|
98
145
|
- lib/rfix/cmd.rb
|
99
|
-
- lib/rfix/extensions.rb
|
146
|
+
- lib/rfix/extensions/extensions.rb
|
147
|
+
- lib/rfix/extensions/offense.rb
|
100
148
|
- lib/rfix/formatter.rb
|
149
|
+
- lib/rfix/gem_helper.rb
|
101
150
|
- lib/rfix/git_file.rb
|
102
151
|
- lib/rfix/git_helper.rb
|
103
152
|
- lib/rfix/log.rb
|
153
|
+
- lib/rfix/rake_helper.rb
|
104
154
|
- lib/rfix/rfix.rb
|
105
155
|
- lib/rfix/tracked_file.rb
|
106
156
|
- lib/rfix/untracked_file.rb
|
107
157
|
- lib/rfix/version.rb
|
158
|
+
- resources/ps.png
|
108
159
|
- rfix.gemspec
|
109
|
-
- vendor/cli-ui/lib/cli/ui.rb
|
110
|
-
- vendor/cli-ui/lib/cli/ui/ansi.rb
|
111
|
-
- vendor/cli-ui/lib/cli/ui/color.rb
|
112
|
-
- vendor/cli-ui/lib/cli/ui/formatter.rb
|
113
|
-
- vendor/cli-ui/lib/cli/ui/frame.rb
|
114
|
-
- vendor/cli-ui/lib/cli/ui/frame/frame_stack.rb
|
115
|
-
- vendor/cli-ui/lib/cli/ui/frame/frame_style.rb
|
116
|
-
- vendor/cli-ui/lib/cli/ui/frame/frame_style/box.rb
|
117
|
-
- vendor/cli-ui/lib/cli/ui/frame/frame_style/bracket.rb
|
118
|
-
- vendor/cli-ui/lib/cli/ui/glyph.rb
|
119
|
-
- vendor/cli-ui/lib/cli/ui/printer.rb
|
120
|
-
- vendor/cli-ui/lib/cli/ui/progress.rb
|
121
|
-
- vendor/cli-ui/lib/cli/ui/prompt.rb
|
122
|
-
- vendor/cli-ui/lib/cli/ui/prompt/interactive_options.rb
|
123
|
-
- vendor/cli-ui/lib/cli/ui/prompt/options_handler.rb
|
124
|
-
- vendor/cli-ui/lib/cli/ui/spinner.rb
|
125
|
-
- vendor/cli-ui/lib/cli/ui/spinner/async.rb
|
126
|
-
- vendor/cli-ui/lib/cli/ui/spinner/spin_group.rb
|
127
|
-
- vendor/cli-ui/lib/cli/ui/stdout_router.rb
|
128
|
-
- vendor/cli-ui/lib/cli/ui/terminal.rb
|
129
|
-
- vendor/cli-ui/lib/cli/ui/truncater.rb
|
130
|
-
- vendor/cli-ui/lib/cli/ui/version.rb
|
131
|
-
- vendor/cli-ui/lib/cli/ui/widgets.rb
|
132
|
-
- vendor/cli-ui/lib/cli/ui/widgets/base.rb
|
133
|
-
- vendor/cli-ui/lib/cli/ui/widgets/status.rb
|
160
|
+
- vendor/shopify/cli-ui/lib/cli/ui.rb
|
161
|
+
- vendor/shopify/cli-ui/lib/cli/ui/ansi.rb
|
162
|
+
- vendor/shopify/cli-ui/lib/cli/ui/color.rb
|
163
|
+
- vendor/shopify/cli-ui/lib/cli/ui/formatter.rb
|
164
|
+
- vendor/shopify/cli-ui/lib/cli/ui/frame.rb
|
165
|
+
- vendor/shopify/cli-ui/lib/cli/ui/frame/frame_stack.rb
|
166
|
+
- vendor/shopify/cli-ui/lib/cli/ui/frame/frame_style.rb
|
167
|
+
- vendor/shopify/cli-ui/lib/cli/ui/frame/frame_style/box.rb
|
168
|
+
- vendor/shopify/cli-ui/lib/cli/ui/frame/frame_style/bracket.rb
|
169
|
+
- vendor/shopify/cli-ui/lib/cli/ui/glyph.rb
|
170
|
+
- vendor/shopify/cli-ui/lib/cli/ui/printer.rb
|
171
|
+
- vendor/shopify/cli-ui/lib/cli/ui/progress.rb
|
172
|
+
- vendor/shopify/cli-ui/lib/cli/ui/prompt.rb
|
173
|
+
- vendor/shopify/cli-ui/lib/cli/ui/prompt/interactive_options.rb
|
174
|
+
- vendor/shopify/cli-ui/lib/cli/ui/prompt/options_handler.rb
|
175
|
+
- vendor/shopify/cli-ui/lib/cli/ui/spinner.rb
|
176
|
+
- vendor/shopify/cli-ui/lib/cli/ui/spinner/async.rb
|
177
|
+
- vendor/shopify/cli-ui/lib/cli/ui/spinner/spin_group.rb
|
178
|
+
- vendor/shopify/cli-ui/lib/cli/ui/stdout_router.rb
|
179
|
+
- vendor/shopify/cli-ui/lib/cli/ui/terminal.rb
|
180
|
+
- vendor/shopify/cli-ui/lib/cli/ui/truncater.rb
|
181
|
+
- vendor/shopify/cli-ui/lib/cli/ui/version.rb
|
182
|
+
- vendor/shopify/cli-ui/lib/cli/ui/widgets.rb
|
183
|
+
- vendor/shopify/cli-ui/lib/cli/ui/widgets/base.rb
|
184
|
+
- vendor/shopify/cli-ui/lib/cli/ui/widgets/status.rb
|
134
185
|
homepage: https://github.com/oleander/rfix-rb
|
135
186
|
licenses:
|
136
187
|
- MIT
|
137
188
|
metadata:
|
138
189
|
homepage_uri: https://github.com/oleander/rfix-rb
|
139
|
-
post_install_message:
|
190
|
+
post_install_message:
|
140
191
|
rdoc_options: []
|
141
192
|
require_paths:
|
142
193
|
- lib
|
143
|
-
- vendor/cli-ui/lib
|
194
|
+
- vendor/shopify/cli-ui/lib
|
144
195
|
required_ruby_version: !ruby/object:Gem::Requirement
|
145
196
|
requirements:
|
146
197
|
- - ">="
|
@@ -148,12 +199,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
148
199
|
version: 2.5.0
|
149
200
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
150
201
|
requirements:
|
151
|
-
- - "
|
202
|
+
- - ">"
|
152
203
|
- !ruby/object:Gem::Version
|
153
|
-
version:
|
154
|
-
requirements:
|
155
|
-
|
156
|
-
|
204
|
+
version: 1.3.1
|
205
|
+
requirements:
|
206
|
+
- git, v2.0+
|
207
|
+
rubygems_version: 3.0.3
|
208
|
+
signing_key:
|
157
209
|
specification_version: 4
|
158
|
-
summary: RuboCop CLI that only
|
210
|
+
summary: RuboCop CLI that only lints and auto-fixes code you committed by utilizing
|
211
|
+
`git-log` and `git-diff`
|
159
212
|
test_files: []
|
data/lib/rfix/extensions.rb
DELETED
@@ -1,92 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "rubocop"
|
4
|
-
require "rainbow"
|
5
|
-
|
6
|
-
module Rfix::Ext
|
7
|
-
module CommentConfig
|
8
|
-
# Called by RuboCop on every line to see
|
9
|
-
# if its suppose to run against it or not
|
10
|
-
def cop_enabled_at_line?(_cop, line)
|
11
|
-
Rfix.enabled?(processed_source.file_path, line) && super
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
module Runner
|
16
|
-
# Called _after_ @source has been 'auto fixed' by Rubocop
|
17
|
-
def check_for_infinite_loop(source, offences)
|
18
|
-
Rfix.refresh!(source); super # TODO: Before or after?
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
module Options
|
23
|
-
# Appends custom --args to RuboCop CLI
|
24
|
-
def define_options
|
25
|
-
super.tap do |options|
|
26
|
-
@ons.each do |args, block|
|
27
|
-
option(options, *args, &block)
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
# Helper method used by rfix to append cli --args to Rubocop
|
33
|
-
def on(*args, &block)
|
34
|
-
@ons ||= []
|
35
|
-
@ons += [[args, block]]
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
39
|
-
module Offense
|
40
|
-
def where
|
41
|
-
line.to_s + ":" + real_column.to_s
|
42
|
-
end
|
43
|
-
|
44
|
-
def info
|
45
|
-
message.split(": ", 2).last.delete("\n")
|
46
|
-
end
|
47
|
-
|
48
|
-
def msg
|
49
|
-
CLI::UI.resolve_text("{{italic:#{info}}}", truncate_to: CLI::UI::Terminal.width - 10)
|
50
|
-
end
|
51
|
-
|
52
|
-
def code
|
53
|
-
message.split(": ", 2).first
|
54
|
-
end
|
55
|
-
|
56
|
-
def star
|
57
|
-
Rainbow("⭑")
|
58
|
-
end
|
59
|
-
|
60
|
-
def cross
|
61
|
-
Rainbow("✗")
|
62
|
-
end
|
63
|
-
|
64
|
-
def check
|
65
|
-
Rainbow("✓")
|
66
|
-
end
|
67
|
-
|
68
|
-
def level
|
69
|
-
colors = {
|
70
|
-
refactor: star.lightcyan,
|
71
|
-
convention: star.lightblue,
|
72
|
-
warning: star.lightyellow,
|
73
|
-
error: cross.indianred,
|
74
|
-
fatal: cross.lightsalmon
|
75
|
-
}
|
76
|
-
|
77
|
-
colors[severity.name]
|
78
|
-
end
|
79
|
-
|
80
|
-
def icon
|
81
|
-
return check.green if corrected?
|
82
|
-
return check.lightgreen if correctable?
|
83
|
-
|
84
|
-
cross.indianred
|
85
|
-
end
|
86
|
-
end
|
87
|
-
end
|
88
|
-
|
89
|
-
RuboCop::Options.prepend(Rfix::Ext::Options)
|
90
|
-
RuboCop::Runner.prepend(Rfix::Ext::Runner)
|
91
|
-
RuboCop::CommentConfig.prepend(Rfix::Ext::CommentConfig)
|
92
|
-
RuboCop::Cop::Offense.prepend(Rfix::Ext::Offense)
|