Skip to content

Add SWIRify URL script

Manuel Grabowski requested to merge mg-add-swirify-url-script into main

What does this MR do and why?

Adds a script to easily transform URLs to GitLab items into Markdown links in a format that is suitable to paste into SWIR items, i.e. https://gitlab.com/groups/gitlab-org/-/epics/3608 becomes [gitlab-org&3608](https://gitlab.com/groups/gitlab-org/-/epics/3608) and https://gitlab.com/gitlab-org/verify-stage/-/issues/548 becomes [gitlab-org/verify-stage#548](https://gitlab.com/gitlab-org/verify-stage/-/issues/548).

Personally I'm using it with a zsh function like this:

function swir() {
    formatted=$(gls_swirify-gitlab-item-url `pbpaste`)
    echo $formatted
    echo $formatted | pbcopy
}

That means whenever I have a GitLab item URL in my clipboard that I want to use when writing a SWIR item, I can just hop into my shell, type swir and then paste into the input field. I've wasted too much time creating these manually all the time, and I still sometimes mix up the order and create broken URLs.

It also works nicely in Alfred:

image

MR acceptance checklist

  • I've tested this change on: macOS/Linux.
  • This change needs no other test and thus no review, because: The ruby script itself is agnostic, making it actually useful will require some massaging into your personal workflows/tools. I'll merge it myself.
    • This does need at least 1 additional test on another machine, ideally using a different OS. I've facilitated this via: Slack thread / MR review.

Merge request reports