-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Rewrite script/add-grammar
as a plain shell-script
#5521
Conversation
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.
A quick first pass-through with my handy linters. Mostly nits.
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.
Two more non-blocking quick fixes to keep things consistent so feel free to merge the suggestions and merge.
Thanks for this rewrite 🙇
Description
I recently suggested that
script/add-grammar
be rewritten as a plain shell-script, since 90% of it is nothing but executing external commands. Really the only thing we need Ruby for here is normalising user-provided grammar specifiers, a function that's now handled with a new script:normalise-url
:I've gone and hardened the normalisation logic to catch and correct malformed URLs (when ambiguity isn't a concern), something which the current script does only a minimal job of. For example:
Checklist:
/cc @lildude