From 51351f848e0e907418d641fbc4592d9b2ac86399 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 4 Aug 2022 14:07:47 -0400 Subject: [PATCH] chore: add `.git-blame-ignore-revs` to ignore `prettier --write .` commit in diffs --- .git-blame-ignore-revs | 5 +++++ CONTRIBUTING.md | 2 ++ scripts/postinstall.ts | 6 +++++- 3 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 .git-blame-ignore-revs diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs new file mode 100644 index 0000000000..b138d5493f --- /dev/null +++ b/.git-blame-ignore-revs @@ -0,0 +1,5 @@ +# .git-blame-ignore-revs + +# Ran `npx prettier@2.7.1 --write .` on the entire codebase + +## TODO: update this line with the commit hash of the `prettier --write .` commit once it lands in develop diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8c2bdffde3..78ed295301 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -11,6 +11,8 @@ - `cd ganache` - `npm install` (use npm v6) - On Linux and macOS: run `source completions.sh` to enable autocomplete for npm scripts. +- For better local `git diff` results run `git config blame.ignoreRevsFile .git-blame-ignore-revs` to automatically ignore + large formatting/style revisions. ## Solving node-gyp issues diff --git a/scripts/postinstall.ts b/scripts/postinstall.ts index fbc7f2aa39..47a0bb1c3d 100644 --- a/scripts/postinstall.ts +++ b/scripts/postinstall.ts @@ -30,7 +30,11 @@ require("./link-ts-references"); execSync("npm run tsc", execArgs); console.log(""); +console.log(chalk`{bold.cyan Tips:}`); console.log( - chalk`{bold.cyan Tip:} {cyan run} {bold.yellow.dim source completions.sh} {cyan to supply bash completions for npm scripts}` + chalk` {cyan run} {bold.yellow.dim source completions.sh} {cyan to supply bash completions for npm scripts}` +); +console.log( + chalk` {cyan run} {bold.yellow.dim git config blame.ignoreRevsFile .git-blame-ignore-revs} {cyan to ignore large formatting/style revisions from local {bold.yellow.dim git diff} results}` ); console.log("");