diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..0d0b07d6 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,13 @@ +repos: +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v6.0.0 + hooks: + - id: check-yaml + - id: end-of-file-fixer + - id: trailing-whitespace +- repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.15.1 + hooks: + - id: ruff-check + args: [ --fix ] + - id: ruff-format diff --git a/README.md b/README.md index 20ef4533..4b36ed1a 100644 --- a/README.md +++ b/README.md @@ -104,7 +104,7 @@ First, you will need to log in to Nvidia NGC and get an API Key here: https://or Then install Nvidia ngc CLI and make sure it is present in path: https://org.ngc.nvidia.com/setup/installers/cli Follow the instructions on the website to install and configure ngc. - + Test the ngc installation by running `ngc` in a new terminal. If it doesn't work, try adding `echo "export PATH=\"\$PATH:$(pwd)/ngc-cli\"" >> ~/.bash_profile && source ~/.bash_profile` to your `~/.bashrc` file. Then log in to nvcr with the following command: @@ -151,12 +151,19 @@ To normalize line endings in git, use the command: git config --global core.autocrlf true ``` +The formatter the codebase uses is ruff. Run `pip install ruff` to install ruff. + +To have ruff automatically run on commit use pre-commit. + +To install pre-commit run `pip install pre-commit`, then run `pre-commit install` to have the hooks installed. Now any time a commit is started, staged changes will be automatically formatted. +To run the formatter without initiating a commit run `pre-commit`. + ## Gazebo Simulation
Gazebo Installation & Resources
- + Install Gazebo Fortress by running: `sudo apt-get install ros-humble-ros-gz` More info [here](https://gazebosim.org/docs/garden/ros_installation). Remember that we are using ROS 2 Humble. @@ -169,7 +176,7 @@ Information about ROS types -> gazebo types can be found [here](https://github.c
Running the Gazebo Simulation
- + To run the Gazebo simulation: ``` colcon build --symlink-install --packages-up-to ros_gz_launch @@ -255,7 +262,7 @@ sudo grep -a 'mycmd' /var/log/syslog
Gstreamer Server/Client Instructions
-To start gstreamer client make sure to add the deepstream layer to the docker layers +To start gstreamer client make sure to add the deepstream layer to the docker layers To start the gstreamer client run the following commands: diff --git a/ruff.toml b/ruff.toml new file mode 100644 index 00000000..467ed6bd --- /dev/null +++ b/ruff.toml @@ -0,0 +1,8 @@ +# exclude all of the sub modules +exclude = [ + "src/zed-ros2-wrapper", + "src/isaac_ros/isaac_ros_apriltag", + "src/isaac_ros/isaac_ros_image_pipeline", + "src/isaac_ros/isaac_ros_nitros", + "src/isaac_ros/isaac_ros_visual_slam", + ]