{"id":43191602,"url":"https://github.com/ninerealmlabs/precommit-template","last_synced_at":"2026-03-01T04:26:06.673Z","repository":{"id":239504659,"uuid":"799578890","full_name":"ninerealmlabs/precommit-template","owner":"ninerealmlabs","description":"A `copier` template for pre-commit configuration","archived":false,"fork":false,"pushed_at":"2026-01-29T01:15:31.000Z","size":1016,"stargazers_count":3,"open_issues_count":9,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-29T16:59:35.204Z","etag":null,"topics":["config","configuration","copier","copier-template","precommit"],"latest_commit_sha":null,"homepage":"https://ninerealmlabs.github.io/precommit-template","language":"Jinja","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ninerealmlabs.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2024-05-12T15:05:16.000Z","updated_at":"2026-01-27T17:43:30.000Z","dependencies_parsed_at":"2024-05-21T13:29:58.801Z","dependency_job_id":"9a66ca27-7b42-45d9-90a0-154ca3bb7553","html_url":"https://github.com/ninerealmlabs/precommit-template","commit_stats":null,"previous_names":["ninerealmlabs/precommit-template"],"tags_count":24,"template":false,"template_full_name":null,"purl":"pkg:github/ninerealmlabs/precommit-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ninerealmlabs%2Fprecommit-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ninerealmlabs%2Fprecommit-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ninerealmlabs%2Fprecommit-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ninerealmlabs%2Fprecommit-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ninerealmlabs","download_url":"https://codeload.github.com/ninerealmlabs/precommit-template/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ninerealmlabs%2Fprecommit-template/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28968718,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-01T04:44:20.970Z","status":"ssl_error","status_checked_at":"2026-02-01T04:44:19.994Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["config","configuration","copier","copier-template","precommit"],"created_at":"2026-02-01T05:02:09.224Z","updated_at":"2026-03-01T04:26:06.625Z","avatar_url":"https://github.com/ninerealmlabs.png","language":"Jinja","readme":"# Pre-commit Template\n\nProvides a set of configuration files to standardize [pre-commit](https://pre-commit.com/) hooks across repos.\n\n[copier](https://copier.readthedocs.io/) is used to render a pre-commit config and associated tool configurations based\non answers to a survey during the setup phase.\n\n## Quick Start\n\n### Prerequisites\n\nWe will use [uv](https://docs.astral.sh/uv/) to install and run tools in isolated environments.\n\nSome pre-commit hooks (`hadolint`, `shellcheck`, and `prettier` if selected), expect to find the tool available in your path.\nYou may need to install them.\n\n### Install `copier` and `pre-commit`\n\n```sh\n# install copier and its dependencies\nuv tool install copier --with copier-templates-extensions --with jinja2-time\n# we want to manage pre-commit, so ensure it is available\nuv tool install pre-commit\n```\n\n### Generate your custom configuration with `copier` [docs](https://copier.readthedocs.io/en/stable/generating/)\n\n1. Run `copier` in your local repo\n\n   ```sh\n   copier copy --trust \"gh:ninerealmlabs/precommit-template\" \"$(git rev-parse --show-toplevel)\"\n   ```\n\n2. Answer the questionnaire\n\n   `Copier` will render your configuration based on your selection.\n   Then it will commit these new changes automatically (but it will not push the commit).\n   This allows you to have a clean git status before running `pre-commit run --all-files` to ensure your repo is in compliance with your new configuration.\n\n3. Run `pre-commit run --all-files` and fix any errors that pre-commit's checks have found\n\n4. Commit\n\n## Features\n\n(opinionated) configuration of formatting and linting tools, including:\n\n- [EditorConfig](https://editorconfig.org/) - Maintains consistent coding styles across various editors and IDEs\n- [Biome](https://biomejs.dev/) - A fast formatter and linter for JS, TS, JSON, CSS, and HTML\n- [hadolint](https://github.com/hadolint/hadolint) - A smarter Dockerfile linter that ensures best practice Docker\n  images\n- [mdformat](https://github.com/hukkin/mdformat) - A markdown formatter\n- [Prettier](https://github.com/prettier/prettier) - Opinionated code formatter (JS, TS, JSON, CSS, HTML, Markdown,\n  YAML)\n- [ruff](https://github.com/astral-sh/ruff) - An extremely fast Python linter and code formatter\n- [rumdl](https://github.com/rvben/rumdl-pre-commit?tab=readme-ov-file) - A markdown linter and formatter\n- [shellcheck](https://github.com/koalaman/shellcheck) - A static analysis tool for shell scripts (sh, bash)\n- [typos](https://github.com/crate-ci/typos) - A source code spell checker\n- [yamllint](https://github.com/adrienverge/yamllint) - A linter for YAML files\n\n### Dependencies and Gotchas\n\nSome pre-commit hooks rely on tools that must be installed separately (they are not managed by pre-commit):\n\n| Tool                                                 | Required when               | Install                                                                                    |\n| ---------------------------------------------------- | --------------------------- | ------------------------------------------------------------------------------------------ |\n| [hadolint](https://github.com/hadolint/hadolint)     | `docker: true`              | `brew install hadolint` or [binary release](https://github.com/hadolint/hadolint/releases) |\n| [shellcheck](https://github.com/koalaman/shellcheck) | `shell: true`               | `brew install shellcheck` or `apt install shellcheck`                                      |\n| [prettier](https://prettier.io/)                     | `web_format_tool: prettier` | `npm install -g prettier`                                                                  |\n\nIf these tools are not available in your `$PATH`, the corresponding pre-commit hooks will fail.\n\n### Other (unrelated) project setup tools\n\n- [gitignore.io - Create Useful .gitignore Files For Your Project](https://www.toptal.com/developers/gitignore)\n\n## Update your custom configuration with `copier` [docs](https://copier.readthedocs.io/en/stable/updating/)\n\n\u003e **!! DO NOT MANUALLY UPDATE `copier-answers` file!!**\n\n1. Navigate to project directory: `cd \u003cgit project dir\u003e`\n\n2. Ensure a `feature` branch is checked out.\n\n3. Commit (or stash) current work.\n   Copier will not work with \"unclean\" file statuses.\n\n4. Run `copier update`.\n   This will try to render files based on the _latest_ release of `common`:\n\n   ```sh\n   copier update --trust . --answers-file .copier-answers.yaml\n   ```\n\n\u003e If `copier` is unable to resolve the diff between current and latest revisions, it will create `*.rej` files that\n\u003e contain the unresolved differences. These must be reviewed (and resolved/implemented) prior to commit (this is\n\u003e enforced by `pre-commit`)\n\n### What does `copier update` do?\n\n`copier` documentation provides a [good overview of how the update process works](https://copier.readthedocs.io/en/latest/updating/#how-the-update-works) -- but TLDR:\n\n- It renders a fresh project from the _latest_ template version\n- Then it compares current vs new to get the diffs\n- Next it updates the current project with the latest template changes (asking confirmation)\n- Finally, it re-applies the previously obtained diff, and then run the post-migrations\n\n## Local development\n\n1. Install development dependencies\n\n   ```sh\n   python -m venv .venv\n   source .venv/bin/activate\n   pip install -r requirements.txt\n   ```\n\n2. Test updates\n\n   You can run `precommit-template` to update itself using:\n\n   ```sh\n   # use current branch's committed files (\"HEAD\") to run precommit-template on itself\n   copier recopy --trust --vcs-ref \"HEAD\" /path/to/precommit-template  --answers-file .copier-answers.yaml\n   ```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fninerealmlabs%2Fprecommit-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fninerealmlabs%2Fprecommit-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fninerealmlabs%2Fprecommit-template/lists"}