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
8 changes: 8 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,14 @@ archives:
- goos: windows
formats:
- zip
# Listing files at all replaces GoReleaser's defaults, so LICENSE and README
# have to be repeated here. NOTICE is the reason: Apache-2.0 section 4(d)
# requires it to travel with every distributed copy, and it carries the
# upstream MIT notices this reimplementation is built on.
files:
- LICENSE
- NOTICE
- README.md

notarize:
macos:
Expand Down
51 changes: 51 additions & 0 deletions NOTICE
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
go-pre-commit
Copyright 2026 Blair Hamilton

Licensed under the Apache License, Version 2.0. See LICENSE.

--------------------------------------------------------------------------------

This project is an independent Go reimplementation of the Python `pre-commit`
framework. It is not affiliated with, endorsed by, or supported by the
pre-commit project or its maintainers.

Its observable behavior — the command-line interface, the `.pre-commit-config.yaml`
and hook manifest schemas, environment-directory naming, cache layout, exit codes
and output formatting — is deliberately modeled on the following MIT-licensed
projects, and portions of this work are derived from them:

pre-commit — https://github.com/pre-commit/pre-commit

Copyright (c) 2014 pre-commit dev team: Anthony Sottile, Ken Struys

identify — https://github.com/pre-commit/identify

The file-type tag tables in internal/identify (extension, filename and
interpreter mappings) follow this project's data.

Copyright (c) 2017 Chris Kuehl, Anthony Sottile

Both are distributed under the MIT License, reproduced in full below as required
by its terms.

--------------------------------------------------------------------------------

MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
22 changes: 21 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,26 @@ git push origin v4.6.7

CI builds, signs, and notarizes cross-platform binaries, publishes a GitHub release, and updates the Homebrew formula in [blairham/homebrew-tap](https://github.com/blairham/homebrew-tap) automatically. Versions track upstream parity: `v4.6.x` means feature parity with Python pre-commit 4.6.

## Attribution

This is an independent reimplementation, not a fork and not an official
project. It is not affiliated with, endorsed by, or supported by the pre-commit
project or its maintainers.

The behavior it copies — the CLI, the config and manifest schemas, the cache
layout, exit codes and output formatting — is the design of two MIT-licensed
projects, and the file-type tag tables in `internal/identify` follow upstream
`identify`'s data:

- [pre-commit](https://github.com/pre-commit/pre-commit) — © 2014 pre-commit dev
team: Anthony Sottile, Ken Struys
- [identify](https://github.com/pre-commit/identify) — © 2017 Chris Kuehl,
Anthony Sottile

Their MIT license is reproduced in [NOTICE](NOTICE). Bugs you find here are
this project's bugs, not theirs — please report them
[here](https://github.com/blairham/go-pre-commit/issues) rather than upstream.

## License

[Apache-2.0](LICENSE)
[Apache-2.0](LICENSE), with third-party notices in [NOTICE](NOTICE).
6 changes: 6 additions & 0 deletions internal/identify/identify.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
// Package identify provides file type identification by extension, filename, and shebang.
//
// The tag tables below follow the data in the MIT-licensed identify project
// (https://github.com/pre-commit/identify, © 2017 Chris Kuehl, Anthony Sottile).
// A hook's types/types_or/exclude_types filters are matched against these tags,
// so a tag this project gets wrong is a hook that silently skips or wrongly
// claims a file: when the two disagree, upstream is right. See NOTICE.
package identify

import (
Expand Down