Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate the installation of pre-commit to -f|--format case #28

Merged
merged 3 commits into from
Mar 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ To upload images to a PR -- simply drag and drop an image while in edit mode and

## Checklist

- [ ] I have run the [`pre-commit` checks](https://pre-commit.com/) with `pre-commit run --all-files` (see [here](https://pre-commit.com/#install) instructions to set it up)
- [ ] I have run the [`pre-commit` checks](https://pre-commit.com/) with `./orbit.sh --format`
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my feature works
Expand Down
2 changes: 1 addition & 1 deletion docs/source/refs/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ following command in the terminal:

.. code:: bash

pre-commit run --all-files
./orbit.sh --format

Maintaining a changelog
-----------------------
Expand Down
2 changes: 1 addition & 1 deletion docs/source/setup/developer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -248,4 +248,4 @@ To run over the entire repository, please execute the following command in the t

.. code:: bash

pre-commit run --all-files
./orbit.sh --format
9 changes: 7 additions & 2 deletions orbit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,6 @@ while [[ $# -gt 0 ]]; do
# this does not check dependencies between extensions
export -f extract_isaacsim_python
export -f install_orbit_extension
# initialize git hooks
pip install pre-commit
# source directory
find -L "${ORBIT_PATH}/source/extensions" -mindepth 1 -maxdepth 1 -type d -exec bash -c 'install_orbit_extension "{}"' \;
# unset local variables
Expand Down Expand Up @@ -146,8 +144,15 @@ while [[ $# -gt 0 ]]; do
;;
# run the formatter over the repository
-f|--format)
if ! command -v pre-commit &>/dev/null; then
echo "[INFO] Installing pre-commit..."
pip install pre-commit
Mayankm96 marked this conversation as resolved.
Show resolved Hide resolved
fi
echo "[INFO] Formatting the repository..."
# always execute inside the Orbit directory
cd "${ORBIT_PATH}"
pre-commit run --all-files
cd -
shift # past argument
# exit neatly
break
Expand Down