scenic 1.7.0 → 1.8.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.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yml +23 -3
  3. data/CHANGELOG.md +9 -0
  4. data/CONTRIBUTING.md +1 -0
  5. data/Gemfile +3 -3
  6. data/README.md +18 -12
  7. data/Rakefile +1 -1
  8. data/bin/standardrb +27 -0
  9. data/lib/generators/scenic/model/model_generator.rb +7 -16
  10. data/lib/generators/scenic/model/templates/model.erb +4 -0
  11. data/lib/generators/scenic/view/templates/db/migrate/update_view.erb +1 -1
  12. data/lib/generators/scenic/view/view_generator.rb +5 -5
  13. data/lib/scenic/adapters/postgres/indexes.rb +1 -1
  14. data/lib/scenic/adapters/postgres/refresh_dependencies.rb +3 -3
  15. data/lib/scenic/adapters/postgres/views.rb +5 -5
  16. data/lib/scenic/adapters/postgres.rb +28 -3
  17. data/lib/scenic/definition.rb +1 -1
  18. data/lib/scenic/statements.rb +5 -5
  19. data/lib/scenic/version.rb +1 -1
  20. data/scenic.gemspec +10 -10
  21. data/spec/dummy/Rakefile +5 -5
  22. data/spec/dummy/bin/bundle +2 -2
  23. data/spec/dummy/bin/rails +3 -3
  24. data/spec/dummy/bin/rake +2 -2
  25. data/spec/dummy/config.ru +1 -1
  26. data/spec/dummy/db/migrate/20220112154220_add_pg_stat_statements_extension.rb +1 -1
  27. data/spec/dummy/db/schema.rb +0 -2
  28. data/spec/generators/scenic/model/model_generator_spec.rb +9 -1
  29. data/spec/generators/scenic/view/view_generator_spec.rb +2 -2
  30. data/spec/integration/revert_spec.rb +1 -1
  31. data/spec/scenic/adapters/postgres/connection_spec.rb +1 -1
  32. data/spec/scenic/adapters/postgres/refresh_dependencies_spec.rb +9 -9
  33. data/spec/scenic/adapters/postgres_spec.rb +52 -6
  34. data/spec/scenic/command_recorder/statement_arguments_spec.rb +4 -4
  35. data/spec/scenic/command_recorder_spec.rb +12 -12
  36. data/spec/scenic/schema_dumper_spec.rb +6 -6
  37. data/spec/scenic/statements_spec.rb +4 -4
  38. data/spec/support/generator_spec_setup.rb +2 -2
  39. data/spec/support/view_definition_helpers.rb +1 -1
  40. metadata +19 -40
  41. data/.hound.yml +0 -2
  42. data/.rubocop.yml +0 -129
@@ -9,7 +9,7 @@ module Scenic
9
9
  base_response = double("response from base connection")
10
10
  base_connection = double(
11
11
  "Connection",
12
- supports_materialized_views?: base_response,
12
+ supports_materialized_views?: base_response
13
13
  )
14
14
 
15
15
  connection = Postgres::Connection.new(base_connection)
@@ -9,27 +9,27 @@ module Scenic
9
9
  before do
10
10
  adapter.create_materialized_view(
11
11
  "first",
12
- "SELECT text 'hi' AS greeting",
12
+ "SELECT text 'hi' AS greeting"
13
13
  )
14
14
  adapter.create_materialized_view(
15
15
  "second",
16
- "SELECT * FROM first",
16
+ "SELECT * FROM first"
17
17
  )
18
18
  adapter.create_materialized_view(
19
19
  "third",
20
- "SELECT * FROM first UNION SELECT * FROM second",
20
+ "SELECT * FROM first UNION SELECT * FROM second"
21
21
  )
22
22
  adapter.create_materialized_view(
23
23
  "fourth_1",
24
- "SELECT * FROM third",
24
+ "SELECT * FROM third"
25
25
  )
