sevencop 0.21.0 → 0.22.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (34) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +6 -0
  3. data/Gemfile.lock +13 -1
  4. data/README.md +17 -4
  5. data/config/default.yml +134 -0
  6. data/lib/rubocop/cop/sevencop/factory_bot_association_option.rb +1 -1
  7. data/lib/rubocop/cop/sevencop/factory_bot_association_style.rb +31 -31
  8. data/lib/rubocop/cop/sevencop/rails_inferred_spec_type.rb +1 -1
  9. data/lib/rubocop/cop/sevencop/rails_migration_add_check_constraint.rb +111 -0
  10. data/lib/rubocop/cop/sevencop/rails_migration_add_column_with_default_value.rb +229 -0
  11. data/lib/rubocop/cop/sevencop/rails_migration_add_foreign_key.rb +166 -0
  12. data/lib/rubocop/cop/sevencop/rails_migration_add_index_concurrently.rb +164 -0
  13. data/lib/rubocop/cop/sevencop/rails_migration_batch_in_batches.rb +95 -0
  14. data/lib/rubocop/cop/sevencop/rails_migration_batch_in_transaction.rb +83 -0
  15. data/lib/rubocop/cop/sevencop/rails_migration_batch_with_throttling.rb +108 -0
  16. data/lib/rubocop/cop/sevencop/rails_migration_change_column.rb +113 -0
  17. data/lib/rubocop/cop/sevencop/rails_migration_change_column_null.rb +128 -0
  18. data/lib/rubocop/cop/sevencop/rails_migration_create_table_force.rb +89 -0
  19. data/lib/rubocop/cop/sevencop/rails_migration_jsonb.rb +131 -0
  20. data/lib/rubocop/cop/sevencop/rails_migration_remove_column.rb +258 -0
  21. data/lib/rubocop/cop/sevencop/rails_migration_rename_column.rb +81 -0
  22. data/lib/rubocop/cop/sevencop/rails_migration_rename_table.rb +79 -0
  23. data/lib/rubocop/cop/sevencop/rails_migration_reserved_word_mysql.rb +2 -19
  24. data/lib/rubocop/cop/sevencop/rails_migration_unique_index_columns_count.rb +92 -0
  25. data/lib/sevencop/config_loader.rb +11 -10
  26. data/lib/sevencop/cop_concerns/batch_processing.rb +32 -0
  27. data/lib/sevencop/cop_concerns/column_type_method.rb +26 -0
  28. data/lib/sevencop/cop_concerns/disable_ddl_transaction.rb +49 -0
  29. data/lib/sevencop/cop_concerns.rb +3 -0
  30. data/lib/sevencop/rubocop_extension.rb +6 -1
  31. data/lib/sevencop/version.rb +1 -1
  32. data/lib/sevencop.rb +15 -0
  33. data/sevencop.gemspec +1 -0
  34. metadata +34 -2
@@ -2,6 +2,9 @@
2
2
 
3
3
  module Sevencop
4
4
  module CopConcerns
5
+ autoload :BatchProcessing, 'sevencop/cop_concerns/batch_processing'
6
+ autoload :ColumnTypeMethod, 'sevencop/cop_concerns/column_type_method'
7
+ autoload :DisableDdlTransaction, 'sevencop/cop_concerns/disable_ddl_transaction'
5
8
  autoload :Ordered, 'sevencop/cop_concerns/ordered'
6
9
  end
7
10
  end
@@ -6,5 +6,10 @@ require_relative 'config_loader'
6
6
 
7
7
  RuboCop::ConfigLoader.instance_variable_set(
8
8
  :@default_configuration,
9
- Sevencop::ConfigLoader.call
9
+ Sevencop::ConfigLoader.call(
10
+ path: ::File.expand_path(
11
+ '../../config/default.yml',
12
+ __dir__
13
+ )
14
+ )
10
15
  )
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Sevencop
4
- VERSION = '0.21.0'
4
+ VERSION = '0.22.0'
5
5
  end
data/lib/sevencop.rb CHANGED
@@ -14,7 +14,22 @@ require_relative 'rubocop/cop/sevencop/method_definition_keyword_argument_ordere
14
14
  require_relative 'rubocop/cop/sevencop/method_definition_ordered'
15
15
  require_relative 'rubocop/cop/sevencop/rails_belongs_to_optional'
16
16
  require_relative 'rubocop/cop/sevencop/rails_inferred_spec_type'
