-
Notifications
You must be signed in to change notification settings - Fork 16
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
Retrieve aliases not for keys #36
base: master
Are you sure you want to change the base?
Retrieve aliases not for keys #36
Conversation
Signed-off-by: Hansuk Hong <[email protected]>
Signed-off-by: Hansuk Hong <[email protected]>
@@ -151,28 +151,30 @@ def parse(psych_parse_data) | |||
def parse_recurse(psych_parse_data, is_sequence = false) | |||
is_key = false | |||
psych_parse_data.children.each do |n| | |||
case n.class.to_s | |||
when 'Psych::Nodes::Scalar' | |||
case n |
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.
Shouldn't this be n.class
?
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.
It's fine, though it's a mildly surprising idiom. It's designed to work this way: case...when
in Ruby compares with ===
, and Module#===
is defined to check whether the object is an instance of the class.
Thanks for the fix! |
@@ -0,0 +1,6 @@ | |||
--- |
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.
This file needs to be added to the rakefile under the yamllint_exclude_paths test.
Correct the detecting wrong key in such following YAML and test:
And refactor to reduce codes