26
26
  adapter.create_materialized_view(
27
27
  "x_fourth",
28
- "SELECT * FROM fourth_1",
28
+ "SELECT * FROM fourth_1"
29
29
  )
30
30
  adapter.create_materialized_view(
31
31
  "fourth",
32
- "SELECT * FROM fourth_1 UNION SELECT * FROM x_fourth",
32
+ "SELECT * FROM fourth_1 UNION SELECT * FROM x_fourth"
33
33
  )
34
34
 
35
35
  expect(adapter).to receive(:refresh_materialized_view)
@@ -49,7 +49,7 @@ module Scenic
49
49
  :fourth,
50
50
  adapter,
51
51
  ActiveRecord::Base.connection,
52
- concurrently: true,
52
+ concurrently: true
53
53
  )
54
54
  end
55
55
 
@@ -58,7 +58,7 @@ module Scenic
58
58
  "public.fourth",
59
59
  adapter,
60
60
  ActiveRecord::Base.connection,
61
- concurrently: true,
61
+ concurrently: true
62
62
  )
63
63
  end
64
64
  end
@@ -69,7 +69,7 @@ module Scenic
69
69
 
70
70
  adapter.create_materialized_view(
71
71
  "first",
72
- "SELECT text 'hi' AS greeting",
72
+ "SELECT text 'hi' AS greeting"
73
73
  )
74
74
 
75
75
  expect {
@@ -19,7 +19,7 @@ module Scenic
19
19
 
20
20
  adapter.create_materialized_view(
21
21
  "greetings",
22
- "SELECT text 'hi' AS greeting",
22
+ "SELECT text 'hi' AS greeting"
23
23
  )
24
24
 
25
25
  view = adapter.views.first
@@ -33,7 +33,7 @@ module Scenic
33
33
  adapter.create_materialized_view(
34
34
  "greetings",
35
35
  "SELECT text 'hi' AS greeting; \n",
36
- no_data: true,
36
+ no_data: true
37
37
  )
38
38
 
39
39
  view = adapter.views.first
@@ -85,7 +85,7 @@ module Scenic
85
85
 
86
86
  adapter.create_materialized_view(
87
87
  "greetings",
88
- "SELECT text 'hi' AS greeting",
88
+ "SELECT text 'hi' AS greeting"
89
89
  )
90
90
  adapter.drop_materialized_view("greetings")
91
91
 
@@ -125,7 +125,7 @@ module Scenic
125
125
  adapter.refresh_materialized_view(
126
126
  :tests,
127
127
  cascade: true,
128
- concurrently: true,
128
+ concurrently: true
129
129
  )
130
130
  end
131
131
 
@@ -179,7 +179,7 @@ module Scenic
179
179
  "parents",
180
180
  "children",
181
181
  "people",
182
- "people_with_names",
182
+ "people_with_names"
183
183
  ]
184
184
  end
185
185
 
@@ -199,11 +199,57 @@ module Scenic
199
199
 
200
200
  expect(adapter.views.map(&:name)).to eq [
201
201
  "parents",
202
- "scenic.parents",
202
+ "scenic.parents"
203
203
  ]
204
204
  end
205
205
  end
206
206
  end
207
+
208
+ describe "#populated?" do
209
+ it "returns false if a materialized view is not populated" do
210
+ adapter = Postgres.new
211
+
212
+ ActiveRecord::Base.connection.execute <<-SQL
213
+ CREATE MATERIALIZED VIEW greetings AS
214
+ SELECT text 'hi' AS greeting
215
+ WITH NO DATA
216
+ SQL
217
+
218
+ expect(adapter.populated?("greetings")).to be false
219
+ end
220
+
221
+ it "returns true if a materialized view is populated" do
222
+ adapter = Postgres.new
223
+
224
+ ActiveRecord::Base.connection.execute <<-SQL
225
+ CREATE MATERIALIZED VIEW greetings AS
226
+ SELECT text 'hi' AS greeting
227
+ SQL
228
+
229
+ expect(adapter.populated?("greetings")).to be true
230
+ end
231
+
232
+ it "strips out the schema from table_name" do
233
+ adapter = Postgres.new
234
+
235
+ ActiveRecord::Base.connection.execute <<-SQL
236
+ CREATE MATERIALIZED VIEW greetings AS
237
+ SELECT text 'hi' AS greeting
238
+ WITH NO DATA
239
+ SQL
240
+
241
+ expect(adapter.populated?("public.greetings")).to be false
242
+ end
243
+
244
+ it "raises an exception if the version of PostgreSQL is too old" do
245
+ connection = double("Connection", supports_materialized_views?: false)
246
+ connectable = double("Connectable", connection: connection)
247
+ adapter = Postgres.new(connectable)
248
+ err = Scenic::Adapters::Postgres::MaterializedViewsNotSupportedError
249
+
250
+ expect { adapter.populated?("greetings") }.to raise_error err
251
+ end
252
+ end
207
253
  end
