As an engineer, I like to do things in as few steps as possible. If I can automate something, I will. However, one day I was complaining to my boss Ross about GitHub PRs and whitespaces.
It takes me three clicks to remove the whitespace from any PR. That’s at least two clicks too many in my opinion.
To ease my aching hand—and erase the black mark inefficiency leaves on my soul—my boss Ross showed me this little bookmark he made:
Voila! With one click, I could get rid of all the whitespace in a PR and focus on the code I actually wanted to (i.e., functionality that changed).
How to add this shortcut
- Create a new bookmark. You can name it
github whitespace
or whatever you like. - Edit your new bookmark.
- Add the following JavaScript script which will add the remove whitespace command to your window:
javascript: (() => { window.location += '?w=1%27; })();
- Save your bookmark.
- Go to a Github PR with a ton of whitespace changes.
- Click on your bookmark.
- Witness the magic!
Inefficiency be gone!
Brought to you by Krys Flores
Top comments (0)