rdoc_rubocop 0.1.0 → 0.1.1
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/exe/rdoc-rubocop +14 -2
- data/lib/rdoc_rubocop/rubocop_runner.rb +22 -5
- data/lib/rdoc_rubocop/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6b63973fa39336e9076bf266fbc9b1befa5b72bf3f05216ced86702327fd7794
|
4
|
+
data.tar.gz: b5945fcaf720a68e50c0d588f974c5f40c3a68006625a063a89c58e774295895
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c577e35ba541ad0f951fdc1ec9e0a619418cc16006a7d52124174c85aba0ead6c1cf385689d63fb54473338ee8d10d0a1f91435d78bfcff8c3183faab5f609dc
|
7
|
+
data.tar.gz: 9972b60eb46eeca29766a215bb27a80ccefe0c50860565cf73a35a4ec2c91d6d01f00ec9b0c5aa259370412069b3e31022377f50d9a61c3432da8b2c90d7f246
|
data/exe/rdoc-rubocop
CHANGED
@@ -5,7 +5,19 @@ $LOAD_PATH.unshift("#{__dir__}/../lib")
|
|
5
5
|
require "rdoc_rubocop"
|
6
6
|
|
7
7
|
options, paths = RDocRuboCop::Options.new.parse(ARGV)
|
8
|
-
paths = Dir.glob("**/*.rb") if paths.empty? if paths.empty?
|
9
8
|
|
10
|
-
|
9
|
+
paths = ["."] if paths.empty?
|
10
|
+
paths =
|
11
|
+
paths.
|
12
|
+
uniq.
|
13
|
+
flat_map do |path|
|
14
|
+
path = Pathname.new(path)
|
15
|
+
if path.directory?
|
16
|
+
path.glob("**/*.rb")
|
17
|
+
else
|
18
|
+
path
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
runner = RDocRuboCop::RuboCopRunner.new(paths.map(&:to_s), options: options)
|
11
23
|
runner.run
|
@@ -21,19 +21,27 @@ module RDocRuboCop
|
|
21
21
|
|
22
22
|
def format
|
23
23
|
targets = source_files
|
24
|
-
|
25
24
|
file_paths = targets.flat_map(&:source_code_file_paths)
|
26
|
-
exit_code = run_cli(file_paths)
|
27
25
|
|
28
|
-
|
26
|
+
if file_paths.empty?
|
27
|
+
report_zero
|
28
|
+
else
|
29
|
+
exit_code = run_cli(file_paths)
|
30
|
+
targets.each(&:correct!)
|
29
31
|
|
30
|
-
|
32
|
+
exit_code
|
33
|
+
end
|
31
34
|
end
|
32
35
|
|
33
36
|
def style_check
|
34
37
|
targets = source_files
|
35
38
|
file_paths = targets.flat_map(&:source_code_file_paths)
|
36
|
-
|
39
|
+
|
40
|
+
if file_paths.empty?
|
41
|
+
report_zero
|
42
|
+
else
|
43
|
+
run_cli(file_paths)
|
44
|
+
end
|
37
45
|
end
|
38
46
|
|
39
47
|
def run_cli(source_code_file_paths)
|
@@ -43,5 +51,14 @@ module RDocRuboCop
|
|
43
51
|
def source_files
|
44
52
|
@paths.map(&SourceFile.method(:build))
|
45
53
|
end
|
54
|
+
|
55
|
+
# Report with a message: "Inspecting 0 files"
|
56
|
+
def report_zero
|
57
|
+
non_existing_filepath = Dir.glob("#{__dir__}/*").sort.last.succ
|
58
|
+
|
59
|
+
options, _ = RuboCop::Options.new.parse(@options)
|
60
|
+
config_store = RuboCop::ConfigStore.new
|
61
|
+
runner = RuboCop::Runner.new(options, config_store).run([non_existing_filepath])
|
62
|
+
end
|
46
63
|
end
|
47
64
|
end
|
data/lib/rdoc_rubocop/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rdoc_rubocop
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Loose Coupling
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-12-
|
11
|
+
date: 2018-12-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubocop
|