manageiq-style 1.0.0 → 1.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ccd4a109779db16869e430273f004338e16e1de877e2edf1c408229bf1d9968d
4
- data.tar.gz: 91cc356ab5b92b529667939a7bb75c1861547a18056ed47f40db3c56c408793d
3
+ metadata.gz: aeb8ff9f981225899057f8a511f60c117540819d36aac865bf49819588d2489f
4
+ data.tar.gz: 9d926d19f291ccb28e5f1a1cc0fd73b090544a049613244340470b672268ca29
5
5
  SHA512:
6
- metadata.gz: 578897c59ec8aa6fd48fa877e862d0241ab4961db33fc3cdff140dcedf2346b871965a2eb8f17be75a74092f3548310ab2b7b828618c48af1214db20375d8858
7
- data.tar.gz: 1d2bd3c89623af4d07e6ce8d953f4dbd677bc813309dd41082b1cf3671953074af884594200f0b51d13d0d7f97efb8e8e5e9946d11538ca0685f73c73db103c0
6
+ metadata.gz: 2ced6243a6718309e99fd31ab36ec6d331458d171a1e83f2aeeae37b7e1638f6529a8ddc040d389c67a7b0b67b6e84e78cd39d5265a8a84fccdb5bdd7d5a64f7
7
+ data.tar.gz: 2151ebe77138ecc1cb35169265ae88fdda3ad6ea700e57496b172a56f12fcb38c74b836a459b0c70ab6ab4332f315d23b835d0706d9a9c218fb6478a0ec2acce
@@ -0,0 +1,12 @@
1
+ prepare:
2
+ fetch:
3
+ - url: https://raw.githubusercontent.com/ManageIQ/manageiq-style/master/.rubocop_base.yml
4
+ path: ".rubocop_base.yml"
5
+ - url: https://raw.githubusercontent.com/ManageIQ/manageiq-style/master/.rubocop_cc_base.yml
6
+ path: ".rubocop_cc_base.yml"
7
+ plugins:
8
+ rubocop:
9
+ enabled: true
10
+ config: ".rubocop_cc.yml"
11
+ channel: rubocop-0-82
12
+ version: '2'
data/.gitignore CHANGED
@@ -6,6 +6,6 @@
6
6
  /pkg/
7
7
  /spec/reports/
8
8
  /tmp/
9
-
9
+ Gemfile.lock
10
10
  # rspec failure tracking
11
11
  .rspec_status
