rfix 1.0.8.pre.109 → 1.0.15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -0
- data/Gemfile.lock +1 -1
- data/Rakefile +3 -0
- data/exe/rfix +8 -7
- data/lib/rfix/cmd.rb +2 -2
- data/lib/rfix/log.rb +1 -1
- data/lib/rfix/rfix.rb +18 -14
- data/lib/rfix/tracked_file.rb +1 -1
- data/lib/rfix/version.rb +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f66d49622b2d3173a8f76e81202218924859cfd4ca216887b9ff505bedf7d012
|
4
|
+
data.tar.gz: 33f02bc18c137a7d6bd943de07d7947bb5c275cb99635743072daf30de66f1e8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ed91cea00b13371dd5faf6fbbd671409fda7886e21ba3e56fdabe9e923bcdbcebcbe2e4231d9be09f2508c701baf93c33e2597faa9afbfd7d9ee7cda78488597
|
7
|
+
data.tar.gz: 0b723a5d0011bf4d0f3df50723baea13a562e1c1088a0092fb90ac962fc139b7cfd97749e402b6dcd977ca53bb4fe683b6046024f1a0af415aa99bf8a8246bcc
|
data/.travis.yml
CHANGED
data/Gemfile.lock
CHANGED
data/Rakefile
CHANGED
data/exe/rfix
CHANGED
@@ -24,10 +24,6 @@ if ARGV.include?("--debug")
|
|
24
24
|
Rfix.debug!
|
25
25
|
end
|
26
26
|
|
27
|
-
say "Using RuboCop {{yellow:#{RuboCop::Version.version}}}"
|
28
|
-
say_debug "Current directory {{italic:#{Dir.pwd}}}"
|
29
|
-
say_debug "[Ruby] {{italic:#{RbConfig.ruby}}}"
|
30
|
-
|
31
27
|
options.on("--untracked", "Include untracked files") do
|
32
28
|
Rfix.load_untracked!
|
33
29
|
end
|
@@ -55,12 +51,15 @@ end
|
|
55
51
|
|
56
52
|
case cmd = ARGV.shift
|
57
53
|
when "info"
|
54
|
+
say "Using RuboCop {{yellow:#{RuboCop::Version.version}}}"
|
55
|
+
say_debug "Current directory {{italic:#{Dir.pwd}}}"
|
56
|
+
say_debug "[Ruby] {{italic:#{RbConfig.ruby}}}"
|
58
57
|
say "Using Rfix {{yellow:#{Rfix::VERSION}}}"
|
59
58
|
say "Using OS {{yellow:#{Rfix.current_os}}}"
|
60
59
|
say "Using Git {{yellow:#{Rfix.git_version}}}"
|
61
60
|
say "Using Ruby {{yellow:#{Rfix.ruby_version}}}"
|
62
|
-
|
63
|
-
|
61
|
+
say_debug "Current Git branch {{yellow:#{Rfix.current_branch}}}"
|
62
|
+
say_debug "Number of commits {{yellow:#{Rfix.number_of_commits_since}}}"
|
64
63
|
exit 0
|
65
64
|
when "lint"
|
66
65
|
Rfix.lint_mode!
|
@@ -69,6 +68,8 @@ when "local"
|
|
69
68
|
reference = Rfix.ref_since_push
|
70
69
|
when "origin"
|
71
70
|
reference = Rfix.ref_since_origin
|
71
|
+
when "welcome"
|
72
|
+
abort Rfix.thanks
|
72
73
|
when "all"
|
73
74
|
reference = false
|
74
75
|
Rfix.global_enable!
|
@@ -88,7 +89,7 @@ when "branch"
|
|
88
89
|
else
|
89
90
|
unless display_help
|
90
91
|
say_error "Valid rfix commands are:"
|
91
|
-
|
92
|
+
say_error_sub Rfix.help
|
92
93
|
exit 1
|
93
94
|
end
|
94
95
|
|
data/lib/rfix/cmd.rb
CHANGED
@@ -9,8 +9,8 @@ module Rfix::Cmd
|
|
9
9
|
|
10
10
|
def cmd(*args, quiet: false)
|
11
11
|
out, err, status = Open3.capture3(*args)
|
12
|
-
|
13
|
-
|
12
|
+
say_debug "[Cmd] {{command:#{args.join(' ')}}}"
|
13
|
+
|
14
14
|
unless status.success?
|
15
15
|
return yield if block_given?
|
16
16
|
return if quiet
|
data/lib/rfix/log.rb
CHANGED
data/lib/rfix/rfix.rb
CHANGED
@@ -15,16 +15,19 @@ module Rfix
|
|
15
15
|
include GitHelper
|
16
16
|
include Log
|
17
17
|
|
18
|
+
def indent
|
19
|
+
" " * 2
|
20
|
+
end
|
21
|
+
|
18
22
|
def thanks
|
19
23
|
tx = []
|
20
24
|
tx << "\n{{v}} Thank you for installing {{green:rfix v#{Rfix::VERSION}}}!\n"
|
21
25
|
tx << "{{i}} Run {{command:rfix}} for avalible commands or any of the following to get started:"
|
22
26
|
tx << ""
|
23
27
|
# tx << "Here are a few examples that might be useful:"
|
24
|
-
|
25
|
-
tx << "#{indent}{{command
|
26
|
-
tx << "#{indent}{{command
|
27
|
-
tx << "#{indent}{{command:rfix lint}} {{italic:# Lints commits and untracked files not yet pushed to upstream}}"
|
28
|
+
tx << "#{indent}{{command:$ rfix local}} {{italic:# Auto-fixes commits not yet pushed to upstream}}"
|
29
|
+
tx << "#{indent}{{command:$ rfix origin}} {{italic:# Auto-fixes commits between HEAD and origin branch}}"
|
30
|
+
tx << "#{indent}{{command:$ rfix lint}} {{italic:# Lints commits and untracked files not yet pushed to upstream}}"
|
28
31
|
tx << ""
|
29
32
|
tx << "{{*}} {{bold:ProTip:}} Append {{command:--dry}} to run {{command:rfix}} in read-only mode"
|
30
33
|
tx << ""
|
@@ -37,14 +40,14 @@ module Rfix
|
|
37
40
|
end
|
38
41
|
|
39
42
|
def help
|
40
|
-
cmds = []
|
41
|
-
cmds << "
|
42
|
-
cmds << "
|
43
|
-
cmds << "
|
44
|
-
cmds << "
|
45
|
-
cmds << "
|
46
|
-
cmds << "
|
47
|
-
cmds << "
|
43
|
+
cmds = [""]
|
44
|
+
cmds << "#{indent}{{command:$ rfix [cmd] [options]}} # {{italic:--dry --help --list-files --limit-files --config --untracked}}"
|
45
|
+
cmds << "#{indent}{{command:$ rfix branch <branch>}} # {{italic:Fix changes made between HEAD and <branch>}}"
|
46
|
+
cmds << "#{indent}{{command:$ rfix origin}} # {{italic:Fix changes made between HEAD and origin branch}}"
|
47
|
+
cmds << "#{indent}{{command:$ rfix local}} # {{italic:Fix changes not yet pushed to upstream branch}}"
|
48
|
+
cmds << "#{indent}{{command:$ rfix info}} # {{italic:Display runtime dependencies and their versions}}"
|
49
|
+
cmds << "#{indent}{{command:$ rfix all}} # {{italic:Fix all files in this repository}} {{warning:(not recommended)}}"
|
50
|
+
cmds << "#{indent}{{command:$ rfix lint}} # {{italic:Shortcut for 'local --dry --untracked'}}"
|
48
51
|
CLI::UI.fmt(cmds.join("\n"), enable_color: true)
|
49
52
|
end
|
50
53
|
|
@@ -58,6 +61,7 @@ module Rfix
|
|
58
61
|
|
59
62
|
def debug!
|
60
63
|
@debug = true
|
64
|
+
@config[:debug] = true
|
61
65
|
end
|
62
66
|
|
63
67
|
def number_of_commits_since
|
@@ -122,13 +126,13 @@ module Rfix
|
|
122
126
|
def init!
|
123
127
|
@files ||= {}
|
124
128
|
@global_enable = false
|
129
|
+
@debug = false
|
125
130
|
@config = {
|
126
131
|
force_exclusion: true,
|
127
132
|
formatters: ["Rfix::Formatter"]
|
128
133
|
}
|
129
134
|
|
130
135
|
@store = RuboCop::ConfigStore.new
|
131
|
-
@debug = false
|
132
136
|
auto_correct!
|
133
137
|
end
|
134
138
|
|
@@ -171,7 +175,7 @@ module Rfix
|
|
171
175
|
end
|
172
176
|
|
173
177
|
def load_tracked!(reference)
|
174
|
-
cached(git("log", "--name-only", "--pretty=format:", *params, "#{reference}
|
178
|
+
cached(git("log", "--name-only", "--pretty=format:", *params, "#{reference}...HEAD").map do |path|
|
175
179
|
TrackedFile.new(path, reference, root_dir)
|
176
180
|
end.select(&:file?).to_set)
|
177
181
|
end
|
data/lib/rfix/tracked_file.rb
CHANGED
@@ -4,7 +4,7 @@ require "rfix/git_file"
|
|
4
4
|
|
5
5
|
class Rfix::TrackedFile < Rfix::GitFile
|
6
6
|
def refresh!
|
7
|
-
@ranges = git("--no-pager", "diff", *params, ref, path)
|
7
|
+
@ranges = git("--no-pager", "diff", *params, "#{ref}...HEAD", path)
|
8
8
|
.grep(/^@@ -\d+(?:,\d+)? \+(\d+)(?:,(\d+))? @@/) do
|
9
9
|
Regexp.last_match(1).to_i...(Regexp.last_match(1).to_i + (Regexp.last_match(2) || 1).to_i)
|
10
10
|
end
|
data/lib/rfix/version.rb
CHANGED
metadata
CHANGED
@@ -1,11 +1,11 @@
|
|
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.15
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Linus Oleander
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
11
|
date: 2020-06-21 00:00:00.000000000 Z
|
@@ -188,7 +188,7 @@ licenses:
|
|
188
188
|
- MIT
|
189
189
|
metadata:
|
190
190
|
homepage_uri: https://github.com/oleander/rfix-rb
|
191
|
-
post_install_message:
|
191
|
+
post_install_message:
|
192
192
|
rdoc_options: []
|
193
193
|
require_paths:
|
194
194
|
- lib
|
@@ -200,13 +200,13 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
200
200
|
version: 2.5.0
|
201
201
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
202
202
|
requirements:
|
203
|
-
- - "
|
203
|
+
- - ">="
|
204
204
|
- !ruby/object:Gem::Version
|
205
|
-
version:
|
205
|
+
version: '0'
|
206
206
|
requirements:
|
207
207
|
- git, v2.0+
|
208
|
-
rubygems_version: 3.
|
209
|
-
signing_key:
|
208
|
+
rubygems_version: 3.1.4
|
209
|
+
signing_key:
|
210
210
|
specification_version: 4
|
211
211
|
summary: RuboCop CLI that only lints and auto-fixes code you committed by utilizing
|
212
212
|
`git-log` and `git-diff`
|