{"id":13502322,"url":"https://github.com/justinabrahms/imhotep","last_synced_at":"2025-12-30T14:43:16.202Z","repository":{"id":5975736,"uuid":"7197654","full_name":"justinabrahms/imhotep","owner":"justinabrahms","description":"A static-analysis bot for Github","archived":true,"fork":false,"pushed_at":"2023-06-17T04:37:59.000Z","size":698,"stargazers_count":223,"open_issues_count":19,"forks_count":40,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-03-20T16:11:10.071Z","etag":null,"topics":[],"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/justinabrahms.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}},"created_at":"2012-12-17T01:26:32.000Z","updated_at":"2024-10-05T16:11:53.000Z","dependencies_parsed_at":"2024-01-07T12:22:39.939Z","dependency_job_id":"41dcbdf8-fd60-459b-bf10-2b7887103561","html_url":"https://github.com/justinabrahms/imhotep","commit_stats":{"total_commits":321,"total_committers":19,"mean_commits":"16.894736842105264","dds":0.4361370716510904,"last_synced_commit":"046ec49f7d337fcbcd81dd30b883a3c4bcf6ecc0"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justinabrahms%2Fimhotep","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justinabrahms%2Fimhotep/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justinabrahms%2Fimhotep/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justinabrahms%2Fimhotep/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/justinabrahms","download_url":"https://codeload.github.com/justinabrahms/imhotep/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246174207,"owners_count":20735406,"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","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":[],"created_at":"2024-07-31T22:02:10.013Z","updated_at":"2025-12-13T21:05:44.864Z","avatar_url":"https://github.com/justinabrahms.png","language":"Python","funding_links":[],"categories":["Python","Linters \u0026 Style Checkers"],"sub_categories":[],"readme":"![Imhotep](https://raw.github.com/justinabrahms/imhotep/master/imhotep.png)\n# Imhotep, the peaceful builder.\n\n[![Build Status](https://app.travis-ci.com/justinabrahms/imhotep.svg?branch=master)](https://app.travis-ci.com/github/justinabrahms/imhotep)\n[![codecov.io](http://codecov.io/github/justinabrahms/imhotep/coverage.svg?branch=master)](http://codecov.io/github/justinabrahms/imhotep?branch=master)\n[![Requirements Status](https://requires.io/github/justinabrahms/imhotep/requirements.svg?branch=master)](https://requires.io/github/justinabrahms/imhotep/requirements/?branch=master)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit\u0026logoColor=white)](https://github.com/pre-commit/pre-commit)\n\n## What is it?\nImhotep is a tool which will comment on commits coming into your\nrepository and check for syntactic errors and general lint\nwarnings.\n\n**NOTE**: This repository has been archived, as it's been superceeded by GitHub's [check annotations](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/collaborating-on-repositories-with-code-quality-features/about-status-checks#checks) feature.\n\n## Installation\n\nCurrently, installation is done from source through Python packaging\nsystem. We first need to download it from GitHub. We then setup a\nvirtualenv which will keep our python packages separate from other\nthings on your system, lest we have version conflicts. Finally, we\ninstall the required packages.\n\n```bash\nvirtualenv env\n. env/bin/activate\npip install imhotep\n```\n\nIf you want to hack on imhotep, that looks more like this:\n\n```bash\ngit clone git://github.com/justinabrahms/imhotep.git\ncd imhotep\nvirtualenv env\n. env/bin/activate\npip install -r requirements.txt\npip install -e .\n```\n\nYou'll also need to install the plugins you'd like to run. Examples\ninclude [jshint](https://github.com/justinabrahms/imhotep_jshint),\n[flake8](https://github.com/glogiotatidis/imhotep_flake8),\n[pep8](https://github.com/justinabrahms/imhotep_pep8),\n[pylint](https://github.com/justinabrahms/imhotep_pylint),\n[rubocop](https://github.com/scottjab/imhotep_rubocop),\n[foodcritic](https://github.com/scottjab/imhotep_foodcritic),\n[PMD](https://github.com/tslmy/imhotep_pmd),\nand [jsl](https://github.com/mghayes/imhotep_jsl). You can\ninstall those with pip. Example: `pip install imhotep_jshint`.\n\n[Search on PyPI](https://pypi.org/search/?q=imhotep) for a full list.\n\n## Usage\n\nTo use imhotep, we must tell it which repository to look at, who to\nauthenticate as and what to comment on. Imhotep is able to comment in\ntwo ways: either on a single commit or on a pull request.\n\n\n### Commenting on a pull request\n```bash\n    imhotep \\\n       --repo_name=\"justinabrahms/imhotep\" \\\n       --github-username=\"your_username\" \\\n       --github-password=\"a_sha_generated_by_github\" \\\n       --pr-number=1\n```\n\n### Commenting on a single commit\n```bash\n    imhotep \\\n       --repo_name=\"justinabrahms/imhotep\" \\\n       --github-username=\"your_username\" \\\n       --github-password=\"a_sha_generated_by_github\" \\\n       --commit=\"a123445714cfa89d1e843d9950ea8f249cd6e4df\"\n```\n\n### Where do I get that SHA?\n\nThe SHA generated by github is done through your user's [settings\npage](https://github.com/settings/applications). Generate a personal\naccess token and use that for the `--github-password` above.\n\n### Full Usage Info\n```\nusage: imhotep [-h] [--config-file CONFIG_FILE] --repo_name REPO_NAME [--commit COMMIT] [--origin-commit ORIGIN_COMMIT] [--filenames FILENAMES [FILENAMES ...]] [--debug] [--github-username GITHUB_USERNAME] [--github-password GITHUB_PASSWORD] [--no-post] [--authenticated] [--pr-number PR_NUMBER] [--cache-directory CACHE_DIRECTORY] [--linter LINTER [LINTER ...]] [--shallow]\n               [--github-domain GITHUB_DOMAIN] [--report-file-violations] [--dir-override DIR_OVERRIDE]\n\nPosts static analysis results to github.\n\noptions:\n  -h, --help            show this help message and exit\n  --config-file CONFIG_FILE\n                        Configuration file in json.\n  --repo_name REPO_NAME\n                        Github repository name in owner/repo format\n  --commit COMMIT       The sha of the commit to run static analysis on.\n  --origin-commit ORIGIN_COMMIT\n                        Commit to use as the comparison point.\n  --filenames FILENAMES [FILENAMES ...]\n                        filenames you want static analysis to be limited to.\n  --debug               Will dump debugging output and won't clean up after itself.\n  --github-username GITHUB_USERNAME\n                        Github user to post comments as.\n  --github-password GITHUB_PASSWORD\n                        Github password for the above user.\n  --no-post             [DEBUG] will print out comments rather than posting to github.\n  --authenticated       Indicates the repository requires authentication\n  --pr-number PR_NUMBER\n                        Number of the pull request to comment on\n  --cache-directory CACHE_DIRECTORY\n                        Path to directory to cache the repository\n  --linter LINTER [LINTER ...]\n                        Path to linters to run, e.g. 'imhotep.tools:PyLint'\n  --shallow             Performs a shallow clone of the repo\n  --github-domain GITHUB_DOMAIN\n                        You can provide an alternative domain, if you're using github enterprise, for instance\n  --report-file-violations\n                        Report file-level violations, i.e. those not on individual lines\n  --dir-override DIR_OVERRIDE\n                        Override the full path to the local repository.\n```\n\nNote: if you get a error where the plugin cannot find `imhotep.tools`, make\nsure you installed imhotep into your virtualenv with `pip install -e .`. See\nthe [Installation](#installation) instructions above.\n\n## Linter Support\n\nIf it finds violations, it will post those violations to GitHub. New linting\ntools are encouraged!\n\nBy default, imhotep runs all plugins it can find on your source\ncode. If you'd like to only run a subset of linters, you should\nspecify the `--linter` directive with a dotted path to the module. An\nexample of this is `imhotep.tools:PyLint` or\n`imhotep_pep8.plugin:Pep8Linter`. If you want to specify multiple\ntools, just pass multiple things to the `--linter` flag.\n\n## Writing Plugins\n\nImhotep supports adding linters through a plugin API based around\nPython's setuptools entrypoints. This means that plugins can live as\nseparate Python packages which are installable alongside imhotep.\n\nTo write your own tool, subclass [the Tool\nclass](https://github.com/justinabrahms/imhotep/blob/master/imhotep/tools.py)\nand override the `process_line`, `get_file_extensions`, and\n`get_command` methods. If you need greater control over how the tool\nis run, you can override the `invoke` method which gives you maximal\ncontrol over how the tools are run.\n\nTo make your plugin discoverable, you need to add an `entry_points`\nstanza to your `setup.py`. It looks like this.\n\n```python\nsetup(\n    # ...\n    entry_points={\"imhotep_linter\": [\".py = path.to.module:ToolClassName\"]}\n    # ...\n)\n```\n\nThe key pieces of this are the name of the entrypoint which **must**\nbe `imhotep_linter`. This is how we know where to find the\nplugins. The list that follows it is a list of strings that map file\nextensions to a tool that knows how to lint them. So for the entry\nabove, we'll do something like `from path.to.module import\nToolClassName` and run that on all `.py` files in the repository.\n\nYou can find a working example of a `setup.py` file in the\n[imhotep_pep8\nrepository](https://github.com/justinabrahms/imhotep_pep8/blob/master/setup.py).\n\n## What's with the name?\n\nImhotep, the first Egyptian architect, is known as \"the one who comes\nin peace\". In keeping with that name, the goal of this tool is to keep\ncode reviews peaceful and productive by having robots point out the\nnitpicky details, leaving people to critique bigger picture things,\nnot spacing and misspelling issues.\n\n\n# Release Notes\n\n### 3.0.0\nBackwards incompatible change:\n- Dropped support for Python \u003c 3.9 and pypy.\n\n### 1.1.1\n\nBugfixes:\n- Improved discovery of build tools\n\n### 1.1.0\n\nThis is the first release where I'm tracking release notes. This\nrelease is majoritively the work of danpalmer. Thanks, Dan!\n\nFeatures:\n- Support for file level violations\n\nBackwards incompatible change:\n- The printer reporter was broken, not using the correct interface for\n  reporting individual lines. I've chosen to not bump the major\n  version, because this change was to get something to work. Any work\n  built on top of this class would have not be operational code, so\n  I'm not worried about breaking someone.\n\nBugfixes:\n- Different reporters that report errors on the same line don't\n  clobber each other.\n- File extensions are properly filtered before reporting.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjustinabrahms%2Fimhotep","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjustinabrahms%2Fimhotep","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjustinabrahms%2Fimhotep/lists"}