-
Notifications
You must be signed in to change notification settings - Fork 19
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
Adding an ability to parse the xml_converter duplicate category output #406
Conversation
identify_duplicate_categories.gd
Outdated
# | ||
# A helper function to see if a string starts with a paticular value or not. | ||
################################################################################ | ||
static func starts_with(value: String, prefix: String): |
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.
There is a String function called begins_with
that I think does what this function does. https://docs.godotengine.org/en/3.3/classes/class_string.html#class-string-method-begins-with
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.
Excellent, I got tunnel vision searching for starts_with
.
var file_name = line.substr(8) | ||
colisions[category].append(file_name) | ||
elif starts_with(line, " "): | ||
var line_without_prefix = line.substr(5) |
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.
Could you leave a comment that this is removing 4 spaces and the leading quotation mark? It wasn't clear on my first read-through.
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.
added
identify_duplicate_categories.gd
Outdated
static func get_duplicate_categories(stdin: String): | ||
var lines: PoolStringArray = stdin.split("\n") | ||
var capturing: bool = false | ||
var colisions = {} |
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.
Collisions is spelled incorrectly
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.
fixed
identify_duplicate_categories.gd
Outdated
################################################################################ | ||
# get_duplicate_categories | ||
# | ||
# Parses the stdout of the xml_converter and extracts any category colisions if |
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.
Collisions is spelled incorrectly
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.
fixed
# | ||
# Parses the stdout of the xml_converter and extracts any category colisions if | ||
# there are any that exist. | ||
################################################################################ |
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 might be worth adding an example here of what we expect to parse so that if it ever breaks, we have something to compare against. Especially since we do not have integration tests for this code.
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.
done
Co-authored-by: klingbolt <[email protected]>
Co-authored-by: klingbolt <[email protected]>
Co-authored-by: klingbolt <[email protected]>
This adds the ability to parse the xml_converter output to detect when it reports that a duplicate category has been detected.