rubocopfmt 0.1.0.beta5 → 0.1.0.beta6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rubocopfmt/auto_corrector.rb +26 -37
- data/lib/rubocopfmt/diff.rb +1 -3
- data/lib/rubocopfmt/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7416aa6f1bb92c2310a5bf78538f2b2b2f174527
|
4
|
+
data.tar.gz: 76f35e8e1e202652ff0261fc27c25c3b3b110eb4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 416b970fe9e5c57460750db621f13047387acd43d5666fa45210321ae7888382aeb71bda2d783c9d23acfb67f7b320613a83897e9037b9a5197f48bd14c43cc5
|
7
|
+
data.tar.gz: c3dd70a67e708707bc458abbafc9efdf51fc5f2e07edf0a85b5a93528acf1c4009d9e432b4f0f8ae81a14245769a05aac0841d0a0866ab715681f9e4e7c0cc0e
|
@@ -4,65 +4,54 @@ require 'rubocopfmt/rubocop_formatter'
|
|
4
4
|
|
5
5
|
module RuboCopFMT
|
6
6
|
class AutoCorrector
|
7
|
-
|
8
|
-
'Lint/Debugger',
|
9
|
-
'Lint/UnusedMethodArgument',
|
10
|
-
'Lint/UnusedBlockArgument'
|
11
|
-
].freeze
|
12
|
-
|
13
|
-
RUBOCOP_ARGV = [
|
14
|
-
'--auto-correct',
|
15
|
-
'--cache', 'false',
|
16
|
-
'--format', 'RuboCopFMT::RubocopFormatter',
|
17
|
-
'--except', DISABLED_COPS.join(',')
|
18
|
-
].freeze
|
19
|
-
|
20
|
-
attr_reader :source
|
7
|
+
attr_reader :input
|
21
8
|
attr_reader :runner
|
22
9
|
|
23
|
-
def initialize(
|
24
|
-
@
|
10
|
+
def initialize(input, path = nil)
|
11
|
+
@input = input
|
25
12
|
@path = path
|
26
13
|
end
|
27
14
|
|
28
15
|
def correct
|
29
16
|
Rainbow.enabled = false if defined?(Rainbow)
|
17
|
+
|
30
18
|
@runner = ::RuboCop::Runner.new(options, config_store)
|
31
19
|
@runner.run(paths)
|
20
|
+
|
32
21
|
options[:stdin]
|
33
22
|
end
|
34
23
|
|
35
24
|
private
|
36
25
|
|
37
|
-
def
|
38
|
-
|
39
|
-
|
40
|
-
@config_store = ::RuboCop::ConfigStore.new
|
41
|
-
@config_store.options_config = options[:config] if options[:config]
|
42
|
-
@config_store.force_default_config! if options[:force_default_config]
|
43
|
-
@config_store
|
26
|
+
def paths
|
27
|
+
@paths ||= [@path || 'fake.rb']
|
44
28
|
end
|
45
29
|
|
46
30
|
def options
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
31
|
+
@options ||= {
|
32
|
+
stdin: @input,
|
33
|
+
auto_correct: true,
|
34
|
+
cache: 'false',
|
35
|
+
formatters: [['RuboCopFMT::RubocopFormatter']],
|
36
|
+
except: disabled_cops
|
37
|
+
}
|
51
38
|
end
|
52
39
|
|
53
|
-
def
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
40
|
+
def disabled_cops
|
41
|
+
[
|
42
|
+
'Lint/Debugger',
|
43
|
+
'Lint/UnusedMethodArgument',
|
44
|
+
'Lint/UnusedBlockArgument'
|
45
|
+
]
|
58
46
|
end
|
59
47
|
|
60
|
-
def
|
61
|
-
|
62
|
-
@options, @paths = ::RuboCop::Options.new.parse(argv)
|
63
|
-
@options[:stdin] = source
|
48
|
+
def config_store
|
49
|
+
return @config_store if @config_store
|
64
50
|
|
65
|
-
|
51
|
+
@config_store = ::RuboCop::ConfigStore.new
|
52
|
+
@config_store.options_config = options[:config] if options[:config]
|
53
|
+
@config_store.force_default_config! if options[:force_default_config]
|
54
|
+
@config_store
|
66
55
|
end
|
67
56
|
end
|
68
57
|
end
|
data/lib/rubocopfmt/diff.rb
CHANGED
data/lib/rubocopfmt/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubocopfmt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.0.
|
4
|
+
version: 0.1.0.beta6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jim Myhrberg
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-01-
|
11
|
+
date: 2017-01-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|