Skip to main content

Linters composer

Project description

🔫 pystolint 🔫

Yet another python linter?

No. It's just a runner for ruff + mypy with these settings

Why?

I'm fed up with:

  1. Having to copy settings for every single project. (at least until "parent pyproject.toml" is not invented)
  2. Not being able to apply checks only to git diffs, which makes it hard to add linters to large projects
  3. Not being able to deprecate certain things and preventing them in new code.

Install

Simple:

  • pip install pystolint

or

  • pip install git+ssh://git@github.com/hhru/pystolint.git@master

Dev:

  1. Clone repo
git clone git@github.com:hhru/pystolint.git ~/projects/pystolint
cd ~/projects/pystolint
python -m venv .venv
source .venv/bin/activate
pip install -e .
  1. Create global shortcut (/usr/local/bin/pys):
  #!/path/to/your/pystolint/.venv/bin/python
  import sys
  from pystolint.main import main

  if __name__ == '__main__':
    sys.exit(main())
  1. Make executable:
chmod +x /usr/local/bin/pys

Usage

Check code:

pys check .
pys check path1 path2
pys check --diff

Format code:

pys format .
pys format path1 path2

Tools

You can use specific tool for checking/formatting:

pys check --tool mypy .

This will run mypy only. Be aware that mypy requires pydantic as a project dependency by default. You can disable this requirement by editing tool.mypy.plugins in pyproject.toml or add extra 'pydantic' to pystolint dependency.

Settings

Can be specified from cli or pyproject.toml. Cli settings have bigger priority

example toml:

[tool.pystolint]
base_toml_path = "/path/to/shared/config.toml"
base_branch_name = "develop"

cli:

  • --base_toml_path - path or link for replace pystolint default settings
  • --base_branch_name - branch name from which to get diff (default is master)
  • --config - specify path to local toml configs (default is pyproject.toml in current dir)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pystolint-0.6.1.tar.gz (27.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pystolint-0.6.1-py3-none-any.whl (24.6 kB view details)

Uploaded Python 3

File details

Details for the file pystolint-0.6.1.tar.gz.

File metadata

  • Download URL: pystolint-0.6.1.tar.gz
  • Upload date:
  • Size: 27.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.24

File hashes

Hashes for pystolint-0.6.1.tar.gz
Algorithm Hash digest
SHA256 daa58dad22693505147eb31dea9b273bb8f323c381d0f844a29c123b5be8a8e2
MD5 a16e9bfd77f9ed7f6ef5a340adbd88a6
BLAKE2b-256 9171c6c0161fa2b5ca477ffc129994b97ce2972180f5e13f9ff5b79482b22c91

See more details on using hashes here.

File details

Details for the file pystolint-0.6.1-py3-none-any.whl.

File metadata

  • Download URL: pystolint-0.6.1-py3-none-any.whl
  • Upload date:
  • Size: 24.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.24

File hashes

Hashes for pystolint-0.6.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b133d582faf76a5fd1a8714d0d8f13a6ce07d51afd5b9f2f941b9cf56c441f11
MD5 e43981aaa822bc8179bb5ad72eeb721b
BLAKE2b-256 118d2a5436306f50f4109c5cd52e2faa6c4f4555e2008ae388937d7ce5a3ed62

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page