17
+ require_relative 'rubocop/cop/sevencop/rails_migration_add_check_constraint'
18
+ require_relative 'rubocop/cop/sevencop/rails_migration_add_column_with_default_value'
19
+ require_relative 'rubocop/cop/sevencop/rails_migration_add_foreign_key'
20
+ require_relative 'rubocop/cop/sevencop/rails_migration_add_index_concurrently'
21
+ require_relative 'rubocop/cop/sevencop/rails_migration_batch_in_batches'
22
+ require_relative 'rubocop/cop/sevencop/rails_migration_batch_in_transaction'
23
+ require_relative 'rubocop/cop/sevencop/rails_migration_batch_with_throttling'
24
+ require_relative 'rubocop/cop/sevencop/rails_migration_change_column'
25
+ require_relative 'rubocop/cop/sevencop/rails_migration_change_column_null'
26
+ require_relative 'rubocop/cop/sevencop/rails_migration_create_table_force'
27
+ require_relative 'rubocop/cop/sevencop/rails_migration_jsonb'
28
+ require_relative 'rubocop/cop/sevencop/rails_migration_remove_column'
29
+ require_relative 'rubocop/cop/sevencop/rails_migration_rename_column'
30
+ require_relative 'rubocop/cop/sevencop/rails_migration_rename_table'
17
31
  require_relative 'rubocop/cop/sevencop/rails_migration_reserved_word_mysql'
32
+ require_relative 'rubocop/cop/sevencop/rails_migration_unique_index_columns_count'
18
33
  require_relative 'rubocop/cop/sevencop/rails_order_field'
19
34
  require_relative 'rubocop/cop/sevencop/rails_uniqueness_validator_explicit_case_sensitivity'
20
35
  require_relative 'rubocop/cop/sevencop/rails_where_not'
data/sevencop.gemspec CHANGED
@@ -28,5 +28,6 @@ Gem::Specification.new do |spec|
28
28
  spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
29
29
  spec.require_paths = ['lib']
30
30
 
31
+ spec.add_runtime_dependency 'activesupport'
31
32
  spec.add_runtime_dependency 'rubocop'
32
33
  end
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sevencop
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.21.0
4
+ version: 0.22.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryo Nakamura
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-10-14 00:00:00.000000000 Z
11
+ date: 2022-10-16 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: activesupport
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: rubocop
15
29
  requirement: !ruby/object:Gem::Requirement
@@ -52,7 +66,22 @@ files:
52
66
  - lib/rubocop/cop/sevencop/method_definition_ordered.rb
53
67
  - lib/rubocop/cop/sevencop/rails_belongs_to_optional.rb
54
68
  - lib/rubocop/cop/sevencop/rails_inferred_spec_type.rb
69
+ - lib/rubocop/cop/sevencop/rails_migration_add_check_constraint.rb
70
+ - lib/rubocop/cop/sevencop/rails_migration_add_column_with_default_value.rb
71
+ - lib/rubocop/cop/sevencop/rails_migration_add_foreign_key.rb
72
+ - lib/rubocop/cop/sevencop/rails_migration_add_index_concurrently.rb
73
+ - lib/rubocop/cop/sevencop/rails_migration_batch_in_batches.rb
74
+ - lib/rubocop/cop/sevencop/rails_migration_batch_in_transaction.rb
75
+ - lib/rubocop/cop/sevencop/rails_migration_batch_with_throttling.rb
76
+ - lib/rubocop/cop/sevencop/rails_migration_change_column.rb
77
+ - lib/rubocop/cop/sevencop/rails_migration_change_column_null.rb
78
+ - lib/rubocop/cop/sevencop/rails_migration_create_table_force.rb
79
+ - lib/rubocop/cop/sevencop/rails_migration_jsonb.rb
80
+ - lib/rubocop/cop/sevencop/rails_migration_remove_column.rb
81
+ - lib/rubocop/cop/sevencop/rails_migration_rename_column.rb
82
+ - lib/rubocop/cop/sevencop/rails_migration_rename_table.rb
55
83
  - lib/rubocop/cop/sevencop/rails_migration_reserved_word_mysql.rb
84
+ - lib/rubocop/cop/sevencop/rails_migration_unique_index_columns_count.rb
56
85
  - lib/rubocop/cop/sevencop/rails_order_field.rb
57
86
  - lib/rubocop/cop/sevencop/rails_uniqueness_validator_explicit_case_sensitivity.rb
58
87
  - lib/rubocop/cop/sevencop/rails_where_not.rb
@@ -62,6 +91,9 @@ files:
62
91
  - lib/sevencop.rb
63
92
  - lib/sevencop/config_loader.rb
64
93
  - lib/sevencop/cop_concerns.rb
94
+ - lib/sevencop/cop_concerns/batch_processing.rb
95
+ - lib/sevencop/cop_concerns/column_type_method.rb
96
+ - lib/sevencop/cop_concerns/disable_ddl_transaction.rb
65
97
  - lib/sevencop/cop_concerns/ordered.rb
66
98
  - lib/sevencop/rubocop_extension.rb
67
99
  - lib/sevencop/version.rb