208
254
  end
209
255
  end
@@ -4,7 +4,7 @@ module Scenic::CommandRecorder
4
4
  describe StatementArguments do
5
5
  describe "#view" do
6
6
  it "is the view name" do
7
- raw_args = [:spaceships, { foo: :bar }]
7
+ raw_args = [:spaceships, {foo: :bar}]
8
8
  args = StatementArguments.new(raw_args)
9
9
 
10
10
  expect(args.view).to eq :spaceships
@@ -13,14 +13,14 @@ module Scenic::CommandRecorder
13
13
 
14
14
  describe "#revert_to_version" do
15
15
  it "is the revert_to_version from the keyword arguments" do
16
- raw_args = [:spaceships, { revert_to_version: 42 }]
16
+ raw_args = [:spaceships, {revert_to_version: 42}]
17
17
  args = StatementArguments.new(raw_args)
18
18
 
19
19
  expect(args.revert_to_version).to eq 42
20
20
  end
21
21
 
22
22
  it "is nil if the revert_to_version was not supplied" do
23
- raw_args = [:spaceships, { foo: :bar }]
23
+ raw_args = [:spaceships, {foo: :bar}]
24
24
  args = StatementArguments.new(raw_args)
25
25
 
26
26
  expect(args.revert_to_version).to be nil
@@ -29,7 +29,7 @@ module Scenic::CommandRecorder
29
29
 
30
30
  describe "#invert_version" do
31
31
  it "returns object with version set to revert_to_version" do
32
- raw_args = [:meatballs, { version: 42, revert_to_version: 15 }]
32
+ raw_args = [:meatballs, {version: 42, revert_to_version: 15}]
33
33
 
34
34
  inverted_args = StatementArguments.new(raw_args).invert_version
35
35
 
@@ -24,7 +24,7 @@ describe Scenic::CommandRecorder do
24
24
  recorder.revert { recorder.create_view :greetings, materialized: true }
25
25
 
26
26
  expect(recorder.commands).to eq [
27
- [:drop_view, [:greetings, materialized: true]],
27
+ [:drop_view, [:greetings, materialized: true]]
28
28
  ]
29
29
  end
30
30
  end
@@ -37,8 +37,8 @@ describe Scenic::CommandRecorder do
37
37
  end
38
38
 
39
39
  it "reverts to create_view with specified revert_to_version" do
40
- args = [:users, { revert_to_version: 3 }]
41
- revert_args = [:users, { version: 3 }]
40
+ args = [:users, {revert_to_version: 3}]
41
+ revert_args = [:users, {version: 3}]
42
42
 
43
43
  recorder.revert { recorder.drop_view(*args) }
44
44
 
@@ -46,7 +46,7 @@ describe Scenic::CommandRecorder do
46
46
  end
47
47
 
48
48
  it "raises when reverting without revert_to_version set" do
49
- args = [:users, { another_argument: 1 }]
49
+ args = [:users, {another_argument: 1}]
50
50
 
51
51
  expect { recorder.revert { recorder.drop_view(*args) } }
52
52
  .to raise_error(ActiveRecord::IrreversibleMigration)
