rubocop-hk 1.0.9 โ†’ 1.1.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5c6960d7bd66c8716dd190af8c15a3f1df0d2aff8acf0f9e4bc96dd182cf4731
4
- data.tar.gz: db5b2c7b348d1e91f11288e02ff0c3403c26c8e202ad3add7955f7da1e1928eb
3
+ metadata.gz: 42d990adff94c48e96e4f59a47ffb75c3195e3ebd5f4162a89a4b932ce2c08a8
4
+ data.tar.gz: bd9e0573fb968aacbbf26da2f743b128e042a5f78cf4f0b1bad87e7d5fecb9be
5
5
  SHA512:
6
- metadata.gz: 364bf0ecee3161ed2bb9ea52e144d9b39051cced59fbbf3fa685fbaf0199ec78fdbe4a3d323d34f4cbbdf2ebf76ea733a3a9a858aa85561ca3f2f0f8f65e81c0
7
- data.tar.gz: 8378ff656bd5b464c0ece6a7aea832951550b1febba16e46749f3982615ec10c3d37f4be558425aa570520bbae14d9c6fdc190e5a42062cd5ac45f26e62ba21b
6
+ metadata.gz: b34e2a0e9770621d99c3df242b3abf7e83314b7cafdabe4f50da931a136dadea3ac78c597742d4dced17a9ebbdf8f9ca2565c699f4f7de4e3a98b2b968e3051e
7
+ data.tar.gz: 10139a71fc59d67ce58a4b5e943f9004a123a0307b2e4c28b4e3561e62517238a170fa1b1751efdb3dc2c22ace3ec429021a54af520eed6a85fd0190c76c57bb
data/README.md CHANGED
@@ -80,7 +80,7 @@ end
80
80
 
81
81
  ```bash
82
82
  # 1. Add to your Gemfile
83
- echo 'gem "rubocop-hk", "~> 1.0.0", require: false' >> Gemfile
83
+ echo 'gem "rubocop-hk", "~> 1.1.0", require: false' >> Gemfile
84
84
 
85
85
  # 2. Install the gem
86
86
  bundle install
@@ -163,7 +163,7 @@ cat << 'EOF' >> Gemfile
163
163
 
164
164
  # Code quality and style enforcement
165
165
  group :development, :test do
166
- gem "rubocop-hk", "~> 1.0.0", require: false
166
+ gem "rubocop-hk", "~> 1.1.0", require: false
167
167
  end
168
168
  EOF
169
169
 
@@ -248,7 +248,7 @@ Add this line to your application's Gemfile:
248
248
 
249
249
  ```ruby
250
250
  group :development, :test do
251
- gem "rubocop-hk", "~> 1.0.0", require: false
251
+ gem "rubocop-hk", "~> 1.1.0", require: false
252
252
  end
253
253
  ```
254
254
 
@@ -522,7 +522,7 @@ cat >> Gemfile << 'EOF'
522
522
 
523
523
  # Code quality and linting
524
524
  group :development, :test do
525
- gem "rubocop-hk", "~> 1.0.0", require: false
525
+ gem "rubocop-hk", "~> 1.1.0", require: false
526
526
  end
527
527
  EOF
528
528
 
@@ -636,7 +636,7 @@ cd my_api
636
636
  cat >> Gemfile << 'EOF'
637
637
 
638
638
  group :development, :test do
639
- gem "rubocop-hk", "~> 1.0.0", require: false
639
+ gem "rubocop-hk", "~> 1.1.0", require: false
640
640
  end
641
641
  EOF
642
642
 
@@ -1226,6 +1226,79 @@ bundle exec rubocop --only Style/StringLiterals
1226
1226
  bundle exec rubocop --auto-gen-config
1227
1227
  ```
1228
1228
 
