GitXplorerGitXplorer
s

lemming

public
0 stars
0 forks
0 issues

Commits

List of commits on branch main.
Verified
a2012b2a3ef48405ddc3fe19519eab7d84c19b4d

ci: :fire: Remove codeql config

kkoviubi56 committed 2 years ago
Verified
596cb55f5a514d2a0b79eddf9172ca18b62b08a9

fix: :bug: Add support for mylog>=0.7.0 with logger names

kkoviubi56 committed 2 years ago
Verified
a61cea3c7ec329b07f5b678ee48d7721d8f7cc27

docs: :memo: Update readme

kkoviubi56 committed 2 years ago
Verified
89de69cd6bc6265c6af828e9f5c28744b21500ff

feat: :sparkles: Add `fail_fast` to config

kkoviubi56 committed 2 years ago
Verified
19b84331c4cb42ead25f52d5a65ba64602ab51b1

docs: :memo: Add confz to changelog

kkoviubi56 committed 2 years ago
Verified
a917d0f531ded538961667e56ee7a151bb0becf1

build: :heavy_plus_sign: Add confz as a dependency

kkoviubi56 committed 2 years ago

README

The README file for this repository.

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.8

Usage

1. Create the config

Lemming's config lives in these places:

  • in the .lemming.toml file
  • in the pyproject.toml file

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

The config looks like this:

fail_fast = false  # OPTIONAL, wheter or not immediately quit in case of an error

[[lemming.formatters]]
packages = ["example"]  # REQUIRED, the package(s) to install with pip (might include versions with "==x.y.z")
format_command = "{pyexe} -m example {path}"  # REQUIRED, the command to run to format the code ({pyexe} will be replaced with the python executable, {path} with the path passed to Lemming (usually the current working directory: "."))
check_command = "{pyexe} -m example --check {path}"  # OPTIONAL, the command to run to check the code (stuff will be replaced just like in format_command)
allow_nonzero_on_format = true  # OPTIONAL, if true it is allowed for the format_command to return a non-zero exit status

[[lemming.linters]]
packages = ["example"]  # REQUIRED, same as for formatters
command = "{pyexe} -m example {path}"  # REQUIRED, the command to run to lint the code (stuff will be replaced just like in format_command)
run_first = true  # OPTIONAL, if true this linter will be ran BEFORE formatters, and linters with this being false. Defaults to false.

2. Run Lemming

After installing Lemming, run

lemming {format,check} .

If you choose format, the format_commands will be ran, but if you choose check, the check_commands will be ran. Linters will be ran in both cases.

You can also use Lemming as a GitHub workflow, like this.

CLI usage

usage: lemming [-h] [-v] [-q] [--quiet-commands] [--quiet-pip] [-c CONFIG] [-V] {format,check} path

Lemming is a tool for formatting and linting code.

positional arguments:
  {format,check}        format the code with the formatters, or check the code with the formatters (linters will be ran in all cases)
  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
  --quiet-commands      don't let ran commands write to stdout and stderr. Use --quiet-pip to quiet `pip`
  --quiet-pip           don't let pip write to stdout and stderr. Use --quiet-commands to quiet the formatters and linters
  -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+