@@ -55,7 +55,7 @@ describe Scenic::CommandRecorder do
55
55
 
56
56
  describe "#update_view" do
57
57
  it "records the updated view" do
58
- args = [:users, { version: 2 }]
58
+ args = [:users, {version: 2}]
59
59
 
60
60
  recorder.update_view(*args)
61
61
 
@@ -63,8 +63,8 @@ describe Scenic::CommandRecorder do
63
63
  end
64
64
 
65
65
  it "reverts to update_view with the specified revert_to_version" do
66
- args = [:users, { version: 2, revert_to_version: 1 }]
67
- revert_args = [:users, { version: 1 }]
66
+ args = [:users, {version: 2, revert_to_version: 1}]
67
+ revert_args = [:users, {version: 1}]
68
68
 
69
69
  recorder.revert { recorder.update_view(*args) }
70
70
 
@@ -72,7 +72,7 @@ describe Scenic::CommandRecorder do
72
72
  end
73
73
 
74
74
  it "raises when reverting without revert_to_version set" do
75
- args = [:users, { version: 42, another_argument: 1 }]
75
+ args = [:users, {version: 42, another_argument: 1}]
76
76
 
77
77
  expect { recorder.revert { recorder.update_view(*args) } }
78
78
  .to raise_error(ActiveRecord::IrreversibleMigration)
@@ -81,7 +81,7 @@ describe Scenic::CommandRecorder do
81
81
 
82
82
  describe "#replace_view" do
83
83
  it "records the replaced view" do
84
- args = [:users, { version: 2 }]
84
+ args = [:users, {version: 2}]
85
85
 
86
86
  recorder.replace_view(*args)
87
87
 
@@ -89,8 +89,8 @@ describe Scenic::CommandRecorder do
89
89
  end
90
90
 
91
91
  it "reverts to replace_view with the specified revert_to_version" do
92
- args = [:users, { version: 2, revert_to_version: 1 }]
93
- revert_args = [:users, { version: 1 }]
92
+ args = [:users, {version: 2, revert_to_version: 1}]
93
+ revert_args = [:users, {version: 1}]
94
94
 
95
95
  recorder.revert { recorder.replace_view(*args) }
96
96
 
@@ -98,7 +98,7 @@ describe Scenic::CommandRecorder do
98
98
  end
99
99
 
100
100
  it "raises when reverting without revert_to_version set" do
101
- args = [:users, { version: 42, another_argument: 1 }]
101
+ args = [:users, {version: 42, another_argument: 1}]
102
102
 
103
103
  expect { recorder.revert { recorder.replace_view(*args) } }
104
104
  .to raise_error(ActiveRecord::IrreversibleMigration)
@@ -21,7 +21,7 @@ describe Scenic::SchemaDumper, :db do
21
21
 
22
22
  Search.connection.drop_view :searches
23
23
 
24
- silence_stream(STDOUT) { eval(output) }
24
+ silence_stream($stdout) { eval(output) } # standard:disable Security/Eval
25
25
 
26
26
  expect(Search.first.haystack).to eq "needle"
27
27
  end
@@ -37,7 +37,7 @@ describe Scenic::SchemaDumper, :db do
37
37
  expect(output).to include "~ '\\\\d+'::text"
38
38
 
39
39
  Search.connection.drop_view :searches
40
- silence_stream(STDOUT) { eval(output) }
40
+ silence_stream($stdout) { eval(output) } # standard:disable Security/Eval
41
41
 
42
42
  expect(Search.first.haystack).to eq "needle"
43
43
  end
@@ -67,7 +67,7 @@ describe Scenic::SchemaDumper, :db do
67
67
  output = stream.string
68
68
  expect(output).to include 'create_view "scenic.searches",'
69
69
 
70
- Search.connection.drop_view :'scenic.searches'
70
+ Search.connection.drop_view :"scenic.searches"
71
71
  end
72
72
  end
73
73
 
@@ -113,7 +113,7 @@ describe Scenic::SchemaDumper, :db do
113
113
 
