A package for espanso/espanso.
Takes URLs from the clipboard and inserts a formatted link based on it.
Requirements: Python >= 3.9
Unfortunately, we have to perform the installation with a little bit more finger-grease as we are used to (Discussion):
# cd anywhere/you/want
git clone git@github.com:reitzig/espanso-nice-dev-refs.git
cd espanso-nice-dev-refs
espanso install nice-dev-refs --git "$(realpath "$(pwd)")" --external
mkdir -p ~/.config/espanso/scripts/
ln -s "$(realpath "$(pwd)")"/scripts/*.py ~/.config/espanso/scripts/
For more selective application refer to Include and Exclude rules
🥳 Support for additional URL patterns is welcome – unless and until replace performance decreases too much. To limit the scope somewhat, let's stick to things you link to all the time in software development.
Whether you want to fix a bug or add a feature,
- add at least one (red) test,
- make it green,
- make sure
ruff
does not complain, and - create a PR.
ℹ️ While the code structure is simple in its spaghettific glory, the construction of and interaction between the different regexps is definitely bespoke. The approach here is to tame weird code with tests; if there is no test for any given URL schema, the behaviour is undefined. If your change does not break any tests, go for it!
Prepare a checkout of your fork:
mise install # if you want to
uv sync
# activate .venv
Now you should be able to run the relevant commands:
ruff format . # formatting
ruff check . # linting
pytest # testing
For convenience, there are also
poe lint
poe test
We include configuration for evilmartians/lefthook which we encourage you to use:
lefthook install
We also consider
direnv/direnv
to be inherently useful,
and therefore include our
.envrc
.