diff --git a/CHANGELOG.md b/CHANGELOG.md index d19cd8f..72d761d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,8 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## Unreleased -- No changes yet. +## 0.4.0 - 2024-04-03 +### Added +- ([#150]) `--skip-generated` flag to skip running on files containing + generated code. + + [#150]: https://github.com/uber-go/gopatch/pull/150 ## 0.3.0 - 2023-07-14 ### Added diff --git a/README.md b/README.md index 4aa36d9..45dc0ef 100644 --- a/README.md +++ b/README.md @@ -64,7 +64,7 @@ running the following command in your terminal and place it on your `$PATH`. [Releases page]: https://github.com/uber-go/gopatch/releases ```bash -VERSION=0.3.0 +VERSION=0.4.0 URL="https://github.com/uber-go/gopatch/releases/download/v$VERSION/gopatch_${VERSION}_$(uname -s)_$(uname -m).tar.gz" curl -L "$URL" | tar xzv gopatch ``` @@ -247,6 +247,16 @@ gopatch supports the following command line options. $ gopatch --skip-import-processing -p foo.patch -p bar.patch path/to/my/project ``` +- `--skip-generated` + + Flag to turn on skip-generated code mode. Provide this flag to skip running the + tool on generated code. A file is considered containing generated code if it + has `@generated` or `^// Code generated .* DO NOT EDIT\.$` in the comment + header. + ```shell + $ gopatch --skip-generated -p foo.patch -p bar.patch path/to/my/project + ``` + # Patches Patch files are the input to gopatch that specify how to transform code. Each