forked from blockchain/blockchain-wallet-v4-frontend
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add reducer file commit hook warning
- Loading branch information
schnogz
committed
Feb 20, 2019
1 parent
33f2248
commit 36cb4dc
Showing
2 changed files
with
21 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* eslint-disable */ | ||
const chalk = require('chalk') | ||
const sgf = require('staged-git-files') | ||
|
||
// checks current files in commit for reducer files. Warning user if any are found | ||
sgf((error, files) => { | ||
if (error) return | ||
if ( | ||
files | ||
.map(file => file.filename) | ||
.filter(filename => filename.includes('reducer')).length | ||
) { | ||
console.log( | ||
chalk.red.bold('.: Warning :.\n') + | ||
chalk.yellow( | ||
"You've modified a reducer file. Please verify the Redux state import/export feature still works before creating PR." | ||
) | ||
) | ||
} | ||
}) |