Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix #1389] Handle TypeError caused by passing array literals as arguments to File methods in Rails/FilePath cop #1415

Merged
merged 1 commit into from
Jan 20, 2025

Conversation

ydakuka
Copy link
Contributor

@ydakuka ydakuka commented Jan 18, 2025

Fix #1389


  • The PR relates to only one subject with a clear title and description in grammatically correct, complete sentences.
  • Commit message starts with [Fix #issue-number] (if the related issue exists).
  • Feature branch is up-to-date with master (if not - rebase it).
  • Squashed related commits together.
  • Added tests.
  • Ran bundle exec rake default. It executes all tests and runs RuboCop on its own code.

@ydakuka ydakuka changed the title [Fix rubocop#1389] Handle TypeError caused by an array in FilePath cop [Fix #1389] Handle TypeError caused by an array in FilePath cop Jan 18, 2025
@ydakuka ydakuka force-pushed the fix/typeerror_in_the_file_path_cop branch from a8ee457 to 503df1a Compare January 18, 2025 16:03
@ydakuka ydakuka changed the title [Fix #1389] Handle TypeError caused by an array in FilePath cop [Fix #1389] Handle TypeError caused by an array in Rails/FilePath cop Jan 18, 2025
@ydakuka ydakuka force-pushed the fix/typeerror_in_the_file_path_cop branch 3 times, most recently from 3c09861 to 45b6fe7 Compare January 20, 2025 09:23
@ydakuka ydakuka changed the title [Fix #1389] Handle TypeError caused by an array in Rails/FilePath cop [Fix #1389] Handle TypeError caused by passing array literals as arguments to File methods in Rails/FilePath cop Jan 20, 2025
@ydakuka ydakuka force-pushed the fix/typeerror_in_the_file_path_cop branch 2 times, most recently from 3d60cbc to 8525398 Compare January 20, 2025 11:09
Comment on lines 28 to 32
Max: 139
Exclude:
- 'lib/rubocop/cop/rails/time_zone.rb'
- 'lib/rubocop/cop/rails/save_bang.rb'
- 'lib/rubocop/cop/rails/file_path.rb'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is concerning that unrelated files are specified in Exclude. Can you update the value of Max for now?

Suggested change
Max: 139
Exclude:
- 'lib/rubocop/cop/rails/time_zone.rb'
- 'lib/rubocop/cop/rails/save_bang.rb'
- 'lib/rubocop/cop/rails/file_path.rb'
Max: 179

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@ydakuka ydakuka force-pushed the fix/typeerror_in_the_file_path_cop branch from 8525398 to 3677f7b Compare January 20, 2025 14:58
@koic koic merged commit 7024ab5 into rubocop:master Jan 20, 2025
16 checks passed
@ydakuka ydakuka deleted the fix/typeerror_in_the_file_path_cop branch January 20, 2025 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The suggestions of the FilePath cop cause a TypeError if %w is used to specify the path
2 participants