{"id":20777542,"url":"https://github.com/semgrep/pre-commit","last_synced_at":"2025-04-30T18:29:51.145Z","repository":{"id":237105780,"uuid":"792507632","full_name":"semgrep/pre-commit","owner":"semgrep","description":"Pre-commit hooks to run Semgrep","archived":false,"fork":false,"pushed_at":"2025-04-09T07:06:23.000Z","size":117,"stargazers_count":3,"open_issues_count":4,"forks_count":4,"subscribers_count":13,"default_branch":"develop","last_synced_at":"2025-04-09T08:23:06.007Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-2.1","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/semgrep.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,"publiccode":null,"codemeta":null}},"created_at":"2024-04-26T20:18:07.000Z","updated_at":"2025-04-09T07:06:24.000Z","dependencies_parsed_at":"2024-11-07T22:24:26.476Z","dependency_job_id":"397e6f34-4dbd-4051-88fd-552ad7aab8a2","html_url":"https://github.com/semgrep/pre-commit","commit_stats":null,"previous_names":["semgrep/pre-commit"],"tags_count":99,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/semgrep%2Fpre-commit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/semgrep%2Fpre-commit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/semgrep%2Fpre-commit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/semgrep%2Fpre-commit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/semgrep","download_url":"https://codeload.github.com/semgrep/pre-commit/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251760419,"owners_count":21639404,"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-11-17T13:15:57.734Z","updated_at":"2025-04-30T18:29:51.137Z","avatar_url":"https://github.com/semgrep.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Semgrep pre-commit\n\nThis repository contains several hooks designed to be used with the\n[pre-commit] framework. Pre-commit uses [git hooks][git-hooks] (including, but\nnot only, the [eponymous one][git-pre-commit]) to run checks.\n\nSee [`.pre-commit-hooks.yaml`](.pre-commit-hooks.yaml) for the hooks this\nrepository defines.\n\n## `semgrep ci`\n\nTo configure [pre-commit] to run custom rules and rulesets from the [Semgrep\nAppSec Platform][semgrep-platform], similar to `semgrep ci`, we provide the\n`semgrep-ci` hook. This can be used by adding the following to your\n`.pre-commit-config.yaml` after installing `pre-commit`:\n\n```yaml\n- repo: https://github.com/semgrep/pre-commit\n  rev: 'v1.120.1'\n  hooks:\n    - id: semgrep-ci\n```\n\n## `semgrep scan`\n\nLikewise, you can configure a hook to run a `semgrep scan` with the `semgrep`\nhook. As an example, the following configuration would scan the files to be\ncommitted with a specified config, skipping files with unknown extensions:\n\n```yaml\n- repo: https://github.com/semgrep/pre-commit\n  rev: 'v1.120.1'\n  hooks:\n    - id: semgrep\n      # See https://semgrep.dev/explore to select a ruleset and copy its URL\n      args: ['--config', '\u003cSEMGREP_RULESET_URL\u003e', '--error', '--skip-unknown-extensions']\n```\n\n## Running Pro rules\n\nIf you would like to run the pre-commit hook locally while using Semgrep Pro\nrules:\n\n1. Log in to your Semgrep account. Running this command launches a browser\n   window, but you can also use the link that's returned in the CLI to proceed:\n\n   ```\n   $ semgrep login\n   ```\n2. In the Semgrep CLI login, click **Activate** to proceed.\n\n---\n\nThe code in this repository is licensed under the terms of the [LGPL\n2.1](LICENSE). For more information about the licensing details of Semgrep\nitself see [our licensing page][semgrep-licensing].\n\n\n[pre-commit]: https://pre-commit.com\n[git-hooks]: https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks\n[git-pre-commit]: https://git-scm.com/docs/githooks#_pre_commit\n[semgrep-platform]: https://semgrep.dev/products/semgrep-appsec-platform\n[semgrep-licensing]: https://semgrep.dev/docs/licensing/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsemgrep%2Fpre-commit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsemgrep%2Fpre-commit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsemgrep%2Fpre-commit/lists"}