{"id":18636674,"url":"https://github.com/localstack/pre-commit-hooks","last_synced_at":"2025-04-11T09:30:59.652Z","repository":{"id":220172701,"uuid":"750462792","full_name":"localstack/pre-commit-hooks","owner":"localstack","description":"Pre commit hooks for LocalStack repositories","archived":false,"fork":false,"pushed_at":"2024-08-22T12:01:35.000Z","size":20,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":18,"default_branch":"main","last_synced_at":"2025-03-25T11:52:18.299Z","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":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/localstack.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-01-30T17:35:12.000Z","updated_at":"2024-08-22T11:59:33.000Z","dependencies_parsed_at":"2024-02-06T10:45:16.539Z","dependency_job_id":"0654d18e-2f62-4d4e-a054-0b57909c781f","html_url":"https://github.com/localstack/pre-commit-hooks","commit_stats":null,"previous_names":["localstack/pre-commit-hooks"],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/localstack%2Fpre-commit-hooks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/localstack%2Fpre-commit-hooks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/localstack%2Fpre-commit-hooks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/localstack%2Fpre-commit-hooks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/localstack","download_url":"https://codeload.github.com/localstack/pre-commit-hooks/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248368206,"owners_count":21092317,"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-07T05:31:06.634Z","updated_at":"2025-04-11T09:30:59.401Z","avatar_url":"https://github.com/localstack.png","language":"Python","readme":"# LocalStack [pre-commit](https://pre-commit.com/) hooks\n\n## Usage in Repositories\n\n### Prerequisites \nYou need to add [pre-commit](https://pre-commit.com/) to your python environment and install the hooks:\n\n```bash\npip install pre-commit\npre-commit install\n```\n\n### Install\n\nThen, to use hooks from this repo add this to your `.pre-commit-config.yaml`:\n\n```yaml\nrepos:\n  - repo: https://github.com/localstack/pre-commit-hooks\n    rev: v1.2.1\n    hooks:\n      - id: check-pinned-deps-for-needed-upgrade\n```\n\n### Testing\nTo run a hook manually on the staged changes use the following command:\n\n```bash\npre-commit run \u003chook-id\u003e --files $(git diff --name-only --cached)\n```\n\n## Available Hooks\n\n- `check-pinned-deps-for-needed-upgrade`: This hook will notify contributors if the project file has changed and the pinned dependencies do not satisfy the project file. \nThe project file can either be `pyproject.toml` or `setup.cfg`.\nIf the `pyproject.toml` file contains a `project` section, the hook will check the `pyproject.toml` file, otherwise it will check the `setup.cfg` file.\n\n## Adding new Hooks\n\nTo add a new hook, create a new python file in the `localstack_pre_commit` directory.\nIt should have a function called `main` that takes a list of files as an argument.\nThe function should return a `0` if the hook passes and a `1` if it fails.\nAfter creating the hook, add the main function to the `project.scripts` section of the `pyproject.toml` file using a concise script name.\n\nThen create a new entry in the `pre-commit-hooks.yaml` file giving the hook a unique id and referencing the script name from the `pyproject.toml` file.\nAlso give a brief description of what the hook does.\n\nFinally, add the hook to the `README.md` file in the `## Available Hooks` section.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flocalstack%2Fpre-commit-hooks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flocalstack%2Fpre-commit-hooks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flocalstack%2Fpre-commit-hooks/lists"}