114
114
  Search.connection.drop_view :'"search in a haystack"'
115
115
 
116
- silence_stream(STDOUT) { eval(output) }
116
+ silence_stream($stdout) { eval(output) } # standard:disable Security/Eval
117
117
 
118
118
  expect(SearchInAHaystack.take.haystack).to eq "needle"
119
119
  end
@@ -123,7 +123,7 @@ describe Scenic::SchemaDumper, :db do
123
123
  it "dumps a create_view for a view in the database" do
124
124
  view_definition = "SELECT 'needle'::text AS haystack"
125
125
  Search.connection.execute(
126
- "CREATE SCHEMA scenic; SET search_path TO scenic, public",
126
+ "CREATE SCHEMA scenic; SET search_path TO scenic, public"
127
127
  )
128
128
  Search.connection.create_view 'scenic."search in a haystack"',
129
129
  sql_definition: view_definition
@@ -137,7 +137,7 @@ describe Scenic::SchemaDumper, :db do
137
137
 
138
138
  Search.connection.drop_view :'scenic."search in a haystack"'
139
139
 
140
- silence_stream(STDOUT) { eval(output) }
140
+ silence_stream($stdout) { eval(output) } # standard:disable Security/Eval
141
141
 
142
142
  expect(SearchInAHaystack.take.haystack).to eq "needle"
143
143
  end
@@ -70,7 +70,7 @@ module Scenic
70
70
  connection.create_view(
71
71
  :views,
72
72
  version: 1,
73
- materialized: { no_data: true },
73
+ materialized: {no_data: true}
74
74
  )
75
75
 
76
76
  expect(Scenic.database).to have_received(:create_materialized_view)
@@ -137,7 +137,7 @@ module Scenic
137
137
  connection.update_view(
138
138
  :name,
139
139
  version: 3,
140
- materialized: { no_data: true },
140
+ materialized: {no_data: true}
141
141
  )
142
142
 
143
143
  expect(Scenic.database).to have_received(:update_materialized_view)
@@ -147,7 +147,7 @@ module Scenic
147
147
  it "raises an error if not supplied a version or sql_defintion" do
148
148
  expect { connection.update_view :views }.to raise_error(
149
149
  ArgumentError,
150
- /sql_definition or version must be specified/,
150
+ /sql_definition or version must be specified/
151
151
  )
152
152
  end
153
153
 
@@ -156,7 +156,7 @@ module Scenic
156
156
  connection.update_view(
157
157
  :views,
158
158
  version: 1,
159
- sql_definition: "a defintion",
159
+ sql_definition: "a defintion"
160
160
  )
161
161
  end.to raise_error ArgumentError, /cannot both be set/
162
162
  end
@@ -1,6 +1,6 @@
1
1
  require "rspec/rails"
2
- require "ammeter/rspec/generator/example.rb"
3
- require "ammeter/rspec/generator/matchers.rb"
2
+ require "ammeter/rspec/generator/example"
3
+ require "ammeter/rspec/generator/matchers"
4
4
  require "ammeter/init"
5
5
 
6
6
  RSpec.configure do |config|
@@ -2,7 +2,7 @@ module ViewDefinitionHelpers
2
2
  def with_view_definition(name, version, schema)
3
3
  definition = Scenic::Definition.new(name, version)
4
4
  FileUtils.mkdir_p(File.dirname(definition.full_path))
5
- File.open(definition.full_path, "w") { |f| f.write(schema) }
5
+ File.write(definition.full_path, schema)
6
6
  yield
7
7
  ensure
8
8
  FileUtils.rm_f(definition.full_path)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scenic
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.0
4
+ version: 1.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Derek Prior
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2022-12-08 00:00:00.000000000 Z
12
+ date: 2024-03-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -137,6 +137,20 @@ dependencies:
137
137
  - - ">="
138
138
  - !ruby/object:Gem::Version
139
139
  version: '0'
