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 [filename or dir...]

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

tryceratops --exclude tests --exclude .venv [filename or dir...]

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.2.2
    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 to define 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.2.tar.gz (443.7 kB view details)

Uploaded Source

Built Distribution

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

tryceratops-0.2.2-py3-none-any.whl (16.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for tryceratops-0.2.2.tar.gz
Algorithm Hash digest
SHA256 d196892457ba47eb5f2463ad4f5c44d11e0ef5f3421db842cf402e721e6bcff6
MD5 c9d9ffd326fd0e71eea4de7fba738e41
BLAKE2b-256 d5a9319e016f4a5e75828cb6596b285ce18eb8ef69a973fdd11e17bbdf79cb90

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for tryceratops-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6f0fe21ec68e58fd9f6116fff3c79d8f330c647fa03f5d3a806ba3f5dda4fef9
MD5 9f80351077d0d9ccb9cc2076ed0cf36a
BLAKE2b-256 f963aae01aeae59af8b8d918f312d22ddf3dabe4703a27b2004c5454f7426c02

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