Repository: modin-project/modin
Pull request: DOCS-#3650: Add optional onboarding instructions and s/onboarding/contributing.
Signed-off-by: mvashishtha <mahesh@ponder.io>


## What do these changes do?

- Move "onboarding" to "contributing".

- Add instructions to:
  - A pre-commit hook requiring flake8 to pass before making any commit.
  - Make VSCode format code with black on save.

- Reference the new "contributing" doc in the readthedocs.


- [x] commit message follows format outlined [here](https://modin.readthedocs.io/en/latest/contributing.html)
- [x] passes `flake8 modin/ asv_bench/benchmarks scripts/doc_checker.py`
- [x] passes `black --check modin/ asv_bench/benchmarks scripts/doc_checker.py`
- [x] signed commit with `git commit -s` <!-- you can amend your commit with a signature via `git commit -amend -s` -->
- [x] Resolves #3650  <!-- issue must be created for each patch -->
- [x] tests added and passing
- [x] module layout described at `docs/developer/architecture.rst` is up-to-date <!-- if you have added, renamed or removed files or directories please update the documentation accordingly -->


Problem statement:
Add optional development environment steps to onboarding instructions.
I found the following to be helpful:

- A pre-commit hook requiring flake8 to pass before making any commit.
- Making VSCode format my code with black on save.

I can get a Python Debugger to work in VSCode for personal debug scripts, but not for pytest unit tests, so I won't add instructions on that for now.

Hints from issue discussion:

Commit message: Fix the link to contributing instructions.

Signed-off-by: mvashishtha <mahesh@ponder.io>

Patch to review:
diff --git a/onboarding/clone_my_modin.png b/contributing/clone_my_modin.png
similarity index 100%
rename from onboarding/clone_my_modin.png
rename to contributing/clone_my_modin.png
diff --git a/onboarding/clone_upstream_modin.png b/contributing/clone_upstream_modin.png
similarity index 100%
rename from onboarding/clone_upstream_modin.png
rename to contributing/clone_upstream_modin.png
diff --git a/onboarding/conda_prompt.png b/contributing/conda_prompt.png
similarity index 100%
rename from onboarding/conda_prompt.png
rename to contributing/conda_prompt.png
diff --git a/onboarding/onboarding.md b/contributing/contributing.md
similarity index 69%
rename from onboarding/onboarding.md
rename to contributing/contributing.md
index 1f9511c3f0b..b368db0a94c 100644
--- a/onboarding/onboarding.md
+++ b/contributing/contributing.md
@@ -76,3 +76,16 @@ you should reopen your terminal to find "(base)" next to your prompt: ![](conda_
     ```
 
 1. [Add a GPG key](https://docs.github.com/en/authentication/managing-commit-signature-verification/adding-a-new-gpg-key-to-your-github-account ) to your Modin account. Your commits need to be signed with a GPG key. For mac, you can use [Mac GPG](https://gpgtools.org/).
+
+
+1. (Optional) We recommend a few workflow settings:
+
+    1. If you use Visual Studio Code, auto-format with [black](https://black.readthedocs.io/en/stable/) every time you save changes:
+        1. Install [Microsoft's Python extension](https://marketplace.visualstudio.com/items?itemName=ms-python.python)
+        1. Open your VSCode settings, in `Code -> Preferences -> Settings`.
+        1. Search for "python formatting provider" and select "black" from the dropdown menu.
+        1. Again in settings, search for "format on save" and enable the "Editor: Format on Save" option.
+    2. Add a pre-commit hook:
+        1. In your modin repository, copy [this pre-commit file](pre-commit) to `.git/hooks/pre-commit`
+        1. Every time you try to commit, git will run flake8 and scripts/doc_checker.py and abort the commit if either fails. This lets you make sure your commits pass these tests before you commit them to GitHub.
+        1. To bypass the pre-commit hook (e.g. if you don't want to create a pull request, or you already know your code will pass the tests), commit with the flag `--no-verify`.
\ No newline at end of file
diff --git a/contributing/pre-commit b/contributing/pre-commit
new file mode 100755
index 00000000000..f266d904536
--- /dev/null
+++ b/contributing/pre-commit
@@ -0,0 +1,14 @@
+#!/bin/sh
+#
+# Called by "git commit" with no arguments.  The hook should
+# exit with non-zero status after issuing an appropriate message if
+# it wants to stop the commit.
+#
+
+set -e
+
+printf "running flake8. This script will preempt the commit if flake8 fails.\n"
+flake8 modin/ asv_bench/benchmarks scripts/doc_checker.py
+printf "flake8 passed!\n"
+
+printf "pre-commit hook finished!\n"
diff --git a/docs/contributing.rst b/docs/contributing.rst
index 84940a9a1bb..f9f4d202e80 100644
--- a/docs/contributing.rst
+++ b/docs/contributing.rst
@@ -13,6 +13,9 @@ want to review in order to get started.
 
 Also, feel free to join the discussions on the `developer mailing list`_.
 
+If you want a quick guide to getting your development enviroment setup, please
+use `the contributing instructions on GitHub`_.
+
 Certificate of Origin
 ---------------------
 
@@ -221,3 +224,4 @@ More docs on this coming soon...
 .. _developer mailing list: https://groups.google.com/forum/#!forum/modin-dev
 .. _Asv dashboard: https://modin.org/modin-bench/#/
 .. _Asv readme: https://github.com/modin-project/modin/blob/master/asv_bench/README.md
+.. _the contributing instructions on GitHub: https://github.com/modin-project/modin/blob/master/contributing/contributing.md
\ No newline at end of file


Code review comments:
diff_hunk: @@ -76,3 +76,16 @@ you should reopen your terminal to find "(base)" next to your prompt: ![](conda_
     ```
 
 1. [Add a GPG key](https://docs.github.com/en/authentication/managing-commit-signature-verification/adding-a-new-gpg-key-to-your-github-account ) to your Modin account. Your commits need to be signed with a GPG key. For mac, you can use [Mac GPG](https://gpgtools.org/).
+
+
+1. (Optional) We recommend a few workflow settings:
+
+    1. If you use Visual Studio Code, auto-format with [black](https://black.readthedocs.io/en/stable/) every time you save changes:
+        1. Install [Microsoft's Python extension](https://marketplace.visualstudio.com/items?itemName=ms-python.python)
+        1. Open your VSCode settings, in `Code -> Preferences -> Settings`.
+        1. Search for "python formatting provider" and select "black" from the dropdown menu.
+        1. Again in settings, search for "format on save" and enable the "Editor: Format on Save" option.
+    2. Add a pre-commit hook:
+        1. In your modin repository, copy [this pre-commit file](pre-commit) to `.git/hooks/pre-commit`
+        1. Every time you try to commit, git will run flake8 and scripts/doc_checker.py and abort the commit if either fails. This lets you make sure your commits pass these tests before you commit them to GitHub.
path: contributing/contributing.md
text: @user1:
I do not see `scripts/doc_checker.py` run in pre-commit file.

@author:
I deleted the reference to it here.