{"id":13745837,"url":"https://github.com/hchasestevens/bellybutton","last_synced_at":"2025-10-11T18:06:06.696Z","repository":{"id":48669712,"uuid":"121833171","full_name":"hchasestevens/bellybutton","owner":"hchasestevens","description":"Custom Python linting through AST expressions","archived":false,"fork":false,"pushed_at":"2023-07-27T15:12:10.000Z","size":179,"stargazers_count":276,"open_issues_count":11,"forks_count":13,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-09-25T15:42:23.742Z","etag":null,"topics":["abstract-syntax-tree","ast","linter","linting","python","static-analysis"],"latest_commit_sha":null,"homepage":null,"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/hchasestevens.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"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}},"created_at":"2018-02-17T06:31:44.000Z","updated_at":"2025-07-27T15:42:25.000Z","dependencies_parsed_at":"2024-04-11T15:55:51.743Z","dependency_job_id":"d842b2a4-b3a7-428e-8ced-51ed6fd51516","html_url":"https://github.com/hchasestevens/bellybutton","commit_stats":{"total_commits":31,"total_committers":6,"mean_commits":5.166666666666667,"dds":"0.19354838709677424","last_synced_commit":"d80f72056cb3884da3ad03a1005c3697da23fd92"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hchasestevens/bellybutton","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hchasestevens%2Fbellybutton","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hchasestevens%2Fbellybutton/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hchasestevens%2Fbellybutton/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hchasestevens%2Fbellybutton/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hchasestevens","download_url":"https://codeload.github.com/hchasestevens/bellybutton/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hchasestevens%2Fbellybutton/sbom","scorecard":{"id":458597,"data":{"date":"2025-08-11","repo":{"name":"github.com/hchasestevens/bellybutton","commit":"68b1f2670f9166350f66461735c3017843f01e12"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.6,"checks":[{"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":"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":"Dangerous-Workflow","score":-1,"reason":"no workflows found","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":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"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":"Code-Review","score":1,"reason":"Found 5/30 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":"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":"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":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"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":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"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":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"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 18 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"}}]},"last_synced_at":"2025-08-19T10:27:50.076Z","repository_id":48669712,"created_at":"2025-08-19T10:27:50.076Z","updated_at":"2025-08-19T10:27:50.076Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279008295,"owners_count":26084427,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-11T02:00:06.511Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["abstract-syntax-tree","ast","linter","linting","python","static-analysis"],"created_at":"2024-08-03T06:00:38.897Z","updated_at":"2025-10-11T18:06:06.681Z","avatar_url":"https://github.com/hchasestevens.png","language":"Python","funding_links":[],"categories":["Python","Linters \u0026 Style Checkers","Programming Languages"],"sub_categories":[],"readme":"# bellybutton\n\n[![Build Status](https://travis-ci.org/hchasestevens/bellybutton.svg?branch=master)](https://travis-ci.org/hchasestevens/bellybutton) [![PyPI version](https://badge.fury.io/py/bellybutton.svg)](https://badge.fury.io/py/bellybutton) ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/bellybutton.svg)\n\n\u003cimg src=\"demo.gif\" width=\"642\"\u003e\n\n`bellybutton` is a customizable, easy-to-configure linting engine for Python. \n\n## What is this good for?\n\nTools like [pylint](https://www.pylint.org/) and [flake8](http://flake8.pycqa.org/en/latest/#) provide, \nout-of-the-box, a wide variety of rules for enforcing Python best practices, ensuring PEP-8 compliance, \nand avoiding frequent sources of bugs. However, many projects have project-specific candidates for \nstatic analysis, such as internal style guides, areas of deprecated functionality, or common sources \nof error. This is especially true of those projects with many contributors or with large or legacy \ncodebases.\n\n`bellybutton` allows custom linting rules to be specified on a per-project basis and detected as part of\nyour normal build, test and deployment process and, further, makes specifying these rules highly \naccessible, greatly lowering the cost of adoption.\n\nGive `bellybutton` a try if:\n* You find yourself making the same PR comments over and over again\n* You need a means of gradually deprecating legacy functionality\n* You're looking to build a self-enforcing style guide\n* Your project needs to onboard new or junior developers more quickly and effectively\n* You have Python nitpicks that go beyond what standard linting tools enforce\n\n## Installation \u0026 getting started \n\n`bellybutton` can be installed via:\n```bash\npip install bellybutton\n```\n\nOnce installed, running\n```bash\nbellybutton init\n```\nin your project's root directory will create a `.bellybutton.yml` configuration file with an example \nrule for you to begin adapting. `bellybutton` will also try to provide additional rule settings based\non the directory structure of your project.\n\nOnce you have configured `bellybutton` for your project, running \n```bash\nbellybutton lint\n```\nwill lint the project against the rules specified in your `.bellybutton.yml`. Additionally, running\n```bash\nbellybutton lint --modified-only\n```\nwill, if using git, only lint those files that differ from `origin/master`.\n\nFor adding `bellybutton` to your CI pipeline, take a look at this repository's [tox configuration](tox.ini)\nand [.travis.yml](.travis.yml) as an example.\n\n## Concepts\n\n### Rules\n\nRules in `bellybutton` supply patterns that should be caught and cause linting to fail. Rules as specified\nin your `.bellybutton.yml` configuration must consist of:\n* A description `description`, expressing the meaning of the rule\n* An expression `expr`, specifying the pattern to be caught - either as an \n[astpath](https://github.com/hchasestevens/astpath) expression or as a regular expression (`!regex ...`).\n\nAdditionally, the key used for the rule within the `rules` mapping serves as its name.\n\nRules may also consist of:\n* Settings `settings` that specify on which files the rule is to be enforced, as well as whether it can be\nignored via a `# bb: ignore` comment\n* An example `example` of Python code that would be matched by the rule\n* A counter-example `instead` of an alternative piece of code, for guiding the developer in fixing their\nlinting error.\n\nThese `example` and `instead` clauses are checked at run-time to ensure that they respectively are and are not\nmatched by the rule's `expr`.\n\nAs an example, a rule to lint for a deprecated function call using an [astpath](https://github.com/hchasestevens/astpath) expression might look like:\n```yaml\nDeprecatedFnCall:\n  description: `deprecated_fn` will be deprecated in v9.1.2. Please use `new_fn` instead.\n  expr: //Call[func/Name/@id='deprecated_fn']\n  example: \"deprecated_fn(*values)\"\n  instead: \"new_fn(values)\"\n```\n\n### Settings\n\n`!settings` nodes specify:\n* `included` paths on which rules are to be run, using [glob notation](https://docs.python.org/3.6/library/glob.html)\n* `excluded` paths on which rules are not to be run (even when matching the `included` paths)\n* A boolean `allow_ignore` which determines whether rules can be ignored, providing the line matching the\nrule has a `# bb: ignore` comment.\n\nAdditionally, at the root level of `.bellybutton.yml`, a `default_settings` setting may be specified which\nwill be used by rules without explicit settings. Each rule must either have a `settings` parameter or be\nable to fall back on the `default_settings`.\n\nAs an example, a `!settings` node to lint only a specific module might look like:\n```yaml\nmy_module_settings: !settings\n  included:\n    - ~+/my_package/my_module.py\n  excluded: []\n  allow_ignore: no\n```\n\n## Example usage\n\nCheck out this repository's [`.bellybutton.yml`](.bellybutton.yml) as an example `bellybutton` configuration file, \nand [`astpath`'s README](https://github.com/hchasestevens/astpath/blob/master/README.md) for examples of the types \nof patterns you can lint for using `bellybutton`.\n\n## Development status\n\n`bellybutton` is in an alpha release and, as such, is missing some key features, documentation, \nand full test coverage. Further, `bellybutton` is not optimized for performance on extremely large \ncodebases and may contain breaking bugs. Please report any bugs encountered.\n\n### Known issues:\n* The `!chain` and `!verbal` expression nodes are not yet implemented\n\n## Contacts\n\n* Name: [H. Chase Stevens](http://www.chasestevens.com)\n* Twitter: [@hchasestevens](https://twitter.com/hchasestevens)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhchasestevens%2Fbellybutton","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhchasestevens%2Fbellybutton","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhchasestevens%2Fbellybutton/lists"}