Generate .pre-commit-config.yaml from language and framework presets
Project description
pc-init
I use pre-commit (and now are beginning to migrate to prek) extensively in all my projects (work and hobby), and create a lot of repositories (every other month or so, enough for this to be a pain point, but not enough to have the workflow committed to my muscle memory).
Whenever I create a new repo, I have to cut and paste the .pre-commit-config.yaml into the new project - which requires remembering what other project has the most appropriate and up-to-date configuration.
Summary
pc-init
The pc-init command (init) accepts optional --lang (language) and --framework parameters.
This would allow the tool to automatically scaffold a more relevant and production-ready initial configuration file (.pre-commit-config.yaml) based on the project's primary technology stack.
Motivation
Many languages and frameworks have popular, community-standard custom linters, formatters, and code quality tools (e.g., black for Python, eslint for JavaScript/React, go fmt for Go).
Currently, setting up a new project requires the user to manually:
- Identify the recommended quality tools for their stack.
- Look up the corresponding pre-commit hook repository URLs, revisions, and arguments.
- Manually edit the
.pre-commit-config.yamlfile.
pc-inits --lang and --framework parameters drastically simplify onboarding, encourage the adoption of best practices, and reduce boilerplate, allowing developers to set up a comprehensive quality gate with a single command.
Example Commands
Initialize with standard Python hooks (e.g., black, flake8/ruff, isort)
pc-init --lang=python
Initialize with JavaScript hooks, including React-specific linters (e.g., eslint + react-hooks plugin)
pc-init --lang=javascript --framework=react
Initialize for a simple Go project (e.g., go fmt, go vet)
pc-init --lang go
rust with bevy game engine (cargo fmt, clippy, bevy cli)
pc-init --lang=rust --framework=bevy
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pc_init-0.1.0.tar.gz.
File metadata
- Download URL: pc_init-0.1.0.tar.gz
- Upload date:
- Size: 50.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
db7553ff9d6a6702d88beb2431e1a659645f5f70ddf04ccd58843d038c9b16e6
|
|
| MD5 |
a45b45813ca4b5d6b050631f8a04373e
|
|
| BLAKE2b-256 |
224ddf9a2b9701fe8598a03c9041cd1ea33599df93d362ec3f97bdc3e6ba4b04
|
Provenance
The following attestation bundles were made for pc_init-0.1.0.tar.gz:
Publisher:
test-build-publish.yml on cleder/gpc-init
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pc_init-0.1.0.tar.gz -
Subject digest:
db7553ff9d6a6702d88beb2431e1a659645f5f70ddf04ccd58843d038c9b16e6 - Sigstore transparency entry: 1891162886
- Sigstore integration time:
-
Permalink:
cleder/gpc-init@407552e58e95ef5fc72b44aac4b52717295dd736 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/cleder
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
test-build-publish.yml@407552e58e95ef5fc72b44aac4b52717295dd736 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pc_init-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pc_init-0.1.0-py3-none-any.whl
- Upload date:
- Size: 41.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
90a77d13c451ccd1d9be85e1e07f74acd45a0647f92d918996a7c83242151d33
|
|
| MD5 |
847addceed91d29dbd57efaa998c2b8d
|
|
| BLAKE2b-256 |
13323f2cfffe48f013752f6acd6798a55a5a7cb15b0d3c2771874b88541f1f41
|
Provenance
The following attestation bundles were made for pc_init-0.1.0-py3-none-any.whl:
Publisher:
test-build-publish.yml on cleder/gpc-init
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pc_init-0.1.0-py3-none-any.whl -
Subject digest:
90a77d13c451ccd1d9be85e1e07f74acd45a0647f92d918996a7c83242151d33 - Sigstore transparency entry: 1891162979
- Sigstore integration time:
-
Permalink:
cleder/gpc-init@407552e58e95ef5fc72b44aac4b52717295dd736 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/cleder
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
test-build-publish.yml@407552e58e95ef5fc72b44aac4b52717295dd736 -
Trigger Event:
push
-
Statement type: