Skip to main content

Lemming

Hits-of-Code Codacy Badge CodeFactor Grade Code style: black semantic-release GitHub PyPI PyPI - Python Version PyPI - Format

Lemming is a tool for formatting and linting your code. With Lemming, everyone will use the same formatters and linters, with the same version.

Installation

Use the package manager pip to install Lemming. Need more help?

pip install python-lemming

Requirements

Lemming requires Python 3.11

Usage

1. Create the config

Lemming's config lives in these places:

  • in the .lemming.toml file,
  • in the .github/.lemming.toml file,
  • in the pyproject.toml file,
  • all of the above files in the parent directories, and in $XDG_CONFIG_HOME, and in $XDG_CONFIG_DIRS.

Please note, that there must be a lemming or tool.lemming key in the config file.

The config looks like this:

[[lemming.formatters]]
package = "example"  # REQUIRED, the package to run as `/path/to/python -m <package> <args>`
version = "1.2.3"  # OPTIONAL, defaults to the latest stable version
args = "--ignore=joe {path}"  # OPTIONAL, {path} will be replaced by the path passed to Lemming, or the current working directory by default
allow_nonzero = true  # OPTIONAL, only allowed for formatters. If true, the formatter is allowed to return a non-zero exit status. Defaults to false.
also_install = ["example-plugin"]  # OPTIONAL, these packages will also be installed
install_name = "python-example"  # OPTIONAL, the package to install. Defaults to the value of `package`

[[lemming.linters]]
# same as for formatters (except for `allow_nonzero`)

2. Run Lemming

After installing Lemming, run

lemming .

CLI usage

usage: lemming [-h] [-v] [-q] [-c CONFIG] [-V] path

Lemming is a tool for formatting and linting code.

positional arguments:
  path                  the paths (files and directories) to check. these arguments will be passed to the formatters and linters as arguments where {path} is used

options:
  -h, --help            show this help message and exit
  -v, --verbose         log more information
  -q, --quiet           log less information. can be passed multiple times
  -c CONFIG, --config CONFIG
                        the config file to use. if passed all other config files will be ignored
  -V, --version         print the program's version and exit

Support

Questions should be asked in the Discussions tab.

Feature requests and bug reports should be reported in the Issues tab.

Security vulnerabilities should be reported as described in our Security policy (in the SECURITY.md file).

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to add entries to the changelog.

For more information, please read the contributing guidelines.

Authors and acknowledgments

A list of nice people who helped this project can be found in the CONTRIBUTORS file.

License

GNU GPLv3+

Metadata

Release files for python-lemming 0.1.3

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

Source distribution (sdist)

Source distribution for python-lemming 0.1.3
File Size Uploaded
python-lemming-0.1.3.tar.gz 23.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for python-lemming 0.1.3
File Interpreter ABI Platform
python_lemming-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 47.5 kB

Release files / python-lemming-0.1.3.tar.gz

Download URL python-lemming-0.1.3.tar.gz
Size 23.9 kB
Tags Source
SHA-256 checksum
How to use checksums
6aab9f9f54574351adffb809f3622021c3090a7f0152a36ba9239e904eee5b36
BLAKE2b-256 checksum
How to use checksums
fa5b8a4622233854b3989345ec4fc7c6fca55b98d42f49b14130e10b5ecc3f79
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.12.0a1

Release files / python_lemming-0.1.3-py3-none-any.whl

Download URL python_lemming-0.1.3-py3-none-any.whl
Size 23.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
605bcd809eb7a11ff30f49eff77cee7d0c0213682f2a9d655e4eac95017eea5a
BLAKE2b-256 checksum
How to use checksums
97c55bf7d16c509e7b289eb624da1f23cf11a759279b58bd9eca51597192a721
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.12.0a1

Release history Release notifications | RSS feed

0.7.0

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

This release

0.1.3 This release

2 release files

0.1.2

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