1229
+ ### ๐ŸŽ›๏ธ **Overriding RuboCop Rules**
1230
+
1231
+ You can easily override or customize any RuboCop rule by adding it to your `.rubocop.yml` file:
1232
+
1233
+ ```yaml
1234
+ # .rubocop.yml
1235
+ inherit_gem:
1236
+ rubocop-hk: config/default.yml
1237
+
1238
+ AllCops:
1239
+ TargetRubyVersion: 3.3
1240
+ TargetRailsVersion: 8.0
1241
+
1242
+ # ๐Ÿšซ Disable specific cops
1243
+ Style/Documentation:
1244
+ Enabled: false # Turn off documentation requirement
1245
+
1246
+ # ๐Ÿ”ข Adjust cop parameters
1247
+ Metrics/ClassLength:
1248
+ Max: 200 # Allow longer classes (default: 100)
1249
+
1250
+ Layout/LineLength:
1251
+ Max: 120 # Extend line length (default: 80)
1252
+ Exclude:
1253
+ - "db/migrate/*.rb" # Exclude migrations from line length
1254
+
1255
+ # ๐ŸŽฏ Enable/disable cops for specific files
1256
+ Style/FrozenStringLiteralComment:
1257
+ Enabled: true
1258
+ Exclude:
1259
+ - "bin/*"
1260
+ - "db/seeds.rb"
1261
+
1262
+ # ๐Ÿ“Š Customize severity levels
1263
+ Style/StringLiterals:
1264
+ EnforcedStyle: double_quotes # Enforce double quotes
1265
+ Severity: error # Make violations errors instead of warnings
1266
+
1267
+ # ๐Ÿงช RSpec-specific overrides
1268
+ RSpec/ExampleLength:
1269
+ Max: 25 # Allow longer test examples (default: 15)
1270
+
1271
+ RSpec/MultipleExpectations:
1272
+ Max: 5 # Allow more expectations per test
1273
+
1274
+ # โšก Performance cop customization
1275
+ Performance/Casecmp:
1276
+ Enabled: true
1277
+ Severity: warning
1278
+
1279
+ # ๐Ÿš‚ Rails-specific overrides
1280
+ Rails/HasManyOrHasOneDependent:
1281
+ Enabled: true
1282
+ Severity: error # Make missing dependent option an error
1283
+ ```
1284
+
1285
+ **๐Ÿ’ก Pro Tips for Overriding Rules:**
1286
+
1287
+ - **Start small**: Override one rule at a time and test the impact
1288
+ - **Use Exclude**: Prefer excluding specific files rather than disabling cops entirely
1289
+ - **Check severity**: Use `warning` instead of disabling if you want to keep visibility
1290
+ - **Document why**: Add comments explaining why you're overriding specific rules
1291
+ - **Team agreement**: Make sure your team agrees on rule changes
1292
+
1293
+ **๐Ÿ” Finding Rule Names:**
1294
+ ```bash
1295
+ # See all available cops
1296
+ bundle exec rubocop --show-cops
1297
+
1298
+ # Find which cop is flagging a specific issue
1299
+ bundle exec rubocop --format offenses
1300
+ ```
1301
+
1229
1302
  ### ๐Ÿ”ง **Pre-commit Hook Setup**
1230
1303
 
1231
1304
  ```bash
@@ -1356,7 +1429,7 @@ EOF
1356
1429
  ```ruby
1357
1430
  # Gemfile updates for Rails 7 compatibility
1358
1431
  gem "rails", "~> 7.0.0"
1359
- gem "rubocop-hk", "~> 1.0.0"
1432
+ gem "rubocop-hk", "~> 1.1.0"
1360
1433
 
1361
1434
  # Update other gems
1362
1435
  gem "rspec-rails", "~> 6.0" # Rails 7 compatible
@@ -3082,7 +3155,7 @@ bundle install
3082
3155
  gem install rubocop-hk -v "~> 1.0.0"
3083
3156
 
3084
3157
  # Version-specific fix for Rails 6:
3085
- echo 'gem "rubocop-hk", "~> 1.0.0", require: false' >> Gemfile
3158
+ echo 'gem "rubocop-hk", "~> 1.1.0", require: false' >> Gemfile
3086
3159
  bundle install
