rubocop-rails-suite 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/README.md +53 -0
  4. data/rubocop.yml +99 -0
  5. metadata +162 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: f81d0febf78c19ed68aa250d606184dc2b96c8ba685ce7c5eecbc5795ac42c3a
4
+ data.tar.gz: 8c4fe4795198c5db8c6272fa78ba7825b486d28330c9ab5f2aec20c1d34e497e
5
+ SHA512:
6
+ metadata.gz: 246a8bcf50767b45935bd26824a3d3db270ac99889c63a92ba61e34527822f251908e038ddac2425f58c54653b248e5c41c065c55394802ab3ec091e2312f978
7
+ data.tar.gz: 78ab7e8c7fa253496607e47be28b029a73a159d715cdf947d1f026184dfe89d3b2f52ea065a534b01cae7a8a55ceee9e473f9ce6b27b0a0324e0656f779df321
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2024 George Mihai Grigore
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,53 @@
1
+ # Rubocop Rails Suite
2
+
3
+ **Rubocop Rails Suite** is a comprehensive suite of RuboCop configurations tailored for Ruby on Rails applications. This gem enhances your Rails code quality by bundling essential RuboCop extensions for performance, testing, and best practices. It requires at least Ruby version 3.0.0 to function properly.
4
+
5
+ ## Gems Included:
6
+
7
+ - [`rubocop`](https://github.com/rubocop/rubocop) - The base linter for Ruby.
8
+ - [`rubocop-rails`](https://github.com/rubocop/rubocop-rails) - Rails-specific linting rules.
9
+ - [`rubocop-performance`](https://github.com/rubocop/rubocop-performance) - Rules focused on optimizing Ruby performance.
10
+ - [`rubocop-rspec`](https://github.com/rubocop/rubocop-rspec) - Linting rules for RSpec tests.
11
+ - [`rubocop-factory_bot`](https://github.com/rubocop-hq/rubocop-factory_bot) - Linting rules for `factory_bot` usage.
12
+ - [`rubocop-faker`](https://github.com/nebulab/rubocop-faker) - Linting rules for `faker` usage.
13
+ - [`rubocop-migration`](https://github.com/xavier/rubocop-migration) - Best practices for database migrations.
14
+ - [`rubocop-rake`](https://github.com/rubocop/rubocop-rake) - Linting rules for Rake tasks.
15
+
16
+ ## Installation
17
+
18
+ Add this line to your application's Gemfile:
19
+
20
+ ```ruby
21
+ gem "rubocop-rails-suite", require: false, group: [:development]
22
+ ```
23
+
24
+ Then execute:
25
+ ```bash
26
+ bundle install
27
+ ```
28
+
29
+ ## Usage
30
+ To enable the Rubocop Rails Suite in your project, create or update your .rubocop.yml file with the following:
31
+
32
+ ```yaml
33
+ inherit_gem:
34
+ rubocop-rails-suite: rubocop.yml
35
+
36
+ # Specify your Ruby version
37
+ AllCops:
38
+ TargetRubyVersion: 3.0
39
+ ```
40
+
41
+ This will import the suite's recommended RuboCop rules for Rails projects, including rules for performance, RSpec, factory_bot, faker, and migration linting.
42
+
43
+ Run RuboCop to check your code:
44
+ ```bash
45
+ bundle exec rubocop
46
+ ```
47
+
48
+ ## Contributing
49
+ Contributions are welcome! Feel free to report bugs or submit pull requests.
50
+
51
+ ## Contact
52
+
53
+ For questions or further information, feel free to reach out via [LinkedIn](https://www.linkedin.com/in/grigore-george-mihai-73981b86/).
data/rubocop.yml ADDED
@@ -0,0 +1,99 @@
1
+ inherit_mode:
2
+ merge:
3
+ - Exclude
4
+
5
+ # Enable RuboCop plugins
6
+ require:
7
+ - rubocop-performance
8
+ - rubocop-rails
9
+ - rubocop-factory_bot
10
+ - rubocop-faker
11
+ - rubocop-migration
12
+ - rubocop-rake
13
+ - rubocop-rspec
14
+
15
+ # General configuration for all cops
16
+ AllCops:
17
+ NewCops: enable
18
+ SuggestExtensions: false
19
+ TargetRubyVersion: 3.0
20
+ Exclude:
21
+ - "db/schema.rb"
22
+ - "config/**/*"
23
+ - "bin/*"
24
+
25
+ # Enable Rails-related cops
26
+ Rails:
27
+ Enabled: true
28
+
29
+ # Enable Performance-related cops
30
+ Performance:
31
+ Enabled: true
32
+
33
+ # Enable RSpec-related cops
34
+ RSpec:
35
+ Enabled: true
36
+
37
+ # Enable Rake-related cops
38
+ Rake:
39
+ Enabled: true
40
+
41
+ # Enable FactoryBot-related cops
42
+ FactoryBot:
43
+ Enabled: true
44
+
45
+ # Enable Faker-related cops
46
+ Faker:
47
+ Enabled: true
48
+
49
+ # Enable Migration-related cops
50
+ Migration/AddCheckConstraint:
51
+ Enabled: true
52
+
53
+ # Layout and Style Cops for Consistency
54
+ Style/Documentation:
55
+ Enabled: false
56
+
57
+ Style/FrozenStringLiteralComment:
58
+ Enabled: true
59
+ Exclude:
60
+ - "config/**/*"
61
+
62
+ Layout/EmptyLinesAroundBlockBody:
63
+ Enabled: true
64
+
65
+ Layout/EndAlignment:
66
+ Enabled: true
67
+ EnforcedStyleAlignWith: variable
68
+
69
+ Lint/RequireParentheses:
70
+ Enabled: true
71
+
72
+ Style/TrailingCommaInArrayLiteral:
73
+ Enabled: true
74
+
75
+ Style/TrailingCommaInHashLiteral:
76
+ Enabled: true
77
+
78
+ Style/HashSyntax:
79
+ Enabled: true
80
+ EnforcedShorthandSyntax: either
81
+
82
+ Layout/SpaceInsideBlockBraces:
83
+ Enabled: true
84
+ EnforcedStyleForEmptyBraces: space
85
+
86
+ Style/ColonMethodCall:
87
+ Enabled: true
88
+
89
+ Lint/UriEscapeUnescape:
90
+ Enabled: true
91
+
92
+ Style/StringLiterals:
93
+ Enabled: true
94
+ EnforcedStyle: double_quotes
95
+ Include:
96
+ - "app/**/*"
97
+ - "lib/**/*"
98
+ - "test/**/*"
99
+ - "Gemfile"
metadata ADDED
@@ -0,0 +1,162 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rubocop-rails-suite
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - George Mihai Grigore
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2024-09-22 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rubocop
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'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rubocop-performance
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
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rubocop-rails
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rubocop-factory_bot
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rubocop-faker
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rubocop-migration
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: rubocop-rake
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :runtime
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: rubocop-rspec
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :runtime
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ description: Rubocop Rails Suite offers enhanced rules for Rails apps, focusing on
126
+ performance, RSpec, factory_bot, and migration linting.
127
+ email:
128
+ - grigore.george.mihaii@gmail.com
129
+ executables: []
130
+ extensions: []
131
+ extra_rdoc_files: []
132
+ files:
133
+ - LICENSE.txt
134
+ - README.md
135
+ - rubocop.yml
136
+ homepage: https://github.com/Grigore-George-Mihai/rubocop-rails-suite
137
+ licenses:
138
+ - MIT
139
+ metadata:
140
+ allowed_push_host: https://rubygems.org
141
+ homepage_uri: https://github.com/Grigore-George-Mihai/rubocop-rails-suite
142
+ source_code_uri: https://github.com/Grigore-George-Mihai/rubocop-rails-suite
143
+ post_install_message:
144
+ rdoc_options: []
145
+ require_paths:
146
+ - lib
147
+ required_ruby_version: !ruby/object:Gem::Requirement
148
+ requirements:
149
+ - - ">="
150
+ - !ruby/object:Gem::Version
151
+ version: 3.0.0
152
+ required_rubygems_version: !ruby/object:Gem::Requirement
153
+ requirements:
154
+ - - ">="
155
+ - !ruby/object:Gem::Version
156
+ version: '0'
157
+ requirements: []
158
+ rubygems_version: 3.4.6
159
+ signing_key:
160
+ specification_version: 4
161
+ summary: A suite of RuboCop rules for Rails applications.
162
+ test_files: []