A repository containing LGTM-related gifs and images for PR approvals and merges.
View all the available images and gifs in the gallery page.
This project is just for personal use, so it is not published on PyPI.
Using pipx (Python 3.8+ only) to install directly from github:
$ pipx install git+https://github.com/thatlittleboy/lgtm-db
This project exposes a simple CLI API that prints out the HTML img tag of a randomly selected gif/image in the db.
$ lgtm-db
<img alt="wwe-referee-thumbsup" src="https://c.tenor.com/JS6Vtap-SYEAAAAC/wwe-wrestling.gif" width="500" height="390">
You can then pipe the result into pbcopy
etc. to copy the result into your clipboard.
WARNING: API is very much subject to change.
usage: lgtm-db [-h] [-V] [-I PATTERN] [-E PATTERN] [-wd WIDTH]
Get a randomly-generated LGTM gif or image.
optional arguments:
-h, --help show this help message and exit
-V, --version show program's version number and exit
-I PATTERN, --include PATTERN
Apply an inclusive filter on the list of gifs before random choice (matches
are included). The filter condition is treated as a regex query if it starts
with ^ and ends with $. For non-regex conditions, a simple substring check is
used. Multiple conditions are supported. Exclusions are given higher priority
over inclusions.
-E PATTERN, --exclude PATTERN
Apply an exclusive filter on the list of gifs before random choice (matches
are excluded). The filter condition is treated as a regex query if it starts
with ^ and ends with $. For non-regex conditions, a simple substring check is
used. Multiple conditions are supported. Exclusions are given higher priority
over inclusions.
-wd WIDTH, --width WIDTH
Specify the width of the output gif. A non-positive width will result in an
error. Only applicable for HTML.
You need to install Greasemonkey / Tampermonkey, and invoke a user script to insert a random gif into the message box (upon PR approval, or any other Javascript event you like).
Sample user scripts for Gitlab and Github are found in the scripts folder.
Demo usage in Github PR
greasemonkey-demo-gh.mp4
Pip install in editable mode (in a virtualenv).
(venv) $ pip install -e ".[dev]"
Some personal notes on creating/editing gifs are in the Github wiki.
- Create a new branch called
release-v1.10.0
, for example, from themain
branch. - Bump the version number in
__version__.py
and commit with a commit messagerelease: v1.10.0
. And push up to remote. - Create a PR, attach the following output
to the PR description. Merge this branch into
git log --oneline --no-decorate --perl-regexp --author='^(?!.*\[bot\]).*$' HEAD ^v1.9.0
main
. - Then tag the ref,
git tag v1.10.0
, for example, on themain
branch. Push the tags to remote.
Inspiration from the following repositories: