-
-
Notifications
You must be signed in to change notification settings - Fork 279
Comparing changes
Open a pull request
base repository: rubocop/rubocop-rails
base: v2.27.0
head repository: rubocop/rubocop-rails
compare: v2.28.0
- 20 commits
- 38 files changed
- 3 contributors
Commits on Oct 26, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 1d7f0c4 - Browse repository at this point
Copy the full SHA 1d7f0c4View commit details
Commits on Oct 29, 2024
-
Fix false negatives for
Rails/RedundantActiveRecordAllMethod
when u……sing `all` method in block This PR fixes false negatives for `Rails/RedundantActiveRecordAllMethod` when methods in `POSSIBLE_ENUMERABLE_BLOCK_METHODS` are used in a block as following: ``` expect { subject }.to change { User.all.count } ```
Configuration menu - View commit details
-
Copy full SHA for 2d7e7a0 - Browse repository at this point
Copy the full SHA 2d7e7a0View commit details -
Merge pull request #1382 from masato-bkn/fix-redundant_active_record_…
…all_method Fix false negatives for `Rails/RedundantActiveRecordAllMethod` when using `POSSIBLE_ENUMERABLE_BLOCK_METHODS` in a block
Configuration menu - View commit details
-
Copy full SHA for ad3287a - Browse repository at this point
Copy the full SHA ad3287aView commit details
Commits on Nov 15, 2024
-
This PR suppresses the following RuboCop offense: ```console $ bundle exec rubocop -a (snip) Offenses: lib/rubocop/cop/rails/save_bang.rb:247:11: C: [Corrected] InternalAffairs/OperatorKeyword: Use node.operator_keyword?. node.or_type? || node.and_type? || single_negative?(node) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ```
Configuration menu - View commit details
-
Copy full SHA for 879f3b9 - Browse repository at this point
Copy the full SHA 879f3b9View commit details -
Configuration menu - View commit details
-
Copy full SHA for d5b012f - Browse repository at this point
Copy the full SHA d5b012fView commit details
Commits on Nov 23, 2024
-
Modify
Rails/Pluck
to ignoremap/collect
when used inside blocks ……to prevent potential N+1 queries
Configuration menu - View commit details
-
Copy full SHA for 24c7a77 - Browse repository at this point
Copy the full SHA 24c7a77View commit details
Commits on Nov 29, 2024
-
Merge pull request #1388 from masato-bkn/modify_rails_pluck_to_ignore…
…_map_when_used_inside_block Modify `Rails/Pluck` to ignore `map/collect` when used inside blocks to prevent potential N+1 queries
Configuration menu - View commit details
-
Copy full SHA for c3ddedf - Browse repository at this point
Copy the full SHA c3ddedfView commit details
Commits on Dec 1, 2024
-
Fix an incorrect autocorrect for
Rails/SelectMap
whenselect
has ……no receiver and method chains are used This commit fixes an incorrect autocorrect for `Rails/SelectMap` when `select` has no receiver and method chains are used between `select` and `map`, as follows: Before autocorrect ```ruby select(:column_name).where(conditions).map(&:column_name) ``` After autocorrect (syntax error) ```ruby .where(conditions)pluck(:column_name) ```
Configuration menu - View commit details
-
Copy full SHA for 02ea37f - Browse repository at this point
Copy the full SHA 02ea37fView commit details -
Merge pull request #1390 from masato-bkn/fix_incorrect_autocorrect_fo…
…r_rails_select_map Fix an incorrect autocorrect for `Rails/SelectMap` when `select` has no receiver and method chains are used
Configuration menu - View commit details
-
Copy full SHA for e470d18 - Browse repository at this point
Copy the full SHA e470d18View commit details
Commits on Dec 13, 2024
-
Apply
rubocop --auto-gen-config
This commit applies `rubocop --auto-gen-config` to suppress the following offense: ```console $ bundle exec rubocop (snip) Offenses: lib/rubocop/cop/rails/blank.rb:126:35: C: [Correctable] InternalAffairs/CopEnabled: Use config.cop_enabled?('Style/UnlessElse') instead of config.for_cop('Style/UnlessElse')['Enabled']. return if node.else? && config.for_cop('Style/UnlessElse')['Enabled'] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lib/rubocop/cop/rails/present.rb:113:35: C: [Correctable] InternalAffairs/CopEnabled: Use config.cop_enabled?('Style/UnlessElse') instead of config.for_cop('Style/UnlessElse')['Enabled']. return if node.else? && config.for_cop('Style/UnlessElse')['Enabled'] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 296 files inspected, 2 offenses detected, 2 offenses autocorrectable RuboCop failed! ``` In the future, the offense of `InternalAffairs/CopEnabled` can be autocorrected, but raising the minimum required RuboCop version just for that should be avoided.
Configuration menu - View commit details
-
Copy full SHA for 0bbd218 - Browse repository at this point
Copy the full SHA 0bbd218View commit details -
Fix
Rails/FilePath
cop error with rescuedRails.root
```console echo '"#{Rails.root rescue "."}/config"' | rubocop --stdin bug.rb -d An error occurred while Rails/FilePath cop was inspecting bug.rb:1:0. undefined method `method?' for an instance of RuboCop::AST::RescueNode lib/rubocop/cop/rails/file_path.rb:156:in `autocorrect_slash_after_rails_root_in_dstr' lib/rubocop/cop/rails/file_path.rb:81:in `block in check_for_slash_after_rails_root_in_dstr' ```
Configuration menu - View commit details
-
Copy full SHA for bb03d6b - Browse repository at this point
Copy the full SHA bb03d6bView commit details -
Merge pull request #1392 from viralpraxis/fix-rails-file-path-cop-err…
…or-with-rescued-rails-root Fix `Rails/FilePath` cop error with rescued `Rails.root`
Configuration menu - View commit details
-
Copy full SHA for c6f869b - Browse repository at this point
Copy the full SHA c6f869bView commit details
Commits on Dec 22, 2024
-
Fix
Rails/FilePath
cop error in case of extra operations in `Rails.……root` interpolation Follow-up to #1392. Previous PR didn't fix cases like this ``` "#{Rails.root || '.'}/config" ``` (it makes sense in real code since `Rails.root` [can be nil](https://github.com/rails/rails/blob/main/railties/lib/rails.rb#L65-L67)) I think it's safe to simply check if the entire expression is of `send` type.
Configuration menu - View commit details
-
Copy full SHA for e4aee6b - Browse repository at this point
Copy the full SHA e4aee6bView commit details
Commits on Dec 23, 2024
-
Merge pull request #1399 from viralpraxis/fix-rails-file-path-cop-err…
…or-on-extra-operations-in-rails-root-interpolation Fix `Rails/FilePath` cop error in case of extra operations in `Rails.root` interpolation
Configuration menu - View commit details
-
Copy full SHA for fecead8 - Browse repository at this point
Copy the full SHA fecead8View commit details -
Fix
Rails/FilePath
cop error onjoin
method with implicit receiver```console echo 'join(Rails.root, path)' | rubocop --only Rails/FilePath --stdin bug.rb -d n error occurred while Rails/FilePath cop was inspecting bug.rb:1:0. undefined method `each_node' for nil lib/rubocop/cop/rails/file_path.rb:54:in `rails_root_nodes?' lib/rubocop/cop/rails/file_path.rb:60:in `rails_root_join_nodes?' lib/rubocop/cop/rails/file_path.rb:108:in `check_for_rails_root_join_with_string_arguments' lib/rubocop/cop/rails/file_path.rb:70:in `on_send' ```
Configuration menu - View commit details
-
Copy full SHA for 815d119 - Browse repository at this point
Copy the full SHA 815d119View commit details -
Merge pull request #1398 from viralpraxis/fix-rails-file-path-cop-err…
…or-on-join-method-implicit-receiver Fix `Rails/FilePath` cop error on `join` method with implicit receiver
Configuration menu - View commit details
-
Copy full SHA for 2671fb4 - Browse repository at this point
Copy the full SHA 2671fb4View commit details
Commits on Dec 25, 2024
-
Introduce
AllCops: MigratedSchemaVersion
configThis PR introduces `AllCops: MigratedSchemaVersion` config. By specifying the `MigratedSchemaVersion` option, migration files that have already been run can be ignored. When `MigratedSchemaVersion: '20241225000000'` is set, migration files lower than or equal to '20241225000000' will be ignored. For example, to ignore db/migrate/20241225000000_create_articles.rb and earlier migrations you would configure it the following way: ```yaml AllCops MigratedSchemaVersion: '20241225000000' ``` This prevents inspecting schema settings for already applied migration files. Changing already applied migrations should be avoided because it can lead to the schema getting out of sync between your local copy and what it actually is in production, depending on when `bin/rails db:migrate` was executed. If you want to modify your schema to comply with the cops, you should instead create new migrations.
Configuration menu - View commit details
-
Copy full SHA for 86b7a55 - Browse repository at this point
Copy the full SHA 86b7a55View commit details -
Merge pull request #1383 from koic/intro_migrated_schema_version
Introduce `AllCops: MigratedSchemaVersion` config
Configuration menu - View commit details
-
Copy full SHA for 2c357f0 - Browse repository at this point
Copy the full SHA 2c357f0View commit details -
Configuration menu - View commit details
-
Copy full SHA for bac0f3e - Browse repository at this point
Copy the full SHA bac0f3eView commit details -
Configuration menu - View commit details
-
Copy full SHA for fcc4cf6 - Browse repository at this point
Copy the full SHA fcc4cf6View commit details
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff v2.27.0...v2.28.0