140
+ - !ruby/object:Gem::Dependency
141
+ name: standard
142
+ requirement: !ruby/object:Gem::Requirement
143
+ requirements:
144
+ - - ">="
145
+ - !ruby/object:Gem::Version
146
+ version: '0'
147
+ type: :development
148
+ prerelease: false
149
+ version_requirements: !ruby/object:Gem::Requirement
150
+ requirements:
151
+ - - ">="
152
+ - !ruby/object:Gem::Version
153
+ version: '0'
140
154
  - !ruby/object:Gem::Dependency
141
155
  name: activerecord
142
156
  requirement: !ruby/object:Gem::Requirement
@@ -180,8 +194,6 @@ files:
180
194
  - ".devcontainer/docker-compose.yml"
181
195
  - ".github/workflows/ci.yml"
182
196
  - ".gitignore"
183
- - ".hound.yml"
184
- - ".rubocop.yml"
185
197
  - ".yardopts"
186
198
  - CHANGELOG.md
187
199
  - CODE_OF_CONDUCT.md
@@ -194,6 +206,7 @@ files:
194
206
  - bin/rake
195
207
  - bin/rspec
196
208
  - bin/setup
209
+ - bin/standardrb
197
210
  - bin/yard
198
211
  - lib/generators/scenic/generators.rb
199
212
  - lib/generators/scenic/materializable.rb
@@ -277,42 +290,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
277
290
  - !ruby/object:Gem::Version
278
291
  version: '0'
279
292
  requirements: []
280
- rubygems_version: 3.2.32
293
+ rubygems_version: 3.5.3
281
294
  signing_key:
282
295
  specification_version: 4
283
296
  summary: Support for database views in Rails migrations