3087
3160
  ```
3088
3161
 
@@ -3724,6 +3797,8 @@ If RuboCop HK helps you write better Ruby code, please consider:
3724
3797
 
3725
3798
  **Made with โค๏ธ by [Hammad Khan](https://github.com/hammadxcm)**
3726
3799
 
3800
+ **๐ŸŒ Visit: [https://fyniti.co.uk](https://fyniti.co.uk)**
3801
+
3727
3802
  **[๐Ÿ› Report Bug](https://github.com/hammadxcm/rubocop-hk/issues) โ€ข
3728
3803
  [โœจ Request Feature](https://github.com/hammadxcm/rubocop-hk/issues/new?template=feature_request.md) โ€ข
3729
3804
  [๐Ÿ“– Documentation](https://github.com/hammadxcm/rubocop-hk/wiki) โ€ข
data/config/default.yml CHANGED
@@ -1,7 +1,7 @@
1
1
  AllCops:
2
2
  # Target versions for Rails 6-8.x applications (2025)
3
- TargetRubyVersion: 3.1
4
- TargetRailsVersion: 8.0
3
+ TargetRubyVersion: 3.2
4
+ TargetRailsVersion: 8.1
5
5
 
6
6
  # Enhanced exclusions for typical Rails project structure
7
7
  Exclude:
@@ -31,11 +31,14 @@ AllCops:
31
31
  # Enable new cops for modern Rails/Ruby features
32
32
  NewCops: enable
33
33
 
34
+ # Parser engine (prism for Ruby 3.4+)
35
+ ParserEngine: parser_whitequark
36
+
34
37
  # Extension suggestions for Rails 6-8.x
35
38
  SuggestExtensions:
36
39
  rubocop-performance: true
37
40
  rubocop-thread_safety: false
38
- rubocop-minitest: false
41
+ rubocop-minitest: true
39
42
  rubocop-capybara: true
40
43
 
41
44
  Rails:
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Rubocop
4
4
  module Hk
5
- VERSION = "1.0.9"
5
+ VERSION = "1.1.0"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocop-hk
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.9
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hammad Khan
@@ -15,14 +15,14 @@ dependencies:
15
15
  requirements:
16
16
  - - "~>"
17
17
  - !ruby/object:Gem::Version
18
- version: 1.79.2
18
+ version: 1.80.0
19
19
  type: :runtime
20
20
  prerelease: false
21
21
  version_requirements: !ruby/object:Gem::Requirement
22
22
  requirements:
23
23
  - - "~>"
24
24
  - !ruby/object:Gem::Version
25
- version: 1.79.2
25
+ version: 1.80.0
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: rubocop-performance
28
28
  requirement: !ruby/object:Gem::Requirement
@@ -43,14 +43,14 @@ dependencies:
43
43
  requirements:
44
44
  - - "~>"
45
45
  - !ruby/object:Gem::Version
46
- version: 2.32.0
46
+ version: 2.33.0
47
47
  type: :runtime
48
48
  prerelease: false
49
49
  version_requirements: !ruby/object:Gem::Requirement
50
50
  requirements:
51
51
  - - "~>"
52
52
  - !ruby/object:Gem::Version
53
- version: 2.32.0
53
+ version: 2.33.0
54
54
  - !ruby/object:Gem::Dependency
55
55
  name: rubocop-rspec
56
56
  requirement: !ruby/object:Gem::Requirement
@@ -113,14 +113,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
113
113
  requirements:
114
114
  - - ">="
115
115
  - !ruby/object:Gem::Version
116
- version: 3.1.0
116
+ version: 3.2.0
117
117
  required_rubygems_version: !ruby/object:Gem::Requirement
118
118
  requirements:
119
119
  - - ">="
120
120
  - !ruby/object:Gem::Version
121
121
  version: '0'
122
122
  requirements: []
123
- rubygems_version: 3.6.9
123
+ rubygems_version: 3.7.1
124
124
  specification_version: 4
125
125
  summary: RuboCop HK
126
126
  test_files: []