@@ -1,290 +1,2 @@
1
- require:
2
- - rubocop-rails
3
- - rubocop-performance
4
-
5
- AllCops:
6
- NewCops: disable
7
- Exclude:
8
- - spec/manageiq/**/*
9
- - vendor/**/*
10
- TargetRubyVersion: 2.5
11
- Layout/HashAlignment:
12
- EnforcedHashRocketStyle: table
13
- EnforcedColonStyle: table
14
- Layout/DefEndAlignment:
15
- AutoCorrect: true
16
- Layout/EndAlignment:
17
- AutoCorrect: true
18
- Layout/ExtraSpacing:
19
- AutoCorrect: true
20
- Layout/LineLength:
21
- Enabled: false
22
- Layout/SpaceAroundMethodCallOperator:
23
- Enabled: true
24
- Layout/SpaceBeforeFirstArg:
25
- Enabled: false
26
- Layout/SpaceInsideHashLiteralBraces:
27
- EnforcedStyle: no_space
28
- Lint/RaiseException:
29
- Enabled: true
30
- Lint/StructNewOverride:
31
- Enabled: true
32
- Metrics/AbcSize:
33
- Enabled: false
34
- Metrics/BlockLength:
35
- Enabled: false
36
- Metrics/BlockNesting:
37
- Enabled: false
38
- Metrics/ClassLength:
39
- Enabled: false
40
- Metrics/CyclomaticComplexity:
41
- Enabled: false
42
- Metrics/MethodLength:
43
- Enabled: false
44
- Metrics/ModuleLength:
45
- Enabled: false
46
- Metrics/ParameterLists:
47
- Enabled: false
48
- Metrics/PerceivedComplexity:
49
- Enabled: false
50
- Naming/MethodParameterName:
51
- AllowedNames:
52
- - vm
53
- - dc
54
- Naming/RescuedExceptionsVariableName:
55
- Enabled: false
56
- Performance/Casecmp:
57
- Enabled: false
58
- Rails:
59
- Enabled: true
60
- Rails/FindEach:
61
- Enabled: false
62
- Rails/HttpStatus:
63
- Enabled: true
64
- EnforcedStyle: numeric
65
- Rails/ReadWriteAttribute:
66
- AutoCorrect: false
67
- Style/ClassAndModuleChildren:
68
- Enabled: false
69
- Style/ClassCheck:
70
- EnforcedStyle: kind_of?
71
- Style/CollectionMethods:
72
- PreferredMethods:
73
- find: detect
74
- find_all: select
75
- map: collect
76
- reduce: inject
77
- Style/Documentation:
78
- Enabled: false
79
- Style/DoubleNegation:
80
- Enabled: false
81
- Style/EmptyMethod:
82
- Enabled: false
83
- Style/Encoding:
84
- Enabled: false
85
- Style/ExponentialNotation:
86
- Enabled: true
87
- Style/FormatString:
88
- EnforcedStyle: percent
89
- Style/FormatStringToken:
90
- EnforcedStyle: template
91
- Style/FrozenStringLiteralComment:
92
- Enabled: false
93
- Style/GuardClause:
94
- Enabled: false
95
- Style/HashEachMethods:
96
- Enabled: true
97
- Style/HashSyntax:
98
- EnforcedStyle: hash_rockets
99
- Exclude:
100
- - db/schema.rb
101
- Style/HashTransformKeys:
102
- Enabled: true
103
- Style/HashTransformValues:
104
- Enabled: true
105
- Style/IfUnlessModifier:
106
- Enabled: false
107
- Style/MethodCallWithArgsParentheses:
108
- Exclude:
109
- - Gemfile
110
- - config/routes.rb
111
- - lib/generators/**/*
112
- - lib/resource_feeder/**/*
113
- - lib/tasks/**/*
114
- - spec/**/*
115
- Enabled: true
116
- IgnoredMethods:
117
- # Ruby
118
- - add_dependency
119
- - add_development_dependency
120
- - add_runtime_dependency
121
- - alias_method
122
- - attr_accessor
123
- - attr_reader
124
- - attr_writer
125
- - exit
126
- - extend
127
- - gem
128
- - include
129
- - load
130
- - module_function
131
- - pp
132
- - prepend
133
- - print
134
- - private
135
- - private_class_method
136
- - private_constant
137
- - puts
138
- - raise
139
- - require
140
- - sleep
141
- - throw
142
- - warn
143
- - yield
144
- # Rails
145
- - accepts_nested_attributes_for
146
- - add_column
147
- - add_index
148
- - add_reference
149
- - after_action
150
- - after_commit
151
- - after_create
152
- - after_create_commit
153
- - after_destroy
154
- - after_destroy
155
- - after_destroy_commit
156
- - after_initialize
157
- - after_save
158
- - after_save
159
- - after_update
160
- - after_update_commit
161
- - alias_attribute
162
- - around_destroy
163
- - autoload
164
- - before_action
165
- - before_create
166
- - before_destroy
167
- - before_save
168
- - before_update
169
- - before_validation
170
- - belongs_to
171
- - bigint
172
- - boolean
173
- - cattr_accessor
174
- - cattr_reader
175
- - cattr_writer
176
- - change_column
177
- - change_column_comment
178
- - change_column_null
179
- - change_table_comment
180
- - class_attribute
181
- - create_table
182
- - datetime
183
- - decimal
184
- - delegate
185
- - drop_table
186
- - float
187
- - has_and_belongs_to_many
188
- - has_many
189
- - has_one
190
- - head
191
- - identified_by
192
- - index
193
- - integer
194
- - jsonb
195
- - mattr_accessor
196
- - references
197
- - remove_column
198
- - remove_index
199
- - remove_reference
200
- - rename_column
201
- - render
202
- - require_dependency
203
- - require_relative
204
- - respond_to
205
- - scope
206
- - serialize
207
- - skip_before_action
208
- - string
209
- - text
210
- - uuid
211
- - validate
212
- - validates
213
- # ActsAsTree Gem
214
- - acts_as_tree
215
- # Ancestry Gem
216
- - has_ancestry
217
- # DefaultValue Gem
218
- - default_value_for
219
- - default_values
220
- # Optimist Gem
221
- - banner
222
- - die
223
- - opt
224
- # MIQ
225
- - add_trigger
226
- - alias_with_relationship_type
227
- - api_relay_method
228
- - attr_accessor_that_yamls
229
- - deprecate_attribute
230
- - drop_trigger
231
- - encrypt_column
232
- - include_concern
233
- - require_nested
234
- - signal
235
- - supports
236
- - supports_not
237
- - virtual_aggregate
238
- - virtual_attribute
239
- - virtual_belongs_to
240
- - virtual_belongs_to
241
- - virtual_column
242
- - virtual_delegate
243
- - virtual_has_many
244
- - virtual_has_one
245
- - virtual_total
246
- # Rake
247
- - desc
248
- - task
249
- Style/NumericLiterals:
250
- AutoCorrect: false
251
- Style/NumericPredicate:
252
- Enabled: false
253
- Style/PerlBackrefs:
254
- Enabled: false
255
- Style/ParallelAssignment:
256
- Enabled: false
257
- Style/RedundantReturn:
258
- AllowMultipleReturnValues: true
259
- Style/RegexpLiteral:
260
- Enabled: false
261
- Style/RescueModifier:
262
- AutoCorrect: false
263
- Style/RescueStandardError:
264
- EnforcedStyle: implicit
265
- Style/SignalException:
266
- EnforcedStyle: only_raise
267
- Style/SingleLineBlockParams:
268
- Enabled: false
269
- Style/SingleLineMethods:
270
- AllowIfMethodIsEmpty: false
271
- Style/SpecialGlobalVars:
272
- AutoCorrect: false
273
- Style/StringLiterals:
274
- Enabled: false
275
- Style/StringLiteralsInInterpolation:
276
- Enabled: false
277
- Style/SymbolArray:
278
- Enabled: false
279
- Style/TrailingCommaInArrayLiteral:
280
- Enabled: false
281
- Style/TrailingCommaInHashLiteral:
282
- Enabled: false
283
- Style/TrailingUnderscoreVariable:
284
- Enabled: false
285
- Style/TrivialAccessors:
286
- AllowPredicates: true
287
- Style/WhileUntilModifier:
288
- Enabled: false
289
- Style/WordArray:
290
- Enabled: false
1
+ inherit_from:
2
+ - styles/base.yml
@@ -0,0 +1,4 @@
1
+ inherit_from:
2
+ - ".rubocop_base.yml"
3
+ - ".rubocop_cc_base.yml"
4
+ - ".rubocop_local.yml"
@@ -1,47 +1,2 @@
1
- #
2
- # THIS FILE IS AUTOGENERATED. DO NOT MODIFY MANUALLY.
3
- # For changes, please modify scripts/process_rubocop_yamls.rb
4
- #
5
- ---
6
- AllCops:
7
- TargetRubyVersion: 2.4
8
- Bundler:
9
- Enabled: true
10
- Gemspec:
11
- Enabled: true
12
- Layout:
13
- Enabled: false
14
- Lint:
15
- Enabled: true
16
- Naming:
17
- Enabled: false
18
- Performance:
19
- Enabled: true
20
- Rails:
21
- Enabled: false
22
- Security:
23
- Enabled: true
24
- Style:
25
- Enabled: false
26
- Metrics/AbcSize:
27
- Enabled: false
28
- Metrics/BlockLength:
29
- Enabled: false
30
- Metrics/BlockNesting:
31
- Enabled: true
32
- Metrics/ClassLength:
33
- Enabled: false
34
- Metrics/CyclomaticComplexity:
35
- Enabled: true
36
- Max: 11
37
- Metrics/LineLength:
38
- Enabled: false
39
- Metrics/MethodLength:
40
- Enabled: false
41
- Metrics/ModuleLength:
42
- Enabled: false
43
- Metrics/ParameterLists:
44
- Enabled: true
45
- Metrics/PerceivedComplexity:
46
- Enabled: false
47
-
1
+ inherit_from:
2
+ - styles/cc_base.yml
@@ -0,0 +1 @@
1
+
@@ -2,5 +2,6 @@
2
2
  language: ruby
