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

Commit

Permalink
Merge pull request #74 from magopian/12-add-pre-commit-hook
Browse files Browse the repository at this point in the history
Add pre-commit hooks to run the linting
  • Loading branch information
rehandalal committed Apr 4, 2018
2 parents 8104fae + 3b64cda commit a2f1e79
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 1 deletion.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,14 @@
One admin to rule them all

[Documentation on ReadTheDocs](https://delivery-console.readthedocs.io/)

# Contributing

When contributing code to the repository, here are a few things to know:

- you should create a branch on your own fork, and create a pull-request from there
- the pull-requests will all run in CircleCI
- 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`
- 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 ...`

Regarding `prettier`, it's very convenient to [configure your editor](https://prettier.io/docs/en/editors.html) to "auto-format on save".
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"enzyme": "^3.3.0",
"flow-bin": "^0.66.0",
"pre-commit": "^1.2.2",
"prettier": "^1.11.1",
"react-app-rewire-less": "^2.1.0",
"react-app-rewired": "^1.4.1",
Expand All @@ -54,5 +55,8 @@
"^console/(.*)$": "<rootDir>/src/console/$1",
"^normandy/(.*)$": "<rootDir>/src/normandy/$1"
}
}
},
"pre-commit": [
"lint"
]
}
38 changes: 38 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1415,6 +1415,10 @@ bser@^2.0.0:
dependencies:
node-int64 "^0.4.0"

buffer-from@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.0.0.tgz#4cb8832d23612589b0406e9e2956c17f06fdf531"

buffer-indexof@^1.0.0:
version "1.1.1"
resolved "https://registry.yarnpkg.com/buffer-indexof/-/buffer-indexof-1.1.1.tgz#52fabcc6a606d1a00302802648ef68f639da268c"
Expand Down Expand Up @@ -1839,6 +1843,15 @@ concat-map@0.0.1:
version "0.0.1"
resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"

concat-stream@^1.4.7:
version "1.6.2"
resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.2.tgz#904bdf194cd3122fc675c77fc4ac3d4ff0fd1a34"
dependencies:
buffer-from "^1.0.0"
inherits "^2.0.3"
readable-stream "^2.2.2"
typedarray "^0.0.6"

concat-stream@^1.6.0:
version "1.6.1"
resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.1.tgz#261b8f518301f1d834e36342b9fea095d2620a26"
Expand Down Expand Up @@ -5689,6 +5702,10 @@ os-locale@^2.0.0:
lcid "^1.0.0"
mem "^1.1.0"

os-shim@^0.1.2:
version "0.1.3"
resolved "https://registry.yarnpkg.com/os-shim/-/os-shim-0.1.3.tgz#6b62c3791cf7909ea35ed46e17658bb417cb3917"

os-tmpdir@^1.0.0, os-tmpdir@^1.0.1, os-tmpdir@~1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274"
Expand Down Expand Up @@ -6298,6 +6315,14 @@ postcss@^6.0.0, postcss@^6.0.1, postcss@^6.0.13, postcss@^6.0.14, postcss@^6.0.1
source-map "^0.6.1"
supports-color "^5.2.0"

pre-commit@^1.2.2:
version "1.2.2"
resolved "https://registry.yarnpkg.com/pre-commit/-/pre-commit-1.2.2.tgz#dbcee0ee9de7235e57f79c56d7ce94641a69eec6"
dependencies:
cross-spawn "^5.0.1"
spawn-sync "^1.0.15"
which "1.2.x"

prelude-ls@~1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54"
Expand Down Expand Up @@ -7879,6 +7904,13 @@ source-map@^0.6.1, source-map@~0.6.1:
version "0.6.1"
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263"

spawn-sync@^1.0.15:
version "1.0.15"
resolved "https://registry.yarnpkg.com/spawn-sync/-/spawn-sync-1.0.15.tgz#b00799557eb7fb0c8376c29d44e8a1ea67e57476"
dependencies:
concat-stream "^1.4.7"
os-shim "^0.1.2"

spdx-correct@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.0.0.tgz#05a5b4d7153a195bc92c3c425b69f3b2a9524c82"
Expand Down Expand Up @@ -8906,6 +8938,12 @@ which-module@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a"

which@1.2.x:
version "1.2.14"
resolved "https://registry.yarnpkg.com/which/-/which-1.2.14.tgz#9a87c4378f03e827cecaf1acdf56c736c01c14e5"
dependencies:
isexe "^2.0.0"

which@^1.2.12, which@^1.2.14, which@^1.2.9, which@^1.3.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/which/-/which-1.3.0.tgz#ff04bdfc010ee547d780bec38e1ac1c2777d253a"
Expand Down

0 comments on commit a2f1e79

Please sign in to comment.