You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

pystolint

Package Overview
Dependencies
Maintainers
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pystolint

Linters composer

0.2.15
Source
pipPyPI
Maintainers
3

🔫 pystolint 🔫

Yet another python linter?

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

Why?

I'm fed up with:

  • Having to copy settings for every single project. (at least until "parent pyproject.toml" is not invented)
  • Not being able to apply checks only to git diffs, which makes it hard to add linters to large projects
  • 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:

  • 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 .
  • 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())
  • 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

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)

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts