{"id":13734022,"url":"https://github.com/guilatrova/tryceratops","last_synced_at":"2026-02-20T16:01:39.273Z","repository":{"id":38420757,"uuid":"378396677","full_name":"guilatrova/tryceratops","owner":"guilatrova","description":"A linter to prevent exception handling antipatterns in Python (limited only for those who like dinosaurs).","archived":false,"fork":false,"pushed_at":"2024-10-30T16:42:33.000Z","size":1563,"stargazers_count":446,"open_issues_count":9,"forks_count":25,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-10-21T19:12:36.171Z","etag":null,"topics":["code","hacktoberfest","linter","python","python3","static-analysis","static-code-analysis","styleguide","stylelint"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/guilatrova.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"docs/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"guilatrova","custom":"https://www.paypal.com/donate/?business=SUQKVABPUHUUQ\u0026no_recurring=0\u0026item_name=Thank+you+very+much+for+considering+supporting+my+work.+%E2%9D%A4%EF%B8%8F+It+keeps+me+motivated+to+keep+producing+value+for+you.\u0026currency_code=USD"}},"created_at":"2021-06-19T11:33:40.000Z","updated_at":"2025-10-18T17:33:36.000Z","dependencies_parsed_at":"2022-07-20T12:48:57.974Z","dependency_job_id":"e13bf42d-195c-4da9-bcda-de359d31873f","html_url":"https://github.com/guilatrova/tryceratops","commit_stats":{"total_commits":210,"total_committers":8,"mean_commits":26.25,"dds":0.09523809523809523,"last_synced_commit":"130a7f2a512aaeefb6bb7faaced75d8865ce9b26"},"previous_names":[],"tags_count":29,"template":false,"template_full_name":null,"purl":"pkg:github/guilatrova/tryceratops","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guilatrova%2Ftryceratops","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guilatrova%2Ftryceratops/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guilatrova%2Ftryceratops/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guilatrova%2Ftryceratops/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/guilatrova","download_url":"https://codeload.github.com/guilatrova/tryceratops/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guilatrova%2Ftryceratops/sbom","scorecard":{"id":448532,"data":{"date":"2025-08-11","repo":{"name":"github.com/guilatrova/tryceratops","commit":"ca149be9a5c6169b77bf70991d2f87661158d283"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.9,"checks":[{"name":"Code-Review","score":1,"reason":"Found 3/22 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/ci.yml:1","Warn: no topLevel permission defined: .github/workflows/release.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:34: update your workflow using https://app.stepsecurity.io/secureworkflow/guilatrova/tryceratops/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:41: update your workflow using https://app.stepsecurity.io/secureworkflow/guilatrova/tryceratops/ci.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:54: update your workflow using https://app.stepsecurity.io/secureworkflow/guilatrova/tryceratops/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/guilatrova/tryceratops/release.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:24: update your workflow using https://app.stepsecurity.io/secureworkflow/guilatrova/tryceratops/release.yml/main?enable=pin","Info:   0 out of   4 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact v2.4.1 not signed: https://api.github.com/repos/guilatrova/tryceratops/releases/182742514","Warn: release artifact v2.4.0 not signed: https://api.github.com/repos/guilatrova/tryceratops/releases/170896234","Warn: release artifact v2.3.3 not signed: https://api.github.com/repos/guilatrova/tryceratops/releases/164449432","Warn: release artifact v2.3.2 not signed: https://api.github.com/repos/guilatrova/tryceratops/releases/103935052","Warn: release artifact v2.3.1 not signed: https://api.github.com/repos/guilatrova/tryceratops/releases/103695946","Warn: release artifact v2.4.1 does not have provenance: https://api.github.com/repos/guilatrova/tryceratops/releases/182742514","Warn: release artifact v2.4.0 does not have provenance: https://api.github.com/repos/guilatrova/tryceratops/releases/170896234","Warn: release artifact v2.3.3 does not have provenance: https://api.github.com/repos/guilatrova/tryceratops/releases/164449432","Warn: release artifact v2.3.2 does not have provenance: https://api.github.com/repos/guilatrova/tryceratops/releases/103935052","Warn: release artifact v2.3.1 does not have provenance: https://api.github.com/repos/guilatrova/tryceratops/releases/103695946"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 13 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":3,"reason":"7 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: PYSEC-2024-48 / GHSA-fj7x-q9j7-g6q6","Warn: Project is vulnerable to: GHSA-79v4-65xg-pq4g","Warn: Project is vulnerable to: GHSA-h4gh-qq45-vh27","Warn: Project is vulnerable to: GHSA-9hjg-9r4m-mvj7","Warn: Project is vulnerable to: GHSA-48p4-8xcf-vxj5","Warn: Project is vulnerable to: GHSA-pq67-6m6q-mj2v","Warn: Project is vulnerable to: PYSEC-2024-187 / GHSA-rqc4-2hc7-8c8v"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-19T07:32:44.367Z","repository_id":38420757,"created_at":"2025-08-19T07:32:44.367Z","updated_at":"2025-08-19T07:32:44.367Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29656589,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-20T09:27:29.698Z","status":"ssl_error","status_checked_at":"2026-02-20T09:26:12.373Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["code","hacktoberfest","linter","python","python3","static-analysis","static-code-analysis","styleguide","stylelint"],"created_at":"2024-08-03T03:00:51.791Z","updated_at":"2026-02-20T16:01:39.255Z","avatar_url":"https://github.com/guilatrova.png","language":"Python","funding_links":["https://github.com/sponsors/guilatrova","https://www.paypal.com/donate/?business=SUQKVABPUHUUQ\u0026no_recurring=0\u0026item_name=Thank+you+very+much+for+considering+supporting+my+work.+%E2%9D%A4%EF%B8%8F+It+keeps+me+motivated+to+keep+producing+value+for+you.\u0026currency_code=USD"],"categories":["Python","Clean code"],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://raw.githubusercontent.com/guilatrova/tryceratops/main/img/logo.png\"\u003e\n\u003c/p\u003e\n\n\u003ch2 align=\"center\"\u003ePrevent Exception Handling AntiPatterns in Python\u003c/h2\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/guilatrova/tryceratops/actions\"\u003e\u003cimg alt=\"Actions Status\" src=\"https://github.com/guilatrova/tryceratops/workflows/CI/badge.svg\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://pypi.org/project/tryceratops/\"\u003e\u003cimg alt=\"PyPI\" src=\"https://img.shields.io/pypi/v/tryceratops\"/\u003e\u003c/a\u003e\n  \u003cimg src=\"https://badgen.net/pypi/python/tryceratops\" /\u003e\n  \u003ca href=\"https://github.com/relekang/python-semantic-release\"\u003e\u003cimg alt=\"Semantic Release\" src=\"https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/guilatrova/tryceratops/blob/main/LICENSE\"\u003e\u003cimg alt=\"GitHub\" src=\"https://img.shields.io/github/license/guilatrova/tryceratops\"/\u003e\u003c/a\u003e\n  \u003ca href=\"https://pepy.tech/project/tryceratops/\"\u003e\u003cimg alt=\"Downloads\" src=\"https://static.pepy.tech/personalized-badge/tryceratops?period=total\u0026units=international_system\u0026left_color=grey\u0026right_color=blue\u0026left_text=%F0%9F%A6%96%20Downloads\"/\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/psf/black\"\u003e\u003cimg alt=\"Code style: black\" src=\"https://img.shields.io/badge/code%20style-black-000000.svg\"/\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/guilatrova/tryceratops\"\u003e\u003cimg alt=\"try/except style: tryceratops\" src=\"https://img.shields.io/badge/try%2Fexcept%20style-tryceratops%20%F0%9F%A6%96%E2%9C%A8-black\" /\u003e\u003c/a\u003e\n  \u003ca href=\"https://twitter.com/intent/user?screen_name=guilatrova\"\u003e\u003cimg alt=\"Follow guilatrova\" src=\"https://img.shields.io/twitter/follow/guilatrova?style=social\"/\u003e\u003c/a\u003e\n\u003c/p\u003e\n\nInspired by [this blog post](https://blog.guilatrova.dev/handling-exceptions-in-python-like-a-pro/). I described [the building process of this tool here](https://blog.guilatrova.dev/project-tryceratops/).\n\n\u003e “For those who like dinosaurs 🦖 and clean try/except ✨ blocks.”\n\n**Summary**\n- [Installation and usage](#installation-and-usage)\n  - [Installation](#installation)\n  - [Usage](#usage)\n  - [`flake8` Plugin](#flake8-plugin)\n- [Violations](#violations)\n  - [Autofix support](#autofix-support)\n  - [Ignoring violations](#ignoring-violations)\n  - [Configuration](#configuration)\n- [Pre-commit](#pre-commit)\n- [Show your style](#show-your-style)\n- [Extra Resources](#extra-resources)\n- [Contributing](#contributing)\n- [Change log](#change-log)\n- [License](#license)\n- [Credits](#credits)\n\n---\n\n## Installation and usage\n\n### Installation\n\n```\npip install tryceratops\n```\n\nOR\n\n```\npoetry add -D tryceratops\n```\n\n### Usage\n\n```\ntryceratops [filename or dir...]\n```\n\nYou can enable experimental analyzers by running:\n\n```\ntryceratops --experimental [filename or dir...]\n```\n\nYou can ignore specific violations by using: `--ignore TRYXXX` repeatedly:\n\n```\ntryceratops --ignore TRY201 --ignore TRY202 [filename or dir...]\n```\n\nYou can exclude dirs by using: `--exclude dir/path` repeatedly:\n\n```\ntryceratops --exclude tests --exclude .venv [filename or dir...]\n```\n\nYou can also autofix some violations:\n\n```\ntryceratops --autofix [filename or dir...]\n```\n\n![example](https://raw.githubusercontent.com/guilatrova/tryceratops/main/img/tryceratops-example3.gif)\n\n### [`flake8`](https://github.com/PyCQA/flake8) Plugin\n\n🦖 Tryceratops is also a plugin for `flake8`, so you can:\n\n```\n❯ flake8 --select TRY src/tests/samples/violations/call_raise_vanilla.py\nsrc/tests/samples/violations/call_raise_vanilla.py:13:9: TRY002 Create your own exception\nsrc/tests/samples/violations/call_raise_vanilla.py:13:9: TRY003 Avoid specifying long messages outside the exception class\nsrc/tests/samples/violations/call_raise_vanilla.py:21:9: TRY201 Simply use 'raise' without specifying exception object again\n```\n\n## Violations\n\nAll violations and its descriptions can be found in [docs](https://github.com/guilatrova/tryceratops/tree/main/docs/violations).\n\n### Autofix support\n\nSo far, autofix only supports violations: [TRY200](docs/violations/TRY200.md), [TRY201](docs/violations/TRY201.md), and [TRY400](docs/violations/TRY400.md).\n\n### Ignoring violations\n\nIf you want to ignore a violation in a specific file, you can either:\n\n- Add a comment with `noqa` to the top of the file you want to ignore\n- Add a comment with `noqa` to the line you want to ignore\n- Add a comment with `noqa: CODE` to the line you want to ignore a specific violation\n\nExample:\n\n```py\ndef verbose_reraise_1():\n    try:\n        a = 1\n    except Exception as ex:\n        raise ex  # noqa: TRY202\n```\n\n### Configuration\n\nYou can set up a `pyproject.toml` file to set rules.\nThis is useful to avoid reusing the same CLI flags over and over again and helps to define the structure of your project.\n\nExample:\n\n```toml\n[tool.tryceratops]\nexclude = [\"samples\"]\nignore = [\"TRY002\", \"TRY200\", \"TRY300\"]\nexperimental = false\ncheck_pickable = false\nallowed_base_exceptions = [\"MyAppBase\"]\n```\n\nCLI flags always overwrite the config file.\n\n## Pre-commit\n\nIf you wish to use pre-commit, add this:\n\n```yaml\n  - repo: https://github.com/guilatrova/tryceratops\n    rev: v2.4.1\n    hooks:\n      - id: tryceratops\n```\n\n## Show your style\n\n[![try/except style: tryceratops](https://img.shields.io/badge/try%2Fexcept%20style-tryceratops%20%F0%9F%A6%96%E2%9C%A8-black)](https://github.com/guilatrova/tryceratops)\n\nAdd this fancy badge to your project's `README.md`:\n\n```md\n[![try/except style: tryceratops](https://img.shields.io/badge/try%2Fexcept%20style-tryceratops%20%F0%9F%A6%96%E2%9C%A8-black)](https://github.com/guilatrova/tryceratops)\n```\n\n## Extra Resources\n\nIf you want to read more about:\n\n- [How to structure exceptions in Python 🐍 🏗️ 💣](https://blog.guilatrova.dev/how-to-structure-exception-in-python-like-a-pro/)\n- [How to log in Python 🐍🌴](https://blog.guilatrova.dev/how-to-log-in-python-like-a-pro/)\n- [Book: Effective Python](https://amzn.to/3bEVHpG)\n\n## Contributing\n\nThank you for considering making Tryceratops better for everyone!\n\nRefer to [Contributing docs](docs/CONTRIBUTING.md).\n\n## Change log\n\nSee [CHANGELOG](CHANGELOG.md).\n\n## License\n\nMIT\n\n## Credits\n\nThanks to God for the inspiration 🙌 ☁️ ☀️\n\nThe [black](https://github.com/psf/black) project for insights.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguilatrova%2Ftryceratops","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fguilatrova%2Ftryceratops","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguilatrova%2Ftryceratops/lists"}