284
- test_files:
285
- - spec/acceptance/user_manages_views_spec.rb
286
- - spec/acceptance_helper.rb
287
- - spec/dummy/.gitignore
288
- - spec/dummy/Rakefile
289
- - spec/dummy/app/models/application_record.rb
290
- - spec/dummy/bin/bundle
291
- - spec/dummy/bin/rails
292
- - spec/dummy/bin/rake
293
- - spec/dummy/config.ru
294
- - spec/dummy/config/application.rb
295
- - spec/dummy/config/boot.rb
296
- - spec/dummy/config/database.yml
297
- - spec/dummy/config/environment.rb
298
- - spec/dummy/db/migrate/.keep
299
- - spec/dummy/db/migrate/20220112154220_add_pg_stat_statements_extension.rb
300
- - spec/dummy/db/schema.rb
301
- - spec/dummy/db/views/.keep
302
- - spec/generators/scenic/model/model_generator_spec.rb
303
- - spec/generators/scenic/view/view_generator_spec.rb
304
- - spec/integration/revert_spec.rb
305
- - spec/scenic/adapters/postgres/connection_spec.rb
306
- - spec/scenic/adapters/postgres/refresh_dependencies_spec.rb
307
- - spec/scenic/adapters/postgres/views_spec.rb
308
- - spec/scenic/adapters/postgres_spec.rb
309
- - spec/scenic/command_recorder/statement_arguments_spec.rb
310
- - spec/scenic/command_recorder_spec.rb
311
- - spec/scenic/configuration_spec.rb
312
- - spec/scenic/definition_spec.rb
313
- - spec/scenic/schema_dumper_spec.rb
314
- - spec/scenic/statements_spec.rb
315
- - spec/spec_helper.rb
316
- - spec/support/generator_spec_setup.rb
317
- - spec/support/rails_configuration_helpers.rb
318
- - spec/support/view_definition_helpers.rb
297
+ test_files: []
data/.hound.yml DELETED
@@ -1,2 +0,0 @@
1
- rubocop:
2
- config_file: .rubocop.yml
data/.rubocop.yml DELETED
@@ -1,129 +0,0 @@
1
- AllCops:
2
- TargetRubyVersion: 2.3.0
3
- Exclude:
4
- - "tmp/**/*"
5
- - "bin/*"
6
- - "spec/dummy/**/*"
7
-
8
- Bundler/OrderedGems:
9
- Enabled: false
10
-
11
- Gemspec/OrderedDependencies:
12
- Enabled: false
13
-
14
- Layout/AlignParameters:
15
- Enabled: true
16
- EnforcedStyle: with_fixed_indentation
17
- Layout/ConditionPosition:
18
- Enabled: false
19
- Layout/DotPosition:
20
- EnforcedStyle: leading
21
- Layout/ExtraSpacing:
22
- Enabled: true
23
- Layout/IndentAssignment:
24
- Enabled: False
25
- Layout/MultilineOperationIndentation:
26
- Enabled: true
27
- EnforcedStyle: indented
28
- Layout/MultilineMethodCallIndentation:
29
- Enabled: true
30
- EnforcedStyle: indented
31
-
32
- Lint/AmbiguousOperator:
33
- Enabled: true
34
- Lint/AmbiguousRegexpLiteral:
35
- Enabled: true
36
- Lint/DuplicatedKey:
37
- Enabled: true
38
-
39
- Metrics/ClassLength:
40
- Enabled: false
41
- Metrics/ModuleLength:
42
- Enabled: false
43
- Metrics/AbcSize:
44
- Enabled: false
45
- Metrics/BlockLength:
46
- CountComments: true # count full line comments?
47
- Max: 25
48
- ExcludedMethods: []
49
- Exclude:
50
- - "spec/**/*"
51
- - "*.gemspec"
52
- Metrics/CyclomaticComplexity:
53
- Enabled: false
54
- Metrics/LineLength:
55
- Max: 80
56
- Metrics/MethodLength:
57
- Enabled: false
58
-
59
- Security/Eval:
60
- Enabled: true
61
- Exclude:
62
- - "spec/scenic/schema_dumper_spec.rb"
63
- Style/BlockDelimiters:
64
- Enabled: false
65
- Style/CollectionMethods:
66
- Enabled: true
67
- PreferredMethods:
68
- find: find
69
- inject: reduce
70
- collect: map
71
- find_all: select
72
- Style/ConditionalAssignment:
73
- Enabled: false
74
- Style/ClassAndModuleChildren:
75
- Enabled: true
76
- Exclude:
77
- - "spec/**/*"
78
- Style/Documentation:
79
- Enabled: false
80
- Style/FrozenStringLiteralComment:
81
- Description: >-
82
- Add the frozen_string_literal comment to the top of files
83
- to help transition from Ruby 2.3.0 to Ruby 3.0.
84
- Enabled: false
85
- Style/GuardClause:
86
- Enabled: false
87
- Style/IfUnlessModifier:
88
- Enabled: false
89
- Style/Lambda:
90
- Enabled: false
91
- Style/NumericLiterals:
92
- Enabled: false
93
- Style/OneLineConditional:
94
- Enabled: false
95
- Style/PercentLiteralDelimiters:
96
- Enabled: false
97
- Style/StringLiterals:
98
- EnforcedStyle: double_quotes
99
- Enabled: true
100
- Style/TrailingCommaInArguments:
101
- Description: 'Checks for trailing comma in argument lists.'
102
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
103
- EnforcedStyleForMultiline: comma
104
- SupportedStylesForMultiline:
105
- - comma
106
- - consistent_comma
107
- - no_comma
108
- Enabled: true
109
- Style/TrailingCommaInArrayLiteral:
110
- Description: 'Checks for trailing comma in array literals.'
111
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
112
- EnforcedStyleForMultiline: comma
113
- SupportedStylesForMultiline:
114
- - comma
115
- - consistent_comma
116
- - no_comma
117
- Enabled: true
118
- Style/TrailingCommaInHashLiteral:
119
- Description: 'Checks for trailing comma in hash literals.'
120
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
121
- EnforcedStyleForMultiline: comma
122
- SupportedStylesForMultiline:
123
- - comma
124
- - consistent_comma
125
- - no_comma
126
- Enabled: true
127
- Style/WordArray:
128
- Enabled: false
129
-