spoom 1.0.6 → 1.0.7
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/lib/spoom/cli/bump.rb +10 -9
- data/lib/spoom/cli/helper.rb +5 -1
- data/lib/spoom/config.rb +2 -0
- data/lib/spoom/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: f16907e7c4ce2a3d368bcac828ae7cfb43f0dde8f857bbfa364c4a3a16e0e433
|
|
4
|
+
data.tar.gz: b6d2a532d34b0cd5e8e4964d2edc5e279e5481de511a4e61ea764e120e4bae33
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ad2f822b0c34fdb51ae8002bdc2c3f35202e219e334723716b141afe9ab00b18c65f74c3129cff6e4a9cb992d3c673ccb8afa522114cf2759af5cdd888df5100
|
|
7
|
+
data.tar.gz: f077abc8f9be4b2768776214601dd1c8d8c5709649536202a0ab9765058de9dc8590712b9a6fb96c30a0ac5ed46e7c21d84ab9bff190e48d99d5e0bddab1d44e
|
data/lib/spoom/cli/bump.rb
CHANGED
|
@@ -18,6 +18,8 @@ module Spoom
|
|
|
18
18
|
option :force, desc: "change strictness without type checking", type: :boolean, default: false, aliases: :f
|
|
19
19
|
sig { params(directory: String).void }
|
|
20
20
|
def bump(directory = ".")
|
|
21
|
+
in_sorbet_project!
|
|
22
|
+
|
|
21
23
|
from = options[:from]
|
|
22
24
|
to = options[:to]
|
|
23
25
|
force = options[:force]
|
|
@@ -32,28 +34,27 @@ module Spoom
|
|
|
32
34
|
exit(1)
|
|
33
35
|
end
|
|
34
36
|
|
|
37
|
+
directory = File.expand_path(directory)
|
|
35
38
|
files_to_bump = Sorbet::Sigils.files_with_sigil_strictness(directory, from)
|
|
36
|
-
|
|
37
39
|
Sorbet::Sigils.change_sigil_in_files(files_to_bump, to)
|
|
38
40
|
|
|
39
|
-
return
|
|
41
|
+
return if force
|
|
40
42
|
|
|
41
|
-
output, no_errors = Sorbet.srb_tc(path:
|
|
43
|
+
output, no_errors = Sorbet.srb_tc(path: exec_path, capture_err: true)
|
|
42
44
|
|
|
43
|
-
return
|
|
45
|
+
return if no_errors
|
|
44
46
|
|
|
45
47
|
errors = Sorbet::Errors::Parser.parse_string(output)
|
|
46
48
|
|
|
47
49
|
files_with_errors = errors.map do |err|
|
|
48
|
-
path = err.file
|
|
49
|
-
|
|
50
|
+
path = File.expand_path(err.file)
|
|
51
|
+
next unless path.start_with?(directory)
|
|
52
|
+
next unless File.file?(path)
|
|
53
|
+
path
|
|
50
54
|
end.compact.uniq
|
|
51
55
|
|
|
52
56
|
Sorbet::Sigils.change_sigil_in_files(files_with_errors, from)
|
|
53
57
|
end
|
|
54
|
-
|
|
55
|
-
no_commands do
|
|
56
|
-
end
|
|
57
58
|
end
|
|
58
59
|
end
|
|
59
60
|
end
|
data/lib/spoom/cli/helper.rb
CHANGED
|
@@ -37,7 +37,11 @@ module Spoom
|
|
|
37
37
|
sig { void }
|
|
38
38
|
def in_sorbet_project!
|
|
39
39
|
unless in_sorbet_project?
|
|
40
|
-
say_error(
|
|
40
|
+
say_error(
|
|
41
|
+
"not in a Sorbet project (#{colorize(sorbet_config, :yellow)} not found)\n\n" \
|
|
42
|
+
"When running spoom from another path than the project's root, " \
|
|
43
|
+
"use #{colorize('--path PATH', :blue)} to specify the path to the root."
|
|
44
|
+
)
|
|
41
45
|
Kernel.exit(1)
|
|
42
46
|
end
|
|
43
47
|
end
|
data/lib/spoom/config.rb
CHANGED
data/lib/spoom/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: spoom
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.7
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Alexandre Terrasa
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2020-11-
|
|
11
|
+
date: 2020-11-30 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|