Skip to main content

Generate .pre-commit-config.yaml from language and framework presets

Project description

pc-init

codecov

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:

  1. Identify the recommended quality tools for their stack.
  2. Look up the corresponding pre-commit hook repository URLs, revisions, and arguments.
  3. Manually edit the .pre-commit-config.yaml file.

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

pc_init-0.1.0.tar.gz (50.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pc_init-0.1.0-py3-none-any.whl (41.0 kB view details)

Uploaded Python 3

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

Hashes for pc_init-0.1.0.tar.gz
Algorithm Hash digest
SHA256 db7553ff9d6a6702d88beb2431e1a659645f5f70ddf04ccd58843d038c9b16e6
MD5 a45b45813ca4b5d6b050631f8a04373e
BLAKE2b-256 224ddf9a2b9701fe8598a03c9041cd1ea33599df93d362ec3f97bdc3e6ba4b04

See more details on using hashes here.

Provenance

The following attestation bundles were made for pc_init-0.1.0.tar.gz:

Publisher: test-build-publish.yml on cleder/gpc-init

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for pc_init-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 90a77d13c451ccd1d9be85e1e07f74acd45a0647f92d918996a7c83242151d33
MD5 847addceed91d29dbd57efaa998c2b8d
BLAKE2b-256 13323f2cfffe48f013752f6acd6798a55a5a7cb15b0d3c2771874b88541f1f41

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page