Monitor project files in the background for lint issues and flag issues in your prompt
Project description
lintmon
A tool for monitoring for lint errors. Provides a configurable way to specify checks to run on code in a given directory when it changes on disk, run those checks in the background and provide a fast way to display the outcome of the latest checks with a concise format suitable for embedding in your prompt.
It is designed for lint errors because these are quick to run and affect single files at a time, so in general they can be checked in the background with relatively low system impact, but in principle you could use it to trigger any sort of validation check, such as running unit tests.
Motivation
The two main ways of avoiding pushing lint errors to a repo it seemed to me were:
- lint on save in your IDE
- add git hooks on push to check for / fix lint errors
I didn't like either of those, because in both cases they happen synchronously while you are doing something and can cause disruptions. Also I push from the command line, so what I wanted was a warning at the point that I was going to push that was pre-calculated about errors.
This is that.
Configure
Install lintmon using pip
in your virtualenv (or wherever you install packages for use with your codebase):
pip install lintmon
Add a file like the lintmon.yaml file in this codebase to the root directory of your codebase. It tells lintmon what checks to do on files. It aims to be very configurable.
Add the following to your prompt in your .bashrc
or .zshrc
:
PS1='$([[ -e lintmon.yaml ]] && which lintmon-status-prompt >/dev/null && lintmon-status-prompt)'$PS1
That's it! lintmon-status-prompt
will start lintmond
automatically in the background when it is run, and from now on you should get a "badge" in your prompt when there are lint errors in your directory, which will be updated when you modify files.
Commands
lintmon-status
Output status of lintmon along with all current errors from the linters.
lintmon-stop
, lintmon-start
Tell lintmon to stop (and not restart automatically) or start again. Mostly useful for debugging lintmon. This will display an S
badge in your prompt to tell you it is stopped.
lintmon-run-all
Run all linters on all appropriate files in your project, thus "hydrating" lintmon's state if it hasn't been running for a while and changes have been made.
lintmond
Run the daemon in the shell (again mainly useful for debugging).
Directory structure
lintmon adds a .lintmon
directory to your project directory where it stores all its state about what current errors there are, lintmon's pid etc. You will probably want to add this to your .gitignore.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file lintmon-0.2.0.tar.gz
.
File metadata
- Download URL: lintmon-0.2.0.tar.gz
- Upload date:
- Size: 14.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f803c929c8e308d5a0e9deb1bd17265534cd49b218e7603e6306f588f9f6fb7b |
|
MD5 | 02e29786850eacf2454913fb36d66863 |
|
BLAKE2b-256 | ba8f93382879600a78115e4752889673dedc3f6e9807db819d73fb4cdc014fcb |
File details
Details for the file lintmon-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: lintmon-0.2.0-py3-none-any.whl
- Upload date:
- Size: 14.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 90342e1be40e5f7d830f094b4dd013817a04021ed48fe720f0b20c2e5bdfc9cf |
|
MD5 | b132c86ecf8f2c5df353fd3c14dc2bf6 |
|
BLAKE2b-256 | 4e29350c3bfd933ca6e24459078124a36db23cbcb7921acd52f834fb923e33cf |