mirror of
https://github.com/wassname/ray.git
synced 2026-07-16 11:21:10 +08:00
Add linting pre-push hook (#5154)
This commit is contained in:
committed by
Richard Liaw
parent
5ab5017c67
commit
2b7b7c7547
+3
-1
@@ -18,7 +18,9 @@ To contribute a patch:
|
||||
harder to merge in a large change with a lot of disjoint features.
|
||||
2. Submit the patch as a GitHub pull request against the master branch.
|
||||
3. Make sure that your code passes the unit tests.
|
||||
4. Add new unit tests for your code.
|
||||
4. Make sure that your code passes the linter. Run setup_hooks.sh to create
|
||||
a git hook that will run the linter before you push your changes.
|
||||
5. Add new unit tests for your code.
|
||||
|
||||
.. _`ray-dev@googlegroups.com`: https://groups.google.com/forum/#!forum/ray-dev
|
||||
.. _`GitHub Issues`: https://github.com/ray-project/ray/issues
|
||||
|
||||
Executable
+18
@@ -0,0 +1,18 @@
|
||||
#!/bin/sh
|
||||
|
||||
echo "Linting changes as part of pre-push hook"
|
||||
echo ""
|
||||
echo "ci/travis/format.sh:"
|
||||
ci/travis/format.sh
|
||||
|
||||
lint_exit_status=$?
|
||||
if [ $lint_exit_status -ne 0 ]; then
|
||||
echo ""
|
||||
echo "Linting changes failed."
|
||||
echo "Please make sure 'ci/travis/format.sh'"\
|
||||
"runs with no errors before pushing."
|
||||
echo "If you want to ignore this and push anyways,"\
|
||||
"re-run with '--no-verify'."
|
||||
exit 1
|
||||
fi
|
||||
exit 0
|
||||
Executable
+2
@@ -0,0 +1,2 @@
|
||||
#!/bin/bash
|
||||
ln -s $PWD/hooks/pre-push $PWD/.git/hooks/pre-push
|
||||
Reference in New Issue
Block a user