Skip to content

Commit

Permalink
Adds codespell to pre-commit configuration file (#38)
Browse files Browse the repository at this point in the history
# Description

<!--
Thank you for your interest in sending a pull request. Please make sure to check the contribution guidelines.

Link: https://isaac-orbit.github.io/orbit/source/refs/contributing.html
-->

Since many of us are working, it makes sense to have a spell checker to ensure we have the right words everywhere. The PR adds [codespell](https://github.com/codespell-project/codespell) to the pre-commit file that allows checking for typos/spellings in the repository.

The tool is available under a GPL-2.0 license and is fetched using its PyPi release. The repo's BSD-3 is compatible with  GNU-GPL family of licenses.  We do not modify any of the codespell's source code. The license file is included in the repository for the sake of completion.

<!-- As a practice, it is recommended to open an issue to have discussions on the proposed pull request.
This makes it easier for the community to keep track of what is being developed or added, and if a given feature
is demanded by more than one party. -->

## Type of change

<!-- As you go through the list, delete the ones that are not applicable. -->

- New feature (non-breaking change which adds functionality)

<!--
Example:

| Before | After |
| ------ | ----- |
| _gif/png before_ | _gif/png after_ |

To upload images to a PR -- simply drag and drop an image while in edit mode and it should upload the image directly. You can then paste that source into the above before/after sections.
-->

## Checklist

- [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with `./orbit.sh --format`
- [x] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] I have updated the changelog and the corresponding version in the extension's `config/extension.toml` file

<!--
As you go through the checklist above, you can mark something as done by putting an x character in it

For example,
- [x] I have done this task
- [ ] I have not done this task
-->
  • Loading branch information
Mayankm96 committed Jun 26, 2023
1 parent 0c6a23b commit f2d97bd
Show file tree
Hide file tree
Showing 11 changed files with 365 additions and 13 deletions.
14 changes: 10 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/python/black
rev: 23.1.0
rev: 23.3.0
hooks:
- id: black
args: ["--line-length", "120"]
Expand Down Expand Up @@ -31,18 +31,24 @@ repos:
name: isort (python)
args: ["--profile", "black", "--filter-files"]
- repo: https://github.com/asottile/pyupgrade
rev: v3.3.1
rev: v3.7.0
hooks:
- id: pyupgrade
args: ["--py37-plus"]
- repo: https://github.com/codespell-project/codespell
rev: v2.2.4
hooks:
- id: codespell
additional_dependencies:
- tomli
# FIXME: Figure out why this is getting stuck under VPN.
# - repo: https://github.com/RobertCraigie/pyright-python
# rev: v1.1.296
# rev: v1.1.315
# hooks:
# - id: pyright
# Note: We disable this by default since not all code is compatible with it.
# - repo: https://github.com/Lucas-C/pre-commit-hooks
# rev: v1.4.2
# rev: v1.5.1
# hooks:
# - id: insert-license
# files: \.py$
Expand Down
2 changes: 1 addition & 1 deletion .vscode/tools/setup_vscode.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def overwrite_default_python_interpreter(orbit_settings: str) -> str:
Returns:
The settings string with overwritten default python interpreter.
"""
# read executble name
# read executable name
python_exe = sys.executable
# if python interpreter is from conda, use that. Otherwise, use the template.
if "conda" not in python_exe:
Expand Down
339 changes: 339 additions & 0 deletions docs/licenses/dependencies/codespell-license.txt

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/source/api/orbit.actuators.group.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Each string has two sub-strings joined by underscore:
For instance, the command type ``"p_abs"`` defines a position command in absolute mode, while ``"v_rel"``
defines a velocity command in relative mode.

To facilitate easier composibility, the actuator group handles the offsets and scalings applied to
To facilitate easier composability, the actuator group handles the offsets and scalings applied to
the input commands. These are set through the :class:`ActuatorControlCfg` and by default are set to zero
and one, respectively. Based on these, the input commands are processed as follows:

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 @@ -72,7 +72,7 @@ We use the following tools for maintaining code quality:
* `pre-commit <https://pre-commit.com/>`__: Runs a list of formatters and linters over the codebase.
* `black <https://black.readthedocs.io/en/stable/>`__: The uncompromising code formatter.
* `flake8 <https://flake8.pycqa.org/en/latest/>`__: A wrapper around PyFlakes, pycodestyle and
Ned Batchelder's McCabe script.
McCabe complexity checker.

Please check `here <https://pre-commit.com/#install>`__ for instructions
to set these up. To run over the entire repository, please execute the
Expand Down
2 changes: 1 addition & 1 deletion docs/source/refs/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ motion planning). The main goals of the framework are summarized as follows:

- **Modularity**: It is possible to easily add new environments, sensors, and tasks. It is also possible
to easily swap out different components to suit the needs of the user.
- **Agility**: While still dependant on Isaac Sim, the framework includes pre-release features that
- **Agility**: While still dependent on Isaac Sim, the framework includes pre-release features that
are not yet available in Isaac Sim. This allows the framework to be more agile and adapt to the
changing needs of the community.
- **Openness**: The framework is designed to be open-sourced. This makes it possible to easily
Expand Down
4 changes: 2 additions & 2 deletions orbit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ setup_conda_env() {
'export RESOURCE_NAME="IsaacSim"' \
'' > ${CONDA_PREFIX}/etc/conda/activate.d/setenv.sh
# reactivate the environment to load the variables
# needed because deactivate complains about orbit alias since it otherwise doens't exist
# needed because deactivate complains about orbit alias since it otherwise doesn't exist
conda activate ${env_name}
# remove variables from environment during deactivation
printf '%s\n' '#!/bin/bash' '' \
Expand All @@ -158,7 +158,7 @@ setup_conda_env() {
# add information to the user about alias
echo -e "[INFO] Added 'orbit' alias to conda environment for 'orbit.sh' script."
echo -e "[INFO] Created conda environment named '${env_name}'.\n"
echo -e "\t\t1. To activate the enviornment, run: conda activate ${env_name}"
echo -e "\t\t1. To activate the environment, run: conda activate ${env_name}"
echo -e "\t\t2. To install orbit extensions, run: orbit -i"
echo -e "\t\t3. To install learning-related dependencies, run: orbit -e"
echo -e "\t\t4. To perform formatting, run: orbit -f"
Expand Down
7 changes: 7 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,10 @@ reportMissingModuleSource = "none" # -> most common: prettytable in mdp managers
reportGeneralTypeIssues = "none" # -> raises 218 errors (usage of literal MISSING in dataclasses)
reportOptionalMemberAccess = "warning" # -> raises 8 errors
reportPrivateUsage = "warning"


[tool.codespell]
skip = '*.usd,*.svg,*.png,_isaac_sim*,*.bib,*.css,*/_build'
quiet-level = 0
# the world list should always have words in lower case
ignore-words-list = "haa,slq"
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class NonHolonomicKinematicsGroup(ActuatorGroup):
the value of the revolute joint along z, i.e., :math:`q_2 = \theta`.
Tip:
For velocity control of the base with dummy mechanism, we recommed setting high damping gains to the joints.
For velocity control of the base with dummy mechanism, we recommend setting high damping gains to the joints.
This ensures that the base remains unperturbed from external disturbances, such as an arm mounted on the base.
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ def _create_key_bindings(self):
}

self._INPUT_DPAD_VALUE_MAPPING = {
# pitch command (postive)
# pitch command (positive)
carb.input.GamepadInput.DPAD_UP: (1, 4, self.rot_sensitivity * 0.8),
# pitch command (negative)
carb.input.GamepadInput.DPAD_DOWN: (0, 4, self.rot_sensitivity * 0.8),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# SPDX-License-Identifier: BSD-3-Clause

"""Configuration fo the ANYbotics robots.
"""Configuration for the ANYbotics robots.
The following configuration parameters are available:
* :obj:`ANYMAL_B_CFG`: The ANYmal-B robot with ANYdrives 3.0
Expand Down

0 comments on commit f2d97bd

Please sign in to comment.