rubocop-sketchup 0.16.1 → 0.17.0
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/Gemfile +1 -1
- data/lib/rubocop/sketchup/cop.rb +9 -10
- data/lib/rubocop/sketchup/sketchup_version.rb +6 -4
- data/lib/rubocop/sketchup/version.rb +1 -1
- data/rubocop-sketchup.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a7df76ab15e23629404f20058b4526fa349087d3565698da08ffc7cf684a4e76
|
4
|
+
data.tar.gz: 4854d4b9c5867484d75e80d9ab2a73d66928b73ebf3ba3690c6806dc609b93e2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ff776f302d5439f1b44324a4b41155f39b4cae4396d18675265fe17a696ec3220530f5b76cdf409aa1e28a6eac21f7be2c1e5e6ded7fcba53acdb71a91b58958
|
7
|
+
data.tar.gz: c54421dc0d103ac574be46ce850906282710fdb6e2ad1d3e3214596122f4d47154fc9017bc1ead17a8fe78aa2867eb8c333e6b7a9e923723638975f6c3d34499
|
data/Gemfile
CHANGED
@@ -8,7 +8,7 @@ group :test do
|
|
8
8
|
gem 'appveyor-worker', '~> 0.2', require: false
|
9
9
|
gem 'rake', '~> 12.0', require: false
|
10
10
|
gem 'rspec', '~> 3.7', require: false
|
11
|
-
gem 'rubocop-performance', require: false
|
11
|
+
gem 'rubocop-performance', '~> 1.7.0', require: false
|
12
12
|
gem 'simplecov', '~> 0.10', require: false
|
13
13
|
end
|
14
14
|
|
data/lib/rubocop/sketchup/cop.rb
CHANGED
@@ -42,6 +42,14 @@ module RuboCop
|
|
42
42
|
|
43
43
|
include SketchUp::Config
|
44
44
|
|
45
|
+
SKETCHUP_DEPARTMENT_SEVERITY = {
|
46
|
+
SketchupRequirements: :error,
|
47
|
+
SketchupDeprecations: :warning,
|
48
|
+
SketchupPerformance: :warning,
|
49
|
+
SketchupBugs: :warning,
|
50
|
+
SketchupSuggestions: :convention,
|
51
|
+
}.freeze
|
52
|
+
|
45
53
|
# Invoke the original inherited hook so our cops are recognized
|
46
54
|
def self.inherited(subclass)
|
47
55
|
RuboCop::Cop::Cop.inherited(subclass)
|
@@ -58,16 +66,7 @@ module RuboCop
|
|
58
66
|
end
|
59
67
|
|
60
68
|
def sketchup_severity
|
61
|
-
|
62
|
-
when :SketchupRequirements
|
63
|
-
:error
|
64
|
-
when :SketchupDeprecations
|
65
|
-
:warning
|
66
|
-
when :SketchupPerformance
|
67
|
-
:warning
|
68
|
-
when :SketchupSuggestions
|
69
|
-
:convention
|
70
|
-
end
|
69
|
+
SKETCHUP_DEPARTMENT_SEVERITY[self.class.department]
|
71
70
|
end
|
72
71
|
|
73
72
|
def department_name
|
@@ -17,9 +17,10 @@ module RuboCop
|
|
17
17
|
# @param [Integer, Float] version
|
18
18
|
# @param [Integer] maintenance
|
19
19
|
def initialize(*args)
|
20
|
-
|
20
|
+
case args.size
|
21
|
+
when 1
|
21
22
|
@version, @maintenance = parse_version(args.first)
|
22
|
-
|
23
|
+
when 2
|
23
24
|
validate(args)
|
24
25
|
@version, @maintenance = args
|
25
26
|
else
|
@@ -93,7 +94,8 @@ module RuboCop
|
|
93
94
|
def parse_version(version)
|
94
95
|
v = 0
|
95
96
|
m = 0
|
96
|
-
|
97
|
+
case version
|
98
|
+
when String
|
97
99
|
# Treat all LayOut versions as SketchUp versions for now.
|
98
100
|
normalized_version = version.gsub('LayOut', 'SketchUp')
|
99
101
|
result = normalized_version.match(VERSION_NUMBER_REGEX)
|
@@ -101,7 +103,7 @@ module RuboCop
|
|
101
103
|
v = result.captures[0].to_f
|
102
104
|
m = (result.captures[1] || '0').to_i
|
103
105
|
end
|
104
|
-
|
106
|
+
when Numeric
|
105
107
|
v = version
|
106
108
|
m = 0
|
107
109
|
end
|
data/rubocop-sketchup.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubocop-sketchup
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.17.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Trimble Inc, SketchUp Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-07-
|
11
|
+
date: 2020-07-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubocop
|
@@ -19,7 +19,7 @@ dependencies:
|
|
19
19
|
version: '0.82'
|
20
20
|
- - "<="
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: '0.
|
22
|
+
version: '0.88'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -29,7 +29,7 @@ dependencies:
|
|
29
29
|
version: '0.82'
|
30
30
|
- - "<="
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: '0.
|
32
|
+
version: '0.88'
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: bundler
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|