Skip to main content

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:

  1. lint on save in your IDE
  2. 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.

Release files for lintmon 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lintmon 0.2.0
File Size Uploaded
lintmon-0.2.0.tar.gz 14.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for lintmon 0.2.0
File Interpreter ABI Platform
lintmon-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 28.9 kB

Release files / lintmon-0.2.0.tar.gz

Download URL lintmon-0.2.0.tar.gz
Size 14.2 kB
Tags Source
SHA-256 checksum
How to use checksums
f803c929c8e308d5a0e9deb1bd17265534cd49b218e7603e6306f588f9f6fb7b
BLAKE2b-256 checksum
How to use checksums
ba8f93382879600a78115e4752889673dedc3f6e9807db819d73fb4cdc014fcb
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / lintmon-0.2.0-py3-none-any.whl

Download URL lintmon-0.2.0-py3-none-any.whl
Size 14.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
90342e1be40e5f7d830f094b4dd013817a04021ed48fe720f0b20c2e5bdfc9cf
BLAKE2b-256 checksum
How to use checksums
4e29350c3bfd933ca6e24459078124a36db23cbcb7921acd52f834fb923e33cf
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page