Skip to main content

A linter to manage your exception like a PRO!

Project description

Manage your exceptions in Python like a PRO

PyPI Code style: black Downloads

Currently in BETA. Inspired by this blog post.

“For those who like dinosaurs 🦖 and clean try/except ✨ blocks.”


Installation and usage

Installation

pip install tryceratops

Usage

tryceratops [filename or dir]

You can enable experimental analyzers by running:

tryceratops --experimental [filename or dir]

You can ignore specific violations by using: --ignore TCXXX repeatedly:

tryceratops --ignore TC201 --ignore TC202

You can exclude dirs by using: --exclude dir/path repeatedly:

tryceratops --exclude tests --exclude .venv

example

Violations

All violations and its descriptions can be found in docs.

Pre-commit

If you wish to use pre-commit, add this:

  - repo: https://github.com/guilatrova/tryceratops
    rev: v0.1.9
    hooks:
      - id: tryceratops

Configuration

You can set up a pyproject.toml file to set rules. This is useful to avoid reusing the same CLI flags over and over again and helps defining the structure of your project.

Example:

[tool.tryceratops]
exclude = ["samples"]
ignore = ["TC002", "TC200", "TC300"]
experimental = true

CLI flags always overwrite the config file.

License

MIT

Credits

Thanks to God for the inspiration 🙌 ☁️ ☀️

Logo icon was made by https://www.freepik.com

The black project for insights.

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

tryceratops-0.2.0.tar.gz (544.8 kB view details)

Uploaded Source

Built Distribution

tryceratops-0.2.0-py3-none-any.whl (16.1 kB view details)

Uploaded Python 3

File details

Details for the file tryceratops-0.2.0.tar.gz.

File metadata

  • Download URL: tryceratops-0.2.0.tar.gz
  • Upload date:
  • Size: 544.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.25.1

File hashes

Hashes for tryceratops-0.2.0.tar.gz
Algorithm Hash digest
SHA256 0a66110945670159d959be423ce6e8db08b929b90e6e79f23360112f40514b28
MD5 89402084e6ac8281fd8b9d5d56407839
BLAKE2b-256 c1c6011167fc62b72581beaec870316fe09d12941233ad5510c91dd87e2bf765

See more details on using hashes here.

File details

Details for the file tryceratops-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: tryceratops-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 16.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.25.1

File hashes

Hashes for tryceratops-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 742f0e2c67239fa1e9222c7e483320edb82b6be56863465fde2866bf74f7d031
MD5 4b4134c9d4e009286755747ddeb31582
BLAKE2b-256 61bd4e6b3740071d1c55011c8cbed50149b484b7bf9ae4261d47ff7445b8303f

See more details on using hashes here.

Supported by

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