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 (