From 5d2db7806ff05c3446efac773966957f1df0d581 Mon Sep 17 00:00:00 2001 From: Blair Hamilton Date: Mon, 17 Aug 2026 21:10:49 -0400 Subject: [PATCH] docs: attribute the projects this reimplements MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This repo is Apache-2.0 and reimplements two MIT-licensed projects, and until now said so nowhere that carries legal weight: no NOTICE, and no copyright line for either upstream anywhere in the tree. The README's one-line "a Go reimplementation of pre-commit" is a description, not an attribution. internal/identify is the concrete exposure. Its extension, filename and interpreter tables follow upstream identify's data closely, because they have to — those tags are what hooks' types filters match against, so a table that diverges is a hook that silently skips files. NOTICE reproduces both MIT licenses in full and states plainly that this is neither affiliated with nor endorsed by the pre-commit project, so a reader who arrives from upstream learns that in the first paragraph rather than inferring it. GoReleaser now ships NOTICE in every archive, which is what Apache-2.0 section 4(d) actually asks for; listing files at all overrides its defaults, hence LICENSE and README reappearing there. Refs #43 --- .goreleaser.yaml | 8 ++++++ NOTICE | 51 +++++++++++++++++++++++++++++++++++ README.md | 22 ++++++++++++++- internal/identify/identify.go | 6 +++++ 4 files changed, 86 insertions(+), 1 deletion(-) create mode 100644 NOTICE diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 3ef71bd..7fb3801 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -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: diff --git a/NOTICE b/NOTICE new file mode 100644 index 0000000..f94ecba --- /dev/null +++ b/NOTICE @@ -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. diff --git a/README.md b/README.md index 5dc636f..e7a3559 100644 --- a/README.md +++ b/README.md @@ -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). diff --git a/internal/identify/identify.go b/internal/identify/identify.go index 2ca0336..e135956 100644 --- a/internal/identify/identify.go +++ b/internal/identify/identify.go @@ -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 (