-
-
Notifications
You must be signed in to change notification settings - Fork 269
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
Fixed argument prefix warnings #3594
Fixed argument prefix warnings #3594
Conversation
If I run an app using avo with warnings enabled I get a LOT of warnings like this: avo-3.16.1/app/components/avo/fields/files_field/edit_component.html.erb:1: warning: `**' interpreted as argument prefix This is happening because a function is being called with `**` as the first argument but there are no brackets around the arguments. Adding brackets fixes the warning but it does not change the meaning, so I've done that for all field components.
Code Climate has analyzed commit 4a8af34 and detected 0 issues on this pull request. View more on Code Climate. |
Hi @iainbeeston thanks for this contribution.
What warnings are you enabling to see this logs? |
@Paul-Bob Sorry I'm talking about warnings coming from ruby itself. You can enable that by either:
In rspec the errors appear in the console, in rails they appear in the server logs when you navigate to any avo resource page. I'm using ruby 3.3.2 and looking at the source code for ruby it looks like this warning was added in ruby 3.3 |
Thanks for sharing those @iainbeeston Is there any rule that we can add to our linter to avoid this kind of warning in the future? |
That's a really good question... ideally there would be a rubocop cop about this but I've looked and I can't see one (except always requiring parentheses). Even if there was a rubocop cop you'd also need to be using ere-lint because these warnings are coming from view files (I'm not sure if you are using ere-lint or not?) |
Do you mean
Makes sense, thank you! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this contribution @iainbeeston!
Has anyone try Maybe we can set up an easy quick alert with that? |
Description
If I run an app using avo with warnings enabled I get a LOT of warnings like this:
This is happening because a function is being called with
**
as the first argument but there are no brackets around the arguments. Adding brackets fixes the warning but it does not change the meaning, so I've done that for all field components.Fixes # (issue)
Checklist:
Screenshots & recording
Manual review steps
Manual reviewer: please leave a comment with output from the test if that's the case.