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/RootPathnameMethods cop #1416

Merged

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 RootPathname cop [Fix #1389] Handle TypeError caused by an array in RootPathname cop Jan 18, 2025
@ydakuka ydakuka force-pushed the fix/typeerror_in_the_root_pathname_methods_cop branch from 5262500 to ffc492a Compare January 18, 2025 16:03
@ydakuka ydakuka changed the title [Fix #1389] Handle TypeError caused by an array in RootPathname cop [Fix #1389] Handle TypeError caused by an array in Rails/RootPathname cop Jan 18, 2025
@ydakuka ydakuka force-pushed the fix/typeerror_in_the_root_pathname_methods_cop branch from ffc492a to cf4a112 Compare January 19, 2025 11:15
@ydakuka ydakuka changed the title [Fix #1389] Handle TypeError caused by an array in Rails/RootPathname cop [Fix #1389] Handle TypeError caused by an array in Rails/RootPathnameMethods cop Jan 19, 2025
@ydakuka ydakuka force-pushed the fix/typeerror_in_the_root_pathname_methods_cop branch from cf4a112 to 28cf277 Compare January 19, 2025 11:30
@@ -0,0 +1 @@
* [#1389](https://github.com/rubocop/rubocop-rails/issues/1389): Handle TypeError caused by an array in `Rails/RootPathname` cop. ([@ydakuka][])
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* [#1389](https://github.com/rubocop/rubocop-rails/issues/1389): Handle TypeError caused by an array in `Rails/RootPathname` cop. ([@ydakuka][])
* [#1389](https://github.com/rubocop/rubocop-rails/issues/1389): Handle `TypeError` caused by passing array literals as arguments to `File` methods in `Rails/RootPathnameMethods` cop. ([@ydakuka][])

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_root_pathname_methods_cop branch from 28cf277 to 6511748 Compare January 20, 2025 09:21
@ydakuka ydakuka changed the title [Fix #1389] Handle TypeError caused by an array in Rails/RootPathnameMethods cop [Fix #1389] Handle TypeError caused by passing array literals as arguments to File methods in Rails/RootPathnameMethods cop Jan 20, 2025
@koic
Copy link
Member

koic commented Jan 20, 2025

Can you take a look at the CI failure? Alternatively, you can try running bundle exec rake locally to see if it reproduces.

@ydakuka ydakuka force-pushed the fix/typeerror_in_the_root_pathname_methods_cop branch from 6511748 to 334e5cc Compare January 20, 2025 09:26
@ydakuka
Copy link
Contributor Author

ydakuka commented Jan 20, 2025

Can you take a look at the CI failure? Alternatively, you can try running bundle exec rake locally to see if it reproduces.

Fixed. I forgot the closing parenthesis in the changelog file. I usually run bundle exec rake default.

@koic koic merged commit ce69ef7 into rubocop:master Jan 20, 2025
16 checks passed
@ydakuka ydakuka deleted the fix/typeerror_in_the_root_pathname_methods_cop branch January 20, 2025 10:04
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