Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 75 additions & 0 deletions .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Bug report
description: Something is broken in a way that is not a difference from upstream (a crash, a wrong exit code, a packaging problem).
title: "bug: "
labels: ["bug"]
body:
- type: markdown
attributes:
value: |
If the problem is that this tool behaves *differently from Python
pre-commit*, please use the **Divergence** template instead — it asks
for the comparison that makes the report actionable.

- type: textarea
id: what
attributes:
label: What happened
description: Include the full output, and the command that produced it.
render: console
validations:
required: true

- type: textarea
id: expected
attributes:
label: What you expected instead
validations:
required: true

- type: textarea
id: repro
attributes:
label: Steps to reproduce
description: A scratch repo and the exact commands beats a description. If you cannot reproduce it reliably, say so — that is useful information rather than a reason not to file.
placeholder: |
1. git init scratch && cd scratch
2. cat > .pre-commit-config.yaml <<'YAML'
...
YAML
3. pre-commit run --all-files
validations:
required: true

- type: input
id: version
attributes:
label: Version
description: Output of `pre-commit --version`.
validations:
required: true

- type: dropdown
id: os
attributes:
label: Platform
options:
- Linux
- macOS (Apple Silicon)
- macOS (Intel)
- Windows
- Other
validations:
required: true

- type: dropdown
id: install
attributes:
label: How you installed it
options:
- Homebrew (blairham/tap)
- Release archive
- go install
- Built from source
- GitHub Action (blairham/go-pre-commit@v4)
validations:
required: true
14 changes: 14 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
blank_issues_enabled: true
contact_links:
- name: Feature request for pre-commit itself
url: https://github.com/pre-commit/pre-commit/issues
about: This project deliberately has no features upstream lacks. Divergence is a bug here, so a new capability has to land upstream first — asking there helps everyone, and it arrives here as parity work.
- name: Question or idea
url: https://github.com/blairham/go-pre-commit/discussions
about: Not sure it is a bug, or want to talk something through first? Discussions is the better room.
- name: Should I use this at all?
url: https://github.com/blairham/go-pre-commit/blob/main/docs/comparison.md
about: An honest comparison that leads with the case for staying on Python pre-commit.
- name: Report a security vulnerability
url: https://github.com/blairham/go-pre-commit/security/advisories/new
about: Please report privately rather than in a public issue.
83 changes: 83 additions & 0 deletions .github/ISSUE_TEMPLATE/divergence.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: Divergence from Python pre-commit
description: This tool behaves differently from upstream pre-commit. The most useful report you can file.
title: "divergence: "
labels: ["divergence"]
body:
- type: markdown
attributes:
value: |
This project has one job: behave like Python pre-commit. A difference
between the two is a bug here, even when the difference looks like an
improvement.

The most useful report is **two commands and their two outputs.**

- type: textarea
id: expected
attributes:
label: What upstream pre-commit does
description: The command you ran against Python pre-commit, and its output.
render: console
placeholder: |
$ python -m pre_commit run trailing-whitespace --all-files
Trim Trailing Whitespace.................................................Passed
validations:
required: true

- type: textarea
id: actual
attributes:
label: What this tool does
description: The same command against this tool, and its output.
render: console
placeholder: |
$ pre-commit run trailing-whitespace --all-files
Trim Trailing Whitespace.................................................Failed
validations:
required: true

- type: textarea
id: config
attributes:
label: .pre-commit-config.yaml
description: The config, if the behavior depends on it. Trim it to the smallest version that still shows the difference.
render: yaml
validations:
required: false

- type: input
id: version-ours
attributes:
label: This tool's version
description: Output of `pre-commit --version` — it prints a `(build …)` suffix, which is how you know you ran this one.
placeholder: "pre-commit 4.6.6 (build ...)"
validations:
required: true

- type: input
id: version-upstream
attributes:
label: Upstream version compared against
placeholder: "4.6.2"
validations:
required: true

- type: dropdown
id: os
attributes:
label: Platform
options:
- Linux
- macOS (Apple Silicon)
- macOS (Intel)
- Windows
- Other
validations:
required: true

- type: markdown
attributes:
value: |
**Note on platforms:** Linux and macOS are exercised in CI. Windows
builds and is smoke-tested, but is far less trodden — a Windows-only
report is still welcome and useful.
64 changes: 64 additions & 0 deletions .github/ISSUE_TEMPLATE/language.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Language backend report
description: A language backend is broken, or you want to help move one from "untested" to "proven".
title: "language: "
labels: ["language-backend"]
body:
- type: markdown
attributes:
value: |
Ten of the 22 language backends are implemented but effectively
unexercised — see the
[grading table](https://github.com/blairham/go-pre-commit/blob/main/docs/parity.md#language-support-graded).

If you are the first person to try one of those, you are doing the
project a favor either way: it working is worth knowing, and it not
working is worth knowing sooner.

- type: dropdown
id: language
attributes:
label: Which language backend
options:
- conda
- coursier
- dart
- docker
- docker_image
- dotnet
- fail
- golang
- haskell
- julia
- lua
- node
- perl
- pygrep
- python
- r
- ruby
- rust
- script
- swift
- system
- Other / not sure
validations:
required: true

- type: dropdown
id: kind
attributes:
label: What kind of report is this
options:
- It is broken
- It works (confirming an untested backend)
- I want to add test coverage for it
validations:
required: true

- type: textarea
id: detail
attributes:
label: Details
description: The hook config you used, and what happened. If it works, saying so plainly is enough.
validations:
required: true
27 changes: 27 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
## Why

<!-- What problem does this solve? Explain the why, not a restatement of the diff. -->

## What changed

<!-- Brief summary. -->

## Parity

<!--
This project's contract is "behaves like Python pre-commit". Pick one:

- Matches upstream — and here is the upstream behavior it now matches.
- No behavior change (refactor, docs, CI, tests).
- Deliberate divergence — explain why, because this needs a very good reason.
-->

## Checklist

- [ ] `make check` passes (`fmt` + `vet` + `test` — note this does **not** run lint)
- [ ] `make lint` passes
- [ ] Tests do not touch real user state (`t.TempDir()` + `t.Setenv` for `HOME`, `PRE_COMMIT_HOME`, `XDG_CACHE_HOME`)
- [ ] If behavior changed, the differential parity suite still passes
- [ ] Docs updated if this changes something a user can observe

Closes #
130 changes: 130 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
# Contributor Covenant Code of Conduct

## Our Pledge

We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, caste, color, religion, or sexual
identity and orientation.

We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.

## Our Standards

Examples of behavior that contributes to a positive environment for our
community include:

* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the overall
community

Examples of unacceptable behavior include:

* The use of sexualized language or imagery, and sexual attention or advances of
any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email address,
without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Enforcement Responsibilities

Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.

Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.

## Scope

This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official email address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
**blairham@me.com**.

All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the
reporter of any incident.

## Enforcement Guidelines

Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:

### 1. Correction

**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.

**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.

### 2. Warning

**Community Impact**: A violation through a single incident or series of
actions.

**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or permanent
ban.

### 3. Temporary Ban

**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.

**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.

### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within the
community.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.1, available at
https://www.contributor-covenant.org/version/2/1/code_of_conduct.html.

Community Impact Guidelines were inspired by
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].

For answers to common questions about this code of conduct, see the FAQ at
https://www.contributor-covenant.org/faq. Translations are available at
https://www.contributor-covenant.org/translations.

[homepage]: https://www.contributor-covenant.org
[Mozilla CoC]: https://github.com/mozilla/diversity
Loading
Loading