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

[UnusedArgument] Respect :as keyword even without :loads #67

Conversation

nvasilevski
Copy link
Contributor

One more tiny fix
:as keyword can be used without :loads so we need to always respect it if present
Conceptually the change is as tiny as:

-         if declared_arg.kwargs.loads.nil?
+         if declared_arg.kwargs.loads.nil? && declared_arg.kwargs.as.nil?
            declared_arg.name
          else
            declared_arg.as || inferred_arg_name(declared_arg.name.to_s)
          end

but I did a bit of refactoring :)

Copy link
Owner

@DmitryTsepelev DmitryTsepelev left a comment

Choose a reason for hiding this comment

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

👍

@DmitryTsepelev DmitryTsepelev merged commit cbac873 into DmitryTsepelev:master Jan 7, 2022
@nvasilevski nvasilevski deleted the as-alias-can-be-used-without-loads branch January 7, 2022 20:12
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.

2 participants