rubocop-sketchup 1.3.0 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +20 -21
- data/assets/output.html.erb +301 -301
- data/config/default.yml +379 -379
- data/lib/rubocop/sketchup/config.rb +63 -63
- data/lib/rubocop/sketchup/cop/bugs/material_name.rb +108 -108
- data/lib/rubocop/sketchup/cop/bugs/render_mode.rb +72 -72
- data/lib/rubocop/sketchup/cop/bugs/uniform_scaling.rb +36 -36
- data/lib/rubocop/sketchup/cop/deprecations/add_separator_to_menu.rb +25 -25
- data/lib/rubocop/sketchup/cop/deprecations/operation_next_transparent.rb +30 -30
- data/lib/rubocop/sketchup/cop/deprecations/require_all.rb +27 -27
- data/lib/rubocop/sketchup/cop/deprecations/set_texture_projection.rb +26 -26
- data/lib/rubocop/sketchup/cop/deprecations/show_ruby_panel.rb +25 -25
- data/lib/rubocop/sketchup/cop/deprecations/sketchup_set.rb +30 -30
- data/lib/rubocop/sketchup/cop/performance/openssl.rb +41 -41
- data/lib/rubocop/sketchup/cop/performance/operation_disable_ui.rb +33 -33
- data/lib/rubocop/sketchup/cop/performance/selection_bulk.rb +79 -79
- data/lib/rubocop/sketchup/cop/performance/type_check.rb +63 -63
- data/lib/rubocop/sketchup/cop/performance/typename.rb +24 -24
- data/lib/rubocop/sketchup/cop/requirements/api_namespace.rb +30 -30
- data/lib/rubocop/sketchup/cop/requirements/exit.rb +33 -33
- data/lib/rubocop/sketchup/cop/requirements/extension_namespace.rb +125 -125
- data/lib/rubocop/sketchup/cop/requirements/file_structure.rb +97 -97
- data/lib/rubocop/sketchup/cop/requirements/gem_install.rb +45 -45
- data/lib/rubocop/sketchup/cop/requirements/get_extension_license.rb +95 -95
- data/lib/rubocop/sketchup/cop/requirements/global_constants.rb +38 -38
- data/lib/rubocop/sketchup/cop/requirements/global_include.rb +42 -42
- data/lib/rubocop/sketchup/cop/requirements/global_methods.rb +65 -65
- data/lib/rubocop/sketchup/cop/requirements/global_variables.rb +95 -95
- data/lib/rubocop/sketchup/cop/requirements/language_handler_globals.rb +46 -46
- data/lib/rubocop/sketchup/cop/requirements/load_path.rb +83 -83
- data/lib/rubocop/sketchup/cop/requirements/minimal_registration.rb +73 -73
- data/lib/rubocop/sketchup/cop/requirements/observers_start_operation.rb +161 -161
- data/lib/rubocop/sketchup/cop/requirements/register_extension.rb +45 -45
- data/lib/rubocop/sketchup/cop/requirements/ruby_core_namespace.rb +291 -291
- data/lib/rubocop/sketchup/cop/requirements/ruby_stdlib_namespace.rb +634 -634
- data/lib/rubocop/sketchup/cop/requirements/shipped_extensions_namespace.rb +61 -61
- data/lib/rubocop/sketchup/cop/requirements/sketchup_extension.rb +119 -119
- data/lib/rubocop/sketchup/cop/requirements/sketchup_require.rb +150 -149
- data/lib/rubocop/sketchup/cop/suggestions/add_group.rb +49 -49
- data/lib/rubocop/sketchup/cop/suggestions/compatibility.rb +128 -128
- data/lib/rubocop/sketchup/cop/suggestions/dc_internals.rb +34 -34
- data/lib/rubocop/sketchup/cop/suggestions/file_encoding.rb +78 -78
- data/lib/rubocop/sketchup/cop/suggestions/model_entities.rb +58 -58
- data/lib/rubocop/sketchup/cop/suggestions/monkey_patched_api.rb +45 -45
- data/lib/rubocop/sketchup/cop/suggestions/operation_name.rb +137 -137
- data/lib/rubocop/sketchup/cop/suggestions/sketchup_find_support_file.rb +39 -39
- data/lib/rubocop/sketchup/cop/suggestions/tool_drawing_bounds.rb +45 -45
- data/lib/rubocop/sketchup/cop/suggestions/tool_invalidate.rb +68 -68
- data/lib/rubocop/sketchup/cop/suggestions/tool_user_input.rb +41 -41
- data/lib/rubocop/sketchup/cop/suggestions/toolbar_timer.rb +65 -65
- data/lib/rubocop/sketchup/cop.rb +110 -110
- data/lib/rubocop/sketchup/dc_globals.rb +24 -24
- data/lib/rubocop/sketchup/dc_methods.rb +130 -130
- data/lib/rubocop/sketchup/extension_project.rb +65 -65
- data/lib/rubocop/sketchup/features.rb +1477 -1420
- data/lib/rubocop/sketchup/formatter/extension_review.rb +269 -269
- data/lib/rubocop/sketchup/inject.rb +19 -19
- data/lib/rubocop/sketchup/namespace.rb +49 -49
- data/lib/rubocop/sketchup/namespace_checker.rb +103 -103
- data/lib/rubocop/sketchup/no_comment_disable.rb +17 -17
- data/lib/rubocop/sketchup/range_help.rb +52 -52
- data/lib/rubocop/sketchup/sketchup_target_range.rb +75 -75
- data/lib/rubocop/sketchup/sketchup_version.rb +129 -128
- data/lib/rubocop/sketchup/tool_checker.rb +41 -43
- data/lib/rubocop/sketchup/version.rb +7 -7
- data/lib/rubocop/sketchup.rb +14 -14
- data/lib/rubocop-sketchup.rb +53 -53
- data/rubocop-sketchup.gemspec +29 -29
- metadata +8 -8
@@ -1,128 +1,129 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module RuboCop
|
4
|
-
module SketchUp
|
5
|
-
class SketchUpVersion
|
6
|
-
|
7
|
-
include Comparable
|
8
|
-
|
9
|
-
attr_reader :version, :maintenance
|
10
|
-
|
11
|
-
class InvalidVersion < StandardError; end
|
12
|
-
|
13
|
-
# @overload initialize(version_string)
|
14
|
-
# @param [String] version_string
|
15
|
-
#
|
16
|
-
# @overload initialize(version, maintenance)
|
17
|
-
# @param [Integer, Float] version
|
18
|
-
# @param [Integer] maintenance
|
19
|
-
def initialize(*args)
|
20
|
-
case args.size
|
21
|
-
when 1
|
22
|
-
@version, @maintenance = parse_version(args.first)
|
23
|
-
when 2
|
24
|
-
validate(args)
|
25
|
-
@version, @maintenance = args
|
26
|
-
else
|
27
|
-
raise ArgumentError, "expected 1..2 arguments, got #{args.size}"
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
# @return [SketchUpVersion, nil]
|
32
|
-
def succ
|
33
|
-
version_parts = [@version, @maintenance]
|
34
|
-
index = VALID_VERSIONS.index(version_parts)
|
35
|
-
next_version_parts = VALID_VERSIONS[index + 1]
|
36
|
-
return nil if next_version_parts.nil?
|
37
|
-
|
38
|
-
self.class.new(*next_version_parts)
|
39
|
-
end
|
40
|
-
|
41
|
-
def <=>(other)
|
42
|
-
if version == other.version
|
43
|
-
maintenance <=> other.maintenance
|
44
|
-
else
|
45
|
-
version <=> other.version
|
46
|
-
end
|
47
|
-
end
|
48
|
-
|
49
|
-
# @return [String]
|
50
|
-
def to_s
|
51
|
-
string_version = version < 2013 ? version.to_f : version.to_i
|
52
|
-
if maintenance > 0
|
53
|
-
"SketchUp #{string_version} M#{maintenance}"
|
54
|
-
else
|
55
|
-
"SketchUp #{string_version}"
|
56
|
-
end
|
57
|
-
end
|
58
|
-
|
59
|
-
private
|
60
|
-
|
61
|
-
VERSION_NUMBER_REGEX = /^(?:SketchUp )?([0-9.]+)(?: M(\d+))?$/.freeze
|
62
|
-
|
63
|
-
# This list is compiled from the list of versions reported by YARD when
|
64
|
-
# running the `versions` template on the API stubs repository;
|
65
|
-
#
|
66
|
-
# yardoc -t versions -f text
|
67
|
-
#
|
68
|
-
# The second item in the array is maintenance annotation
|
69
|
-
VALID_VERSIONS = [
|
70
|
-
[
|
71
|
-
[
|
72
|
-
[2021.
|
73
|
-
[
|
74
|
-
[2020.
|
75
|
-
[
|
76
|
-
[2019.
|
77
|
-
[2019, 0], #
|
78
|
-
[
|
79
|
-
[
|
80
|
-
[
|
81
|
-
[2016,
|
82
|
-
[
|
83
|
-
[
|
84
|
-
[
|
85
|
-
[
|
86
|
-
[8.0,
|
87
|
-
[8.0,
|
88
|
-
[
|
89
|
-
[7.1,
|
90
|
-
[7.
|
91
|
-
[7.0,
|
92
|
-
[
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
# @
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
end
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module RuboCop
|
4
|
+
module SketchUp
|
5
|
+
class SketchUpVersion
|
6
|
+
|
7
|
+
include Comparable
|
8
|
+
|
9
|
+
attr_reader :version, :maintenance
|
10
|
+
|
11
|
+
class InvalidVersion < StandardError; end
|
12
|
+
|
13
|
+
# @overload initialize(version_string)
|
14
|
+
# @param [String] version_string
|
15
|
+
#
|
16
|
+
# @overload initialize(version, maintenance)
|
17
|
+
# @param [Integer, Float] version
|
18
|
+
# @param [Integer] maintenance
|
19
|
+
def initialize(*args)
|
20
|
+
case args.size
|
21
|
+
when 1
|
22
|
+
@version, @maintenance = parse_version(args.first)
|
23
|
+
when 2
|
24
|
+
validate(args)
|
25
|
+
@version, @maintenance = args
|
26
|
+
else
|
27
|
+
raise ArgumentError, "expected 1..2 arguments, got #{args.size}"
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
# @return [SketchUpVersion, nil]
|
32
|
+
def succ
|
33
|
+
version_parts = [@version, @maintenance]
|
34
|
+
index = VALID_VERSIONS.index(version_parts)
|
35
|
+
next_version_parts = VALID_VERSIONS[index + 1]
|
36
|
+
return nil if next_version_parts.nil?
|
37
|
+
|
38
|
+
self.class.new(*next_version_parts)
|
39
|
+
end
|
40
|
+
|
41
|
+
def <=>(other)
|
42
|
+
if version == other.version
|
43
|
+
maintenance <=> other.maintenance
|
44
|
+
else
|
45
|
+
version <=> other.version
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
# @return [String]
|
50
|
+
def to_s
|
51
|
+
string_version = version < 2013 ? version.to_f : version.to_i
|
52
|
+
if maintenance > 0
|
53
|
+
"SketchUp #{string_version} M#{maintenance}"
|
54
|
+
else
|
55
|
+
"SketchUp #{string_version}"
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
private
|
60
|
+
|
61
|
+
VERSION_NUMBER_REGEX = /^(?:SketchUp )?([0-9.]+)(?: M(\d+))?$/.freeze
|
62
|
+
|
63
|
+
# This list is compiled from the list of versions reported by YARD when
|
64
|
+
# running the `versions` template on the API stubs repository;
|
65
|
+
#
|
66
|
+
# yardoc -t versions -f text
|
67
|
+
#
|
68
|
+
# The second item in the array is maintenance annotation
|
69
|
+
VALID_VERSIONS = [
|
70
|
+
[2023.0, 0],
|
71
|
+
[2022.0, 0],
|
72
|
+
[2021.1, 0],
|
73
|
+
[2021.0, 0],
|
74
|
+
[2020.1, 0],
|
75
|
+
[2020.0, 0],
|
76
|
+
[2019.2, 0],
|
77
|
+
[2019.0, 0], # SketchUp dropped M notation as of SU2019.
|
78
|
+
[2019, 0], # Documentation still refer to SU2019 instead of SU2019.0
|
79
|
+
[2018, 0],
|
80
|
+
[2017, 0],
|
81
|
+
[2016, 1],
|
82
|
+
[2016, 0],
|
83
|
+
[2015, 0],
|
84
|
+
[2014, 0],
|
85
|
+
[2013, 0],
|
86
|
+
[8.0, 2],
|
87
|
+
[8.0, 1],
|
88
|
+
[8.0, 0],
|
89
|
+
[7.1, 1],
|
90
|
+
[7.1, 0],
|
91
|
+
[7.0, 1],
|
92
|
+
[7.0, 0],
|
93
|
+
[6.0, 0],
|
94
|
+
].reverse.freeze
|
95
|
+
|
96
|
+
# @param [String] version
|
97
|
+
# @return [Array(Float, Integer)]
|
98
|
+
def parse_version(version)
|
99
|
+
v = 0
|
100
|
+
m = 0
|
101
|
+
case version
|
102
|
+
when String
|
103
|
+
# Treat all LayOut versions as SketchUp versions for now.
|
104
|
+
normalized_version = version.gsub('LayOut', 'SketchUp')
|
105
|
+
result = normalized_version.match(VERSION_NUMBER_REGEX)
|
106
|
+
if result
|
107
|
+
v = result.captures[0].to_f
|
108
|
+
m = (result.captures[1] || '0').to_i
|
109
|
+
end
|
110
|
+
when Numeric
|
111
|
+
v = version
|
112
|
+
m = 0
|
113
|
+
end
|
114
|
+
validate([v, m])
|
115
|
+
end
|
116
|
+
|
117
|
+
# @param [Array(Float, Integer)] version_parts
|
118
|
+
def validate(version_parts)
|
119
|
+
unless VALID_VERSIONS.include?(version_parts)
|
120
|
+
version = version_parts.join('.')
|
121
|
+
raise InvalidVersion, "#{version} is not a valid SketchUp version"
|
122
|
+
end
|
123
|
+
|
124
|
+
version_parts
|
125
|
+
end
|
126
|
+
|
127
|
+
end
|
128
|
+
end
|
129
|
+
end
|
@@ -1,43 +1,41 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module RuboCop
|
4
|
-
module SketchUp
|
5
|
-
module ToolChecker
|
6
|
-
|
7
|
-
def on_class(node)
|
8
|
-
name, _base_class, body = *node
|
9
|
-
return unless name.const_name.end_with?('Tool')
|
10
|
-
|
11
|
-
check_body(body, node)
|
12
|
-
end
|
13
|
-
|
14
|
-
private
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
end
|
43
|
-
end
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module RuboCop
|
4
|
+
module SketchUp
|
5
|
+
module ToolChecker
|
6
|
+
|
7
|
+
def on_class(node)
|
8
|
+
name, _base_class, body = *node
|
9
|
+
return unless name.const_name.end_with?('Tool')
|
10
|
+
|
11
|
+
check_body(body, node)
|
12
|
+
end
|
13
|
+
|
14
|
+
private
|
15
|
+
|
16
|
+
def on_tool_class(class_node, body, body_methods)
|
17
|
+
raise NotImplementedError, 'Implement this method'
|
18
|
+
end
|
19
|
+
|
20
|
+
def body_methods(body)
|
21
|
+
return [body] if body.def_type?
|
22
|
+
return unless body.begin_type?
|
23
|
+
|
24
|
+
body.each_child_node(:def)
|
25
|
+
end
|
26
|
+
|
27
|
+
def check_body(body, class_node)
|
28
|
+
return if body.nil? # Empty class etc.
|
29
|
+
|
30
|
+
body_methods = body_methods(body)
|
31
|
+
|
32
|
+
on_tool_class(class_node, body_methods)
|
33
|
+
end
|
34
|
+
|
35
|
+
def find_method(defs, method_name)
|
36
|
+
defs.find { |def_node| def_node.method?(method_name) }
|
37
|
+
end
|
38
|
+
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -1,7 +1,7 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module RuboCop
|
4
|
-
module SketchUp
|
5
|
-
VERSION = '1.
|
6
|
-
end
|
7
|
-
end
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module RuboCop
|
4
|
+
module SketchUp
|
5
|
+
VERSION = '1.4.0'
|
6
|
+
end
|
7
|
+
end
|
data/lib/rubocop/sketchup.rb
CHANGED
@@ -1,14 +1,14 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'pathname'
|
4
|
-
|
5
|
-
module RuboCop
|
6
|
-
# RuboCop SketchUp project namespace
|
7
|
-
module SketchUp
|
8
|
-
PROJECT_ROOT = Pathname.new(__dir__).parent.parent.expand_path.freeze
|
9
|
-
CONFIG_DEFAULT = PROJECT_ROOT.join('config', 'default.yml').freeze
|
10
|
-
CONFIG = YAML.safe_load(CONFIG_DEFAULT.read).freeze
|
11
|
-
|
12
|
-
private_constant(:CONFIG_DEFAULT, :PROJECT_ROOT)
|
13
|
-
end
|
14
|
-
end
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'pathname'
|
4
|
+
|
5
|
+
module RuboCop
|
6
|
+
# RuboCop SketchUp project namespace
|
7
|
+
module SketchUp
|
8
|
+
PROJECT_ROOT = Pathname.new(__dir__).parent.parent.expand_path.freeze
|
9
|
+
CONFIG_DEFAULT = PROJECT_ROOT.join('config', 'default.yml').freeze
|
10
|
+
CONFIG = YAML.safe_load(CONFIG_DEFAULT.read).freeze
|
11
|
+
|
12
|
+
private_constant(:CONFIG_DEFAULT, :PROJECT_ROOT)
|
13
|
+
end
|
14
|
+
end
|
data/lib/rubocop-sketchup.rb
CHANGED
@@ -1,53 +1,53 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'rubocop'
|
4
|
-
require 'rubocop/sketchup'
|
5
|
-
require 'rubocop/sketchup/version'
|
6
|
-
require 'rubocop/sketchup/inject'
|
7
|
-
|
8
|
-
require 'rubocop/sketchup/formatter/extension_review'
|
9
|
-
require 'rubocop/sketchup/config'
|
10
|
-
require 'rubocop/sketchup/cop'
|
11
|
-
require 'rubocop/sketchup/dc_globals'
|
12
|
-
require 'rubocop/sketchup/dc_methods'
|
13
|
-
require 'rubocop/sketchup/extension_project'
|
14
|
-
require 'rubocop/sketchup/features'
|
15
|
-
require 'rubocop/sketchup/namespace'
|
16
|
-
require 'rubocop/sketchup/namespace_checker'
|
17
|
-
require 'rubocop/sketchup/no_comment_disable'
|
18
|
-
require 'rubocop/sketchup/range_help'
|
19
|
-
require 'rubocop/sketchup/sketchup_target_range'
|
20
|
-
require 'rubocop/sketchup/sketchup_version'
|
21
|
-
require 'rubocop/sketchup/tool_checker'
|
22
|
-
|
23
|
-
RuboCop::SketchUp::Inject.defaults!
|
24
|
-
|
25
|
-
# Monkey patching the built in formatter list to add a short alias for custom
|
26
|
-
# formatters. Naughty! Naughty!
|
27
|
-
class RuboCop::Formatter::FormatterSet
|
28
|
-
formatters = BUILTIN_FORMATTERS_FOR_KEYS.dup
|
29
|
-
formatters['extension_review'] =
|
30
|
-
RuboCop::Formatter::ExtensionReviewFormatter
|
31
|
-
verbose = $VERBOSE
|
32
|
-
begin
|
33
|
-
$VERBOSE = nil
|
34
|
-
BUILTIN_FORMATTERS_FOR_KEYS = formatters.freeze
|
35
|
-
ensure
|
36
|
-
$VERBOSE = verbose
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
# Make it easier to explore available methods on a method.
|
41
|
-
class Object
|
42
|
-
def methods!(queries = true) # rubocop:disable Style/OptionalBooleanParameter
|
43
|
-
sorted = methods.sort - Object.class.instance_methods
|
44
|
-
sorted.reject! { |m| m.to_s.end_with?('?') } unless queries
|
45
|
-
sorted
|
46
|
-
end
|
47
|
-
end
|
48
|
-
|
49
|
-
# Load all custom cops.
|
50
|
-
pattern = File.join(__dir__, 'rubocop', 'sketchup', 'cop', '**/*rb')
|
51
|
-
Dir.glob(pattern).sort.each { |file|
|
52
|
-
require file
|
53
|
-
}
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'rubocop'
|
4
|
+
require 'rubocop/sketchup'
|
5
|
+
require 'rubocop/sketchup/version'
|
6
|
+
require 'rubocop/sketchup/inject'
|
7
|
+
|
8
|
+
require 'rubocop/sketchup/formatter/extension_review'
|
9
|
+
require 'rubocop/sketchup/config'
|
10
|
+
require 'rubocop/sketchup/cop'
|
11
|
+
require 'rubocop/sketchup/dc_globals'
|
12
|
+
require 'rubocop/sketchup/dc_methods'
|
13
|
+
require 'rubocop/sketchup/extension_project'
|
14
|
+
require 'rubocop/sketchup/features'
|
15
|
+
require 'rubocop/sketchup/namespace'
|
16
|
+
require 'rubocop/sketchup/namespace_checker'
|
17
|
+
require 'rubocop/sketchup/no_comment_disable'
|
18
|
+
require 'rubocop/sketchup/range_help'
|
19
|
+
require 'rubocop/sketchup/sketchup_target_range'
|
20
|
+
require 'rubocop/sketchup/sketchup_version'
|
21
|
+
require 'rubocop/sketchup/tool_checker'
|
22
|
+
|
23
|
+
RuboCop::SketchUp::Inject.defaults!
|
24
|
+
|
25
|
+
# Monkey patching the built in formatter list to add a short alias for custom
|
26
|
+
# formatters. Naughty! Naughty!
|
27
|
+
class RuboCop::Formatter::FormatterSet
|
28
|
+
formatters = BUILTIN_FORMATTERS_FOR_KEYS.dup
|
29
|
+
formatters['extension_review'] =
|
30
|
+
RuboCop::Formatter::ExtensionReviewFormatter
|
31
|
+
verbose = $VERBOSE
|
32
|
+
begin
|
33
|
+
$VERBOSE = nil
|
34
|
+
BUILTIN_FORMATTERS_FOR_KEYS = formatters.freeze
|
35
|
+
ensure
|
36
|
+
$VERBOSE = verbose
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
# Make it easier to explore available methods on a method.
|
41
|
+
class Object
|
42
|
+
def methods!(queries = true) # rubocop:disable Style/OptionalBooleanParameter
|
43
|
+
sorted = methods.sort - Object.class.instance_methods
|
44
|
+
sorted.reject! { |m| m.to_s.end_with?('?') } unless queries
|
45
|
+
sorted
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
# Load all custom cops.
|
50
|
+
pattern = File.join(__dir__, 'rubocop', 'sketchup', 'cop', '**/*rb')
|
51
|
+
Dir.glob(pattern).sort.each { |file|
|
52
|
+
require file
|
53
|
+
}
|
data/rubocop-sketchup.gemspec
CHANGED
@@ -1,29 +1,29 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
$LOAD_PATH.unshift File.expand_path('lib', __dir__)
|
4
|
-
require 'rubocop/sketchup/version'
|
5
|
-
|
6
|
-
Gem::Specification.new do |spec|
|
7
|
-
spec.name = 'rubocop-sketchup'
|
8
|
-
spec.summary = 'RuboCop rules for SketchUp extensions.'
|
9
|
-
spec.description = 'RuboCop rules for SketchUp extensions.'
|
10
|
-
spec.homepage = 'https://github.com/sketchup/rubocop-sketchup'
|
11
|
-
spec.authors = ['Trimble Inc, SketchUp Team']
|
12
|
-
spec.licenses = ['MIT']
|
13
|
-
|
14
|
-
spec.version = RuboCop::SketchUp::VERSION
|
15
|
-
spec.platform = Gem::Platform::RUBY
|
16
|
-
spec.required_ruby_version = '>= 2.
|
17
|
-
|
18
|
-
spec.require_paths = ['lib']
|
19
|
-
spec.files = Dir[
|
20
|
-
'assets/**/*',
|
21
|
-
'config/**/*',
|
22
|
-
'lib/**/*',
|
23
|
-
'*.gemspec',
|
24
|
-
'Gemfile'
|
25
|
-
]
|
26
|
-
|
27
|
-
spec.add_dependency 'rubocop', '>= 0.82', '< 2.0'
|
28
|
-
spec.add_development_dependency 'bundler', '>= 1.13', '< 3.0'
|
29
|
-
end
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
$LOAD_PATH.unshift File.expand_path('lib', __dir__)
|
4
|
+
require 'rubocop/sketchup/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = 'rubocop-sketchup'
|
8
|
+
spec.summary = 'RuboCop rules for SketchUp extensions.'
|
9
|
+
spec.description = 'RuboCop rules for SketchUp extensions.'
|
10
|
+
spec.homepage = 'https://github.com/sketchup/rubocop-sketchup'
|
11
|
+
spec.authors = ['Trimble Inc, SketchUp Team']
|
12
|
+
spec.licenses = ['MIT']
|
13
|
+
|
14
|
+
spec.version = RuboCop::SketchUp::VERSION
|
15
|
+
spec.platform = Gem::Platform::RUBY
|
16
|
+
spec.required_ruby_version = '>= 2.6.0'
|
17
|
+
|
18
|
+
spec.require_paths = ['lib']
|
19
|
+
spec.files = Dir[
|
20
|
+
'assets/**/*',
|
21
|
+
'config/**/*',
|
22
|
+
'lib/**/*',
|
23
|
+
'*.gemspec',
|
24
|
+
'Gemfile'
|
25
|
+
]
|
26
|
+
|
27
|
+
spec.add_dependency 'rubocop', '>= 0.82', '< 2.0'
|
28
|
+
spec.add_development_dependency 'bundler', '>= 1.13', '< 3.0'
|
29
|
+
end
|
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: 1.
|
4
|
+
version: 1.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Trimble Inc, SketchUp Team
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-02-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubocop
|
@@ -51,7 +51,7 @@ dependencies:
|
|
51
51
|
- !ruby/object:Gem::Version
|
52
52
|
version: '3.0'
|
53
53
|
description: RuboCop rules for SketchUp extensions.
|
54
|
-
email:
|
54
|
+
email:
|
55
55
|
executables: []
|
56
56
|
extensions: []
|
57
57
|
extra_rdoc_files: []
|
@@ -129,7 +129,7 @@ homepage: https://github.com/sketchup/rubocop-sketchup
|
|
129
129
|
licenses:
|
130
130
|
- MIT
|
131
131
|
metadata: {}
|
132
|
-
post_install_message:
|
132
|
+
post_install_message:
|
133
133
|
rdoc_options: []
|
134
134
|
require_paths:
|
135
135
|
- lib
|
@@ -137,15 +137,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
137
137
|
requirements:
|
138
138
|
- - ">="
|
139
139
|
- !ruby/object:Gem::Version
|
140
|
-
version: 2.
|
140
|
+
version: 2.6.0
|
141
141
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
142
142
|
requirements:
|
143
143
|
- - ">="
|
144
144
|
- !ruby/object:Gem::Version
|
145
145
|
version: '0'
|
146
146
|
requirements: []
|
147
|
-
rubygems_version: 3.
|
148
|
-
signing_key:
|
147
|
+
rubygems_version: 3.1.4
|
148
|
+
signing_key:
|
149
149
|
specification_version: 4
|
150
150
|
summary: RuboCop rules for SketchUp extensions.
|
151
151
|
test_files: []
|