Skip to content
This repository was archived by the owner on May 27, 2021. It is now read-only.

Commit a2f1e79

Browse files
authored
Merge pull request #74 from magopian/12-add-pre-commit-hook
Add pre-commit hooks to run the linting
2 parents 8104fae + 3b64cda commit a2f1e79

File tree

3 files changed

+54
-1
lines changed

3 files changed

+54
-1
lines changed

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,14 @@
66
One admin to rule them all
77

88
[Documentation on ReadTheDocs](https://delivery-console.readthedocs.io/)
9+
10+
# Contributing
11+
12+
When contributing code to the repository, here are a few things to know:
13+
14+
- you should create a branch on your own fork, and create a pull-request from there
15+
- the pull-requests will all run in CircleCI
16+
- CircleCI builds will fail if there's any linting issues. You can check linting issues with `yarn run lint`, and auto-fix [prettier](https://prettier.io/) issues using `yarn run lint:prettierfix`
17+
- pre-commit hooks will block your commit if there are linting issues. You can (but should not) skip the pre-commit hooks with `git commit --no-verify ...`
18+
19+
Regarding `prettier`, it's very convenient to [configure your editor](https://prettier.io/docs/en/editors.html) to "auto-format on save".

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
"babel-plugin-transform-decorators-legacy": "^1.3.4",
4242
"enzyme": "^3.3.0",
4343
"flow-bin": "^0.66.0",
44+
"pre-commit": "^1.2.2",
4445
"prettier": "^1.11.1",
4546
"react-app-rewire-less": "^2.1.0",
4647
"react-app-rewired": "^1.4.1",
@@ -54,5 +55,8 @@
5455
"^console/(.*)$": "<rootDir>/src/console/$1",
5556
"^normandy/(.*)$": "<rootDir>/src/normandy/$1"
5657
}
57-
}
58+
},
59+
"pre-commit": [
60+
"lint"
61+
]
5862
}

yarn.lock

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1415,6 +1415,10 @@ bser@^2.0.0:
14151415
dependencies:
14161416
node-int64 "^0.4.0"
14171417

1418+
buffer-from@^1.0.0:
1419+
version "1.0.0"
1420+
resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.0.0.tgz#4cb8832d23612589b0406e9e2956c17f06fdf531"
1421+
14181422
buffer-indexof@^1.0.0:
14191423
version "1.1.1"
14201424
resolved "https://registry.yarnpkg.com/buffer-indexof/-/buffer-indexof-1.1.1.tgz#52fabcc6a606d1a00302802648ef68f639da268c"
@@ -1839,6 +1843,15 @@ [email protected]:
18391843
version "0.0.1"
18401844
resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
18411845

1846+
concat-stream@^1.4.7:
1847+
version "1.6.2"
1848+
resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.2.tgz#904bdf194cd3122fc675c77fc4ac3d4ff0fd1a34"
1849+
dependencies:
1850+
buffer-from "^1.0.0"
1851+
inherits "^2.0.3"
1852+
readable-stream "^2.2.2"
1853+
typedarray "^0.0.6"
1854+
18421855
concat-stream@^1.6.0:
18431856
version "1.6.1"
18441857
resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.1.tgz#261b8f518301f1d834e36342b9fea095d2620a26"
@@ -5689,6 +5702,10 @@ os-locale@^2.0.0:
56895702
lcid "^1.0.0"
56905703
mem "^1.1.0"
56915704

5705+
os-shim@^0.1.2:
5706+
version "0.1.3"
5707+
resolved "https://registry.yarnpkg.com/os-shim/-/os-shim-0.1.3.tgz#6b62c3791cf7909ea35ed46e17658bb417cb3917"
5708+
56925709
os-tmpdir@^1.0.0, os-tmpdir@^1.0.1, os-tmpdir@~1.0.2:
56935710
version "1.0.2"
56945711
resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274"
@@ -6298,6 +6315,14 @@ postcss@^6.0.0, postcss@^6.0.1, postcss@^6.0.13, postcss@^6.0.14, postcss@^6.0.1
62986315
source-map "^0.6.1"
62996316
supports-color "^5.2.0"
63006317

6318+
pre-commit@^1.2.2:
6319+
version "1.2.2"
6320+
resolved "https://registry.yarnpkg.com/pre-commit/-/pre-commit-1.2.2.tgz#dbcee0ee9de7235e57f79c56d7ce94641a69eec6"
6321+
dependencies:
6322+
cross-spawn "^5.0.1"
6323+
spawn-sync "^1.0.15"
6324+
which "1.2.x"
6325+
63016326
prelude-ls@~1.1.2:
63026327
version "1.1.2"
63036328
resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54"
@@ -7879,6 +7904,13 @@ source-map@^0.6.1, source-map@~0.6.1:
78797904
version "0.6.1"
78807905
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263"
78817906

7907+
spawn-sync@^1.0.15:
7908+
version "1.0.15"
7909+
resolved "https://registry.yarnpkg.com/spawn-sync/-/spawn-sync-1.0.15.tgz#b00799557eb7fb0c8376c29d44e8a1ea67e57476"
7910+
dependencies:
7911+
concat-stream "^1.4.7"
7912+
os-shim "^0.1.2"
7913+
78827914
spdx-correct@^3.0.0:
78837915
version "3.0.0"
78847916
resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.0.0.tgz#05a5b4d7153a195bc92c3c425b69f3b2a9524c82"
@@ -8906,6 +8938,12 @@ which-module@^2.0.0:
89068938
version "2.0.0"
89078939
resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a"
89088940

8941+
8942+
version "1.2.14"
8943+
resolved "https://registry.yarnpkg.com/which/-/which-1.2.14.tgz#9a87c4378f03e827cecaf1acdf56c736c01c14e5"
8944+
dependencies:
8945+
isexe "^2.0.0"
8946+
89098947
which@^1.2.12, which@^1.2.14, which@^1.2.9, which@^1.3.0:
89108948
version "1.3.0"
89118949
resolved "https://registry.yarnpkg.com/which/-/which-1.3.0.tgz#ff04bdfc010ee547d780bec38e1ac1c2777d253a"

0 commit comments

Comments
 (0)