{"id":34057485,"url":"https://github.com/bugout-dev/locust","last_synced_at":"2026-04-11T05:02:51.711Z","repository":{"id":41352322,"uuid":"300814428","full_name":"bugout-dev/locust","owner":"bugout-dev","description":"\"git diff\" over abstract syntax trees","archived":false,"fork":false,"pushed_at":"2023-10-16T21:39:56.000Z","size":263,"stargazers_count":59,"open_issues_count":19,"forks_count":6,"subscribers_count":6,"default_branch":"main","last_synced_at":"2026-01-14T09:15:58.712Z","etag":null,"topics":["git","python3","reviews","static-analysis"],"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/bugout-dev.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}},"created_at":"2020-10-03T06:40:20.000Z","updated_at":"2025-11-13T21:27:56.000Z","dependencies_parsed_at":"2022-09-03T19:00:21.219Z","dependency_job_id":null,"html_url":"https://github.com/bugout-dev/locust","commit_stats":null,"previous_names":["simiotics/locust"],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/bugout-dev/locust","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bugout-dev%2Flocust","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bugout-dev%2Flocust/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bugout-dev%2Flocust/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bugout-dev%2Flocust/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bugout-dev","download_url":"https://codeload.github.com/bugout-dev/locust/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bugout-dev%2Flocust/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31669117,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-10T17:19:37.612Z","status":"online","status_checked_at":"2026-04-11T02:00:05.776Z","response_time":54,"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":["git","python3","reviews","static-analysis"],"created_at":"2025-12-14T03:37:09.356Z","updated_at":"2026-04-11T05:02:51.697Z","avatar_url":"https://github.com/bugout-dev.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# \u003cimg src=\"./img/locust-black.svg\" height=\"20\" width=\"20\"/\u003e locust\n\n\"It's `git diff --stat` on steroids!\" - [@scottmilliken](https://gitlab.com/scottmilliken)\n\n## What is Locust?\n\nLocust helps you reason about your code base as it evolves over time.\n\nLocust provides a semantic layer on top of `git diff`. It emits metadata describing\n[AST](https://en.wikipedia.org/wiki/Abstract_syntax_tree)-level changes to your\ncode base between git revisions.\n\nThis metadata is useful to both humans and computers. For example:\n\n1. (Humans) Locust can generate\n   [much more humane summaries of changes](https://github.com/bugout-dev/locust/pull/34) than the\n   standard git diff.\n\n2. (Computers) [Bugout.dev](https://alpha.bugout.dev) uses Locust metadata to learn high level\n   abstractions about code.\n\n## Installation\n\nLocust requires Python3 (specifically, it was written in Python3.8).\n\n### Install from PyPI\n\n```bash\npip install -U setuptools\npip install bugout-locust\n```\n\n### Install from source\n\nClone this repository and run from the project root:\n\n```bash\npython setup.py install\n```\n\n### Docker\n\nYou can also use the Locust docker image:\n\n```bash\ndocker pull bugout/locust\n```\n\n## Usage\n\n### CLI\n\nLocust is a command line tool, and you can invoke it as:\n\n```bash\nlocust 22dd7fd6adf392bb29d13d10f10e7dbb1d97bfce c9813bd5871a9919551ccd917712135c40367c5c --format yaml\n```\n\nThis produces the following output:\n\n```yaml\nlocust:\n  - file: locust/ci_helpers/github.py\n    changes:\n      - name: generate_argument_parser\n        type: function\n        line: 11\n        changed_lines: 9\n        total_lines: 9\n        children: []\n      - name: helper_push\n        type: function\n        line: 22\n        changed_lines: 13\n        total_lines: 13\n        children: []\n      - name: helper_pr\n        type: function\n        line: 37\n        changed_lines: 14\n        total_lines: 14\n        children: []\n      - name: main\n        type: function\n        line: 53\n        changed_lines: 29\n        total_lines: 29\n        children: []\nrefs:\n  initial: 22dd7fd\n  terminal: c9813bd\n```\n\n### Language plugins\n\nTo use Locust to process a code base containing Python (\u003e3.5) and Javascript, use the Javascript\nplugin (written in Node 14).\n\nIf you are running Locust from the root of this project, you would do this as follows:\n\n```\nlocust -r \u003cpath to repo\u003e \u003cinitial revision\u003e \u003cterminal revision\u003e --plugins \"node js/out/index.js\"\n```\n\nA Locust language plugin is simply a program that you can invoke from the shell (like\n`node js/out/index.js`) which takes two arguments:\n\n- `-i` - an input file containing a `locust.git.RunResponse` object\n\n- `-o` - path to an output file into which it writes a list of tuples consisting of\n  `locust.git.PatchInfo` objects and their corresponding list of `locust.parse.RawDefinition`\n  objects.\n\nThe [Javascript plugin](./js/) provides a rubric for how to build your own plugin.\n\nYou can add custom plugins to a Locust invocation like this:\n\n```\nlocust -r \u003cpath to repo\u003e \u003cinitial revision\u003e \u003cterminal revision\u003e \\\n  --plugins \"node js/out/index.js\" \"\u003ccustom plugin invocation 1\u003e\" \"\u003ccustom plugin invocation 2\u003e\"\n```\n\n### CI/CD\n\nLocust is easy to use in CI/CD pipelines:\n\n- [Locust GitHub Action](https://github.com/simiotics/locust-action)\n\n### Bugout App integration\n\nYou can use Locust with our [Bugout GitHub Bot](https://github.com/bugout-dev/github-demo).\nLocust extension will work after you push `./github/workflows/locust.yml` file in `main` branch:\n\n```yaml\nname: Locust summary\non: [pull_request_target]\njobs:\n  build:\n    runs-on: ubuntu-20.04\n    steps:\n      - name: PR head repo\n        id: head_repo_name\n        run: |\n          HEAD_REPO_NAME=$(jq -r '.pull_request.head.repo.full_name' \"$GITHUB_EVENT_PATH\")\n          echo \"PR head repo: $HEAD_REPO_NAME\"\n          echo \"::set-output name=repo::$HEAD_REPO_NAME\"\n      - name: Checkout git repo\n        uses: actions/checkout@v2\n        with:\n          repository: ${{ steps.head_repo_name.outputs.repo }}\n          fetch-depth: 0\n      - name: Install python\n        uses: actions/setup-python@v2\n        with:\n          python-version: \"3.8\"\n      - name: Install dependencies\n        run: |\n          python -m pip install --upgrade pip setuptools\n          pip install bugout-locust\n      - name: Generate and send Locust summary\n        env:\n          BUGOUT_SECRET: ${{ secrets.BUGOUT_SECRET }}\n        run: |\n          locust.github publish\n```\n\nBUGOUT_SECRET should be setted up in repository/organization secrets. Value you can take from Bugout Account token page. Also `BUGOUT_API_URL: ${{ secrets.BUGOUT_API_URL }}` could be specified if you want to setup your personal server for processing locust summaries.\n\n### Docker\n\nTo run Locust using docker:\n\n```bash\ndocker run -v $ABSOLUTE_PATH_TO_GIT_REPO:/usr/src/app bugout/locust -r /usr/src/app \\\n    $INITIAL_REVISION \\\n    $TERMINAL_REVISION \\\n    --format yaml\n```\n\n## Output formats\n\nLocust can produce output in many formats. The currently supported formats are:\n\n1. JSON (`--format json`)\n\n2. YAML (`--format yaml`)\n\n3. HTML (`--format html`)\n\n4. GitHub-flavored HTML, meant to be used with GitHub styles (`--format html-github`)\n\n## Contributing\n\n### Running tests\n\nMake sure to clone [simiotics/locust-test-cases](https://github.com/simiotics/locust-test-cases)\nrepo to your machine.\n\nRun:\n\n```bash\ngit -c \u003cpath to locust-test-cases repo\u003e fetch origin\n```\n\nThen, from the root of this repo:\n\n```bash\nLOCUST_TESTCASES_DIR=\u003cpath to locust-test-cases repo\u003e ./test.sh\n```\n\n## Similar projects\n\n### Kythe\n\n[Kythe](https://kythe.io) is a Google open source project. It grew out of the need to semantically\nlink different parts of Google's code base.\n\nThe goals of Locust are different from those of Kythe. Locust is specifically about generating\nmetadata describing _changes_ to code.\n\nKythe on GitHub: https://github.com/kythe/kythe\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbugout-dev%2Flocust","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbugout-dev%2Flocust","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbugout-dev%2Flocust/lists"}