3
3
  cache: bundler
4
4
  rvm:
5
- - 2.5.7
6
- before_install: gem install bundler -v 2.1.4
5
+ - 2.5.8
6
+ - 2.6.6
7
+ before_install: gem install bundler
data/Gemfile CHANGED
@@ -2,6 +2,3 @@ source "https://rubygems.org"
2
2
 
3
3
  # Specify your gem's dependencies in manageiq-style.gemspec
4
4
  gemspec
5
-
6
- gem "rake", "~> 12.0"
7
- gem "rspec", "~> 3.0"
data/README.md CHANGED
@@ -1,8 +1,6 @@
1
- # Manageiq::Style
1
+ # manageiq-style
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/manageiq/style`. To experiment with that code, run `bin/console` for an interactive prompt.
4
-
5
- TODO: Delete this and the text above, and describe your gem
3
+ Style and linting configuration for ManageIQ projects.
6
4
 
7
5
  ## Installation
8
6
 
@@ -22,7 +20,7 @@ Or install it yourself as:
22
20
 
23
21
  ## Usage
24
22
 
25
- TODO: Write usage instructions here
23
+ In the root of the repo that needs configuring, run `bundle exec manageiq-style -i` to install or update the rubocop and codeclimate configuration files.
26
24
 
27
25
  ## Development
28
26
 
@@ -32,9 +30,8 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
32
30
 
33
31
  ## Contributing
34
32
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/manageiq-style. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/manageiq-style/blob/master/CODE_OF_CONDUCT.md).
36
-
33
+ Bug reports and pull requests are welcome on GitHub at https://github.com/ManageIQ/manageiq-style. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/ManageIQ/.github/blob/master/CODE_OF_CONDUCT.md).
37
34
 
38
35
  ## Code of Conduct
39
36
 
40
- Everyone interacting in the Manageiq::Style project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/manageiq-style/blob/master/CODE_OF_CONDUCT.md).
37
+ Everyone interacting in the manageiq-style project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/ManageIQ/.github/blob/master/CODE_OF_CONDUCT.md).
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  require "bundler/setup"
4
- require "manageiq/style"
4
+ require "manageiq-style"
5
5
 
6
6
  # You can add fixtures and/or initialization code here to make experimenting
7
7
  # with your gem easier. You can also use a different console, if you like.
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ $LOAD_PATH << File.expand_path("../lib", __dir__)
4
+
5
+ require 'bundler/setup'
6
+ require 'manageiq-style'
7
+
8
+ ManageIQ::Style::CLI.run
@@ -0,0 +1 @@
1
+ require "manageiq/style"
@@ -1,6 +1,7 @@
1
1
  require "manageiq/style/version"
2
+ require "manageiq/style/cli"
2
3
 
3
- module Manageiq
4
+ module ManageIQ
4
5
  module Style
5
6
  class Error < StandardError; end
6
7
  # Your code goes here...
@@ -0,0 +1,147 @@
1
+ module ManageIQ
2
+ module Style
3
+ class CLI
4
+ def self.run
5
+ new.run
6
+ end
7
+
8
+ def initialize(options = parse_cli_options)
9
+ @opts = options
10
+ end
11
+
12
+ def parse_cli_options
13
+ require 'optimist'
14
+
15
+ Optimist.options do
16
+ usage "[OPTIONS]"
17
+ synopsis "\nThe ManageIQ community's style configuration utility."
18
+ version "v#{ManageIQ::Style::VERSION}\n"
19
+
20
+ opt :install, "Install or update the style configurations", :default => false, :required => true
21
+ end
22
+ end
23
+
24
+ def run
25
+ install if @opts[:install]
26
+ end
27
+
28
+ def install
29
+ require 'yaml'
30
+ require 'more_core_extensions/all'
31
+
32
+ check_for_codeclimate_channel
33
+ update_rubocop_yml
34
+ write_rubocop_cc_yml
35
+ ensure_rubocop_local_yml_exists
36
+ update_codeclimate_yml
37
+ update_generator
38
+ end
39
+
40
+ private
41
+
42
+ def check_for_codeclimate_channel
43
+ begin
44
+ require 'open-uri'
45
+ URI::HTTPS.build(
46
+ :host => "raw.githubusercontent.com",
47
+ :path => File.join("/codeclimate", "codeclimate-rubocop", "channel", cc_rubocop_channel, "Gemfile")
48
+ ).open
49
+ rescue OpenURI::HTTPError
50
+ puts "RuboCop version #{rubocop_version.version} is not supported by CodeClimate."
51
+ exit 1
52
+ end
53
+ end
54
+
55
+ def update_rubocop_yml(file = ".rubocop.yml")
56
+ data = begin
57
+ YAML.load_file(file)
58
+ rescue Errno::ENOENT
59
+ {}
60
+ end
61
+
62
+ data.store_path("inherit_gem", "manageiq-style", ".rubocop_base.yml")
63
+ data["inherit_from"] = [".rubocop_local.yml"]
64
+
65
+ File.write(".rubocop.yml", data.to_yaml.sub("---\n", ""))
66
+ end
67
+
68
+ def write_rubocop_cc_yml(file = ".rubocop_cc.yml")
69
+ data = {
70
+ "inherit_from" => [
71
+ ".rubocop_base.yml",
72
+ ".rubocop_cc_base.yml",
73
+ ".rubocop_local.yml"
74
+ ]
75
+ }
76
+
77
+ File.write(file, data.to_yaml.sub("---\n", ""))
78
+ end
79
+
80
+ def ensure_rubocop_local_yml_exists(file = ".rubocop_local.yml")
81
+ require 'fileutils'
82
+ FileUtils.touch(file)
83
+ end
84
+
85
+ def update_codeclimate_yml(file = ".codeclimate.yml")
86
+ data = begin
87
+ YAML.load_file(file)
88
+ rescue Errno::ENOENT
89
+ {}
90
+ end
91
+
92
+ data["prepare"] = {
93
+ "fetch" => [
94
+ {"url" => "https://raw.githubusercontent.com/ManageIQ/manageiq-style/master/.rubocop_base.yml", "path" => ".rubocop_base.yml"},
95
+ {"url" => "https://raw.githubusercontent.com/ManageIQ/manageiq-style/master/.rubocop_cc_base.yml", "path" => ".rubocop_cc_base.yml"},
96
+ {"url" => "https://raw.githubusercontent.com/ManageIQ/manageiq-style/master/styles/base.yml", "path" => "styles/base.yml"},
97
+ {"url" => "https://raw.githubusercontent.com/ManageIQ/manageiq-style/master/styles/cc_base.yml", "path" => "styles/cc_base.yml"},
98
+ ]
99
+ }
100
+
101
+ data.delete_path("engines", "rubocop")
102
+
103
+ data["plugins"] ||= {}
104
+ data["plugins"]["rubocop"] = {
105
+ "enabled" => true,
106
+ "config" => ".rubocop_cc.yml",
107
+ "channel" => cc_rubocop_channel,
108
+ }
109
+ data["engines"]&.each do |engine, config|
110
+ data["plugins"][engine] = config
111
+ end
112
+
113
+ data.delete("engines") # moved to plugins
114
+ data.delete("ratings") # deprecated
115
+
116
+ exclude_paths = data.delete("exclude_paths") # renamed
117
+ data["exclude_patterns"] = exclude_paths if exclude_paths
118
+
119
+ data["version"] ||= "2"
120
+
121
+ File.write(".codeclimate.yml", data.to_yaml.sub("---\n", ""))
122
+ end
123
+
124
+ def update_generator
125
+ plugin_dir = "lib/generators/manageiq/plugin/templates"
126
+
127
+ return unless File.directory?(plugin_dir)
128
+
129
+ update_rubocop_yml(File.join(plugin_dir, ".rubocop.yml"))
130
+ write_rubocop_cc_yml(File.join(plugin_dir, ".rubocop_cc.yml"))
131
+ ensure_rubocop_local_yml_exists(File.join(plugin_dir, ".rubocop_local.yml"))
132
+ update_codeclimate_yml(File.join(plugin_dir, ".codeclimate.yml"))
133
+ end
134
+
135
+ def cc_rubocop_channel
136
+ @cc_rubocop_channel ||= "rubocop-#{rubocop_version.segments[0]}-#{rubocop_version.segments[1]}"
137
+ end
138
+
139
+ def rubocop_version
140
+ @rubocop_version ||= begin
141
+ require 'rubocop'
142
+ Gem::Version.new(RuboCop::Version.version)
143
+ end
144
+ end
145
+ end
146
+ end
147
+ end
@@ -1,5 +1,5 @@
1
- module Manageiq
1
+ module ManageIQ
2
2
  module Style
3
- VERSION = "1.0.0"
3
+ VERSION = "1.1.3"
4
4
  end
5
5
  end
@@ -2,15 +2,14 @@ require_relative 'lib/manageiq/style/version'
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "manageiq-style"
5
- spec.version = Manageiq::Style::VERSION
6
- spec.authors = ["Brandon Dunne"]
7
- spec.email = ["brandondunne@hotmail.com"]
5
+ spec.version = ManageIQ::Style::VERSION
6
+ spec.authors = ["ManageIQ Authors"]
8
7
 
9
8
  spec.summary = "Style and linting configuration for ManageIQ projects."
10
- spec.description = "Style and linting configuration for ManageIQ projects."
9
+ spec.description = spec.summary
11
10
  spec.homepage = "https://github.com/ManageIQ/manageiq-style"
12
11
  spec.license = "MIT"
13
- spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
12
+ spec.required_ruby_version = Gem::Requirement.new(">= 2.0.0")
14
13
 
15
14
  spec.metadata["homepage_uri"] = spec.homepage
16
15
  spec.metadata["source_code_uri"] = spec.homepage
@@ -24,8 +23,12 @@ Gem::Specification.new do |spec|
24
23
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
25
24
  spec.require_paths = ["lib"]
26
25
 
27
- spec.add_runtime_dependency "haml_lint", "~> 0.35.0"
26
+ spec.add_runtime_dependency "more_core_extensions"
27
+ spec.add_runtime_dependency "optimist"
28
28
  spec.add_runtime_dependency "rubocop", "~> 0.82.0"
29
29
  spec.add_runtime_dependency "rubocop-performance"
30
30
  spec.add_runtime_dependency "rubocop-rails"
31
+
32
+ spec.add_development_dependency "rake", "~> 12.0"
33
+ spec.add_development_dependency "rspec", "~> 3.0"
31
34
  end
@@ -0,0 +1,292 @@
1
+ require:
2
+ - rubocop-rails
3
+ - rubocop-performance
4
+
5
+ AllCops:
6
+ NewCops: disable
7
+ Exclude:
8
+ - spec/manageiq/**/*
9
+ - vendor/**/*
10
+ TargetRubyVersion: 2.5
11
+ Layout/HashAlignment:
12
+ EnforcedHashRocketStyle: table
13
+ EnforcedColonStyle: table
14
+ Layout/DefEndAlignment:
15
+ AutoCorrect: true
16
+ Layout/EndAlignment:
17
+ AutoCorrect: true
18
+ Layout/ExtraSpacing:
19
+ AutoCorrect: true
20
+ Layout/LineLength:
21
+ Enabled: false
22
+ Layout/SpaceAroundMethodCallOperator:
23
+ Enabled: true
24
+ Layout/SpaceBeforeFirstArg:
25
+ Enabled: false
26
+ Layout/SpaceInsideHashLiteralBraces:
27
+ EnforcedStyle: no_space
28
+ Lint/RaiseException:
29
+ Enabled: true
30
+ Lint/StructNewOverride:
31
+ Enabled: true
32
+ Metrics/AbcSize:
33
+ Enabled: false
34
+ Metrics/BlockLength:
35
+ Enabled: false
36
+ Metrics/BlockNesting:
37
+ Enabled: false
38
+ Metrics/ClassLength:
39
+ Enabled: false
40
+ Metrics/CyclomaticComplexity:
41
+ Enabled: false
42
+ Metrics/MethodLength:
43
+ Enabled: false
44
+ Metrics/ModuleLength:
45
+ Enabled: false
46
+ Metrics/ParameterLists:
47
+ Enabled: false
48
+ Metrics/PerceivedComplexity:
49
+ Enabled: false
50
+ Naming/MethodParameterName:
51
+ AllowedNames:
52
+ - vm
53
+ - dc
54
+ Naming/RescuedExceptionsVariableName:
55
+ Enabled: false
56
+ Performance/Casecmp:
57
+ Enabled: false
58
+ Rails:
59
+ Enabled: true
60
+ Rails/FindEach:
61
+ Enabled: false
62
+ Rails/HttpStatus:
63
+ Enabled: true
64
+ EnforcedStyle: numeric
65
+ Rails/ReadWriteAttribute:
66
+ AutoCorrect: false
67
+ Style/AccessModifierDeclarations:
68
+ Enabled: false
69
+ Style/ClassAndModuleChildren:
70
+ Enabled: false
71
+ Style/ClassCheck:
72
+ EnforcedStyle: kind_of?
73
+ Style/CollectionMethods:
74
+ PreferredMethods:
75
+ find: detect
76
+ find_all: select
77
+ map: collect
78
+ reduce: inject
79
+ Style/Documentation:
80
+ Enabled: false
81
+ Style/DoubleNegation:
82
+ Enabled: false
83
+ Style/EmptyMethod:
84
+ Enabled: false
85
+ Style/Encoding:
86
+ Enabled: false
87
+ Style/ExponentialNotation:
88
+ Enabled: true
89
+ Style/FormatString:
90
+ EnforcedStyle: percent
91
+ Style/FormatStringToken:
92
+ EnforcedStyle: template
93
+ Style/FrozenStringLiteralComment:
94
+ Enabled: false
95
+ Style/GuardClause:
96
+ Enabled: false
97
+ Style/HashEachMethods:
98
+ Enabled: true
99
+ Style/HashSyntax:
100
+ EnforcedStyle: hash_rockets
101
+ Exclude:
102
+ - db/schema.rb
103
+ Style/HashTransformKeys:
104
+ Enabled: true
105
+ Style/HashTransformValues:
106
+ Enabled: true
107
+ Style/IfUnlessModifier:
108
+ Enabled: false
109
+ Style/MethodCallWithArgsParentheses:
110
+ Exclude:
111
+ - Gemfile
112
+ - config/routes.rb
113
+ - lib/generators/**/*
114
+ - lib/resource_feeder/**/*
115
+ - lib/tasks/**/*
116
+ - spec/**/*
117
+ Enabled: true
118
+ IgnoredMethods:
119
+ # Ruby
120
+ - add_dependency
121
+ - add_development_dependency
122
+ - add_runtime_dependency
123
+ - alias_method
124
+ - attr_accessor
125
+ - attr_reader
126
+ - attr_writer
127
+ - exit
128
+ - extend
129
+ - gem
130
+ - include
131
+ - load
132
+ - module_function
133
+ - pp
134
+ - prepend
135
+ - print
136
+ - private
137
+ - private_class_method
138
+ - private_constant
139
+ - puts
140
+ - raise
141
+ - require
142
+ - sleep
143
+ - throw
144
+ - warn
145
+ - yield
146
+ # Rails
147
+ - accepts_nested_attributes_for
148
+ - add_column
149
+ - add_index
150
+ - add_reference
151
+ - after_action
152
+ - after_commit
153
+ - after_create
154
+ - after_create_commit
155
+ - after_destroy
156
+ - after_destroy
157
+ - after_destroy_commit
158
+ - after_initialize
159
+ - after_save
160
+ - after_save
161
+ - after_update
162
+ - after_update_commit
163
+ - alias_attribute
164
+ - around_destroy
165
+ - autoload
166
+ - before_action
167
+ - before_create
168
+ - before_destroy
169
+ - before_save
170
+ - before_update
171
+ - before_validation
172
+ - belongs_to
173
+ - bigint
174
+ - boolean
175
+ - cattr_accessor
176
+ - cattr_reader
177
+ - cattr_writer
178
+ - change_column
179
+ - change_column_comment
180
+ - change_column_null
181
+ - change_table_comment
182
+ - class_attribute
183
+ - create_table
184
+ - datetime
185
+ - decimal
186
+ - delegate
187
+ - drop_table
188
+ - float
189
+ - has_and_belongs_to_many
190
+ - has_many
191
+ - has_one
192
+ - head
193
+ - identified_by
194
+ - index
195
+ - integer
196
+ - jsonb
197
+ - mattr_accessor
198
+ - references
199
+ - remove_column
200
+ - remove_index
201
+ - remove_reference
202
+ - rename_column
203
+ - render
204
+ - require_dependency
205
+ - require_relative
206
+ - respond_to
207
+ - scope
208
+ - serialize
209
+ - skip_before_action
210
+ - string
211
+ - text
212
+ - uuid
213
+ - validate
214
+ - validates
215
+ # ActsAsTree Gem
216
+ - acts_as_tree
217
+ # Ancestry Gem
218
+ - has_ancestry
219
+ # DefaultValue Gem
220
+ - default_value_for
221
+ - default_values
222
+ # Optimist Gem
223
+ - banner
224
+ - die
225
+ - opt
226
+ # MIQ
227
+ - add_trigger
228
+ - alias_with_relationship_type
229
+ - api_relay_method
230
+ - attr_accessor_that_yamls
231
+ - deprecate_attribute
232
+ - drop_trigger
233
+ - encrypt_column
234
+ - include_concern
235
+ - require_nested
236
+ - signal
237
+ - supports
238
+ - supports_not
239
+ - virtual_aggregate
240
+ - virtual_attribute
241
+ - virtual_belongs_to
242
+ - virtual_belongs_to
243
+ - virtual_column
244
+ - virtual_delegate
245
+ - virtual_has_many
246
+ - virtual_has_one
247
+ - virtual_total
248
+ # Rake
249
+ - desc
250
+ - task
251
+ Style/NumericLiterals:
252
+ AutoCorrect: false
253
+ Style/NumericPredicate:
254
+ Enabled: false
255
+ Style/PerlBackrefs:
256
+ Enabled: false
257
+ Style/ParallelAssignment:
258
+ Enabled: false
259
+ Style/RedundantReturn:
260
+ AllowMultipleReturnValues: true
261
+ Style/RegexpLiteral:
262
+ Enabled: false
263
+ Style/RescueModifier:
264
+ AutoCorrect: false
265
+ Style/RescueStandardError:
266
+ EnforcedStyle: implicit
267
+ Style/SignalException:
268
+ EnforcedStyle: only_raise
269
+ Style/SingleLineBlockParams:
270
+ Enabled: false
271
+ Style/SingleLineMethods:
272
+ AllowIfMethodIsEmpty: false
273
+ Style/SpecialGlobalVars:
274
+ AutoCorrect: false
275
+ Style/StringLiterals:
276
+ Enabled: false
277
+ Style/StringLiteralsInInterpolation:
278
+ Enabled: false
279
+ Style/SymbolArray:
280
+ Enabled: false
281
+ Style/TrailingCommaInArrayLiteral:
282
+ Enabled: false
283
+ Style/TrailingCommaInHashLiteral:
284
+ Enabled: false
285
+ Style/TrailingUnderscoreVariable:
286
+ Enabled: false
287
+ Style/TrivialAccessors:
288
+ AllowPredicates: true
289
+ Style/WhileUntilModifier:
290
+ Enabled: false
291
+ Style/WordArray:
292
+ Enabled: false
@@ -0,0 +1,47 @@
1
+ #
2
+ # THIS FILE IS AUTOGENERATED. DO NOT MODIFY MANUALLY.
3
+ # For changes, please modify scripts/process_rubocop_yamls.rb
4
+ #
5
+ ---
6
+ AllCops:
7
+ TargetRubyVersion: 2.4
8
+ Bundler:
9
+ Enabled: true
10
+ Gemspec:
11
+ Enabled: true
12
+ Layout:
13
+ Enabled: false
14
+ Lint:
15
+ Enabled: true
16
+ Naming:
17
+ Enabled: false
18
+ Performance:
19
+ Enabled: true
20
+ Rails:
21
+ Enabled: false
22
+ Security:
23
+ Enabled: true
24
+ Style:
25
+ Enabled: false
26
+ Metrics/AbcSize:
27
+ Enabled: false
28
+ Metrics/BlockLength:
29
+ Enabled: false
30
+ Metrics/BlockNesting:
31
+ Enabled: true
32
+ Metrics/ClassLength:
33
+ Enabled: false
34
+ Metrics/CyclomaticComplexity:
35
+ Enabled: true
36
+ Max: 11
37
+ Metrics/LineLength:
38
+ Enabled: false
39
+ Metrics/MethodLength:
40
+ Enabled: false
41
+ Metrics/ModuleLength:
42
+ Enabled: false
43
+ Metrics/ParameterLists:
44
+ Enabled: true
45
+ Metrics/PerceivedComplexity:
46
+ Enabled: false
47
+
metadata CHANGED
@@ -1,29 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: manageiq-style
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.3
5
5
  platform: ruby
6
6
  authors:
7
- - Brandon Dunne
7
+ - ManageIQ Authors
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-05-19 00:00:00.000000000 Z
11
+ date: 2021-01-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: haml_lint
14
+ name: more_core_extensions
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 0.35.0
19
+ version: '0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: optimist
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
25
39
  - !ruby/object:Gem::Version
26
- version: 0.35.0
40
+ version: '0'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: rubocop
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -66,30 +80,65 @@ dependencies:
66
80
  - - ">="
67
81
  - !ruby/object:Gem::Version
68
82
  version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rake
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '12.0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '12.0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: rspec
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '3.0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '3.0'
69
111
  description: Style and linting configuration for ManageIQ projects.
70
- email:
71
- - brandondunne@hotmail.com
72
- executables: []
112
+ email:
113
+ executables:
114
+ - manageiq-style
73
115
  extensions: []
74
116
  extra_rdoc_files: []
75
117
  files:
118
+ - ".codeclimate.yml"
76
119
  - ".gitignore"
77
120
  - ".haml-lint.yml"
78
121
  - ".rspec"
79
122
  - ".rubocop.yml"
80
123
  - ".rubocop_base.yml"
124
+ - ".rubocop_cc.yml"
81
125
  - ".rubocop_cc_base.yml"
126
+ - ".rubocop_local.yml"
82
127
  - ".travis.yml"
83
- - CODE_OF_CONDUCT.md
84
128
  - Gemfile
85
129
  - LICENSE.txt
86
130
  - README.md
87
131
  - Rakefile
88
132
  - bin/console
89
133
  - bin/setup
134
+ - exe/manageiq-style
135
+ - lib/manageiq-style.rb
90
136
  - lib/manageiq/style.rb
137
+ - lib/manageiq/style/cli.rb
91
138
  - lib/manageiq/style/version.rb
92
139
  - manageiq-style.gemspec
140
+ - styles/base.yml
141
+ - styles/cc_base.yml
93
142
  homepage: https://github.com/ManageIQ/manageiq-style
94
143
  licenses:
95
144
  - MIT
@@ -104,7 +153,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
104
153
  requirements:
105
154
  - - ">="
106
155
  - !ruby/object:Gem::Version
107
- version: 2.3.0
156
+ version: 2.0.0
108
157
  required_rubygems_version: !ruby/object:Gem::Requirement
109
158
  requirements:
110
159
  - - ">="
@@ -1,74 +0,0 @@
1
- # Contributor Covenant Code of Conduct
2
-
3
- ## Our Pledge
4
-
5
- In the interest of fostering an open and welcoming environment, we as
6
- contributors and maintainers pledge to making participation in our project and
7
- our community a harassment-free experience for everyone, regardless of age, body
8
- size, disability, ethnicity, gender identity and expression, level of experience,
9
- nationality, personal appearance, race, religion, or sexual identity and
10
- orientation.
11
-
12
- ## Our Standards
13
-
14
- Examples of behavior that contributes to creating a positive environment
15
- include:
16
-
17
- * Using welcoming and inclusive language
18
- * Being respectful of differing viewpoints and experiences
19
- * Gracefully accepting constructive criticism
20
- * Focusing on what is best for the community
21
- * Showing empathy towards other community members
22
-
23
- Examples of unacceptable behavior by participants include:
24
-
25
- * The use of sexualized language or imagery and unwelcome sexual attention or
26
- advances
27
- * Trolling, insulting/derogatory comments, and personal or political attacks
28
- * Public or private harassment
29
- * Publishing others' private information, such as a physical or electronic
30
- address, without explicit permission
31
- * Other conduct which could reasonably be considered inappropriate in a
32
- professional setting
33
-
34
- ## Our Responsibilities
35
-
36
- Project maintainers are responsible for clarifying the standards of acceptable
37
- behavior and are expected to take appropriate and fair corrective action in
38
- response to any instances of unacceptable behavior.
39
-
40
- Project maintainers have the right and responsibility to remove, edit, or
41
- reject comments, commits, code, wiki edits, issues, and other contributions
42
- that are not aligned to this Code of Conduct, or to ban temporarily or
43
- permanently any contributor for other behaviors that they deem inappropriate,
44
- threatening, offensive, or harmful.
45
-
46
- ## Scope
47
-
48
- This Code of Conduct applies both within project spaces and in public spaces
49
- when an individual is representing the project or its community. Examples of
50
- representing a project or community include using an official project e-mail
51
- address, posting via an official social media account, or acting as an appointed
52
- representative at an online or offline event. Representation of a project may be
53
- further defined and clarified by project maintainers.
54
-
55
- ## Enforcement
56
-
57
- Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
- reported by contacting the project team at brandondunne@hotmail.com. All
59
- complaints will be reviewed and investigated and will result in a response that
60
- is deemed necessary and appropriate to the circumstances. The project team is
61
- obligated to maintain confidentiality with regard to the reporter of an incident.
62
- Further details of specific enforcement policies may be posted separately.
63
-
64
- Project maintainers who do not follow or enforce the Code of Conduct in good
65
- faith may face temporary or permanent repercussions as determined by other
66
- members of the project's leadership.
67
-
68
- ## Attribution
69
-
70
- This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
- available at [https://contributor-covenant.org/version/1/4][version]
72
-
73
- [homepage]: https://contributor-covenant.org
74
- [version]: https://contributor-covenant.org/version/1/4/