From 10045c8c36fb4aa043d674023c887f095aab1193 Mon Sep 17 00:00:00 2001 From: Kane Li <122249106+Li-Kane@users.noreply.github.com> Date: Sat, 15 Nov 2025 13:46:17 -0800 Subject: [PATCH 01/15] test autorun CI make sure colcon build works --- .github/workflows/main.yaml | 54 +++++++++++++++++++ requirements/all_requirements.txt | 17 ++++++ .../requirements.txt | 8 ++- 3 files changed, 74 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/main.yaml create mode 100644 requirements/all_requirements.txt rename requirements.txt => requirements/requirements.txt (61%) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml new file mode 100644 index 0000000..b86795c --- /dev/null +++ b/.github/workflows/main.yaml @@ -0,0 +1,54 @@ +name: Test Colcon Build +on: + push: + +jobs: + build_and_test_ros2: + runs-on: ubuntu-22.04 + container: + image: ros:humble-ros-base + + steps: + - name: Checkout code + uses: actions/checkout@v3 + with: + submodules: recursive + + - name: Set up Python virtual environment + shell: bash + run: | + # Install python3-venv if not available + apt-get update + + # Create virtual environment + python3 -m venv .venv + + # Activate and install dependencies + source .venv/bin/activate + pip install --upgrade pip + pip install -r requirements/all_requirements.txt + + - name: Install rosdep dependencies + run: | + # Update rosdep + apt-get update + rosdep update + + # Install dependencies from all packages in src/ + rosdep install --from-paths src --ignore-src -r -y + + - name: Build with colcon + shell: bash + run: | + # Activate venv and source ROS2 and workspace environment + source .venv/bin/activate + source /opt/ros/humble/setup.bash + + # Make sure build works (ignore hardware specific packages) + colcon build --packages-ignore \ + camera_node \ + tr-camera-basler \ + lidar_node \ + yolox_ros_cpp \ + yolox_ros \ + yolox_cpp \ No newline at end of file diff --git a/requirements/all_requirements.txt b/requirements/all_requirements.txt new file mode 100644 index 0000000..44909c6 --- /dev/null +++ b/requirements/all_requirements.txt @@ -0,0 +1,17 @@ +# colcon build deps +catkin_pkg==1.1.0 +empy==3.3.4 +lark==1.3.1 +catkin-pkg==1.1.0 +PyYAML==6.0.3 +setuptools==80.9.0 +jinja2==3.1.6 +typeguard==4.4.4 + +# for messages +numpy==1.26.4 + +# # for sim_node +mani_skill==3.0.0b21 +torch==2.9.1 +pynput==1.8.1 \ No newline at end of file diff --git a/requirements.txt b/requirements/requirements.txt similarity index 61% rename from requirements.txt rename to requirements/requirements.txt index c103544..469c334 100644 --- a/requirements.txt +++ b/requirements/requirements.txt @@ -1,11 +1,9 @@ -mani_skill -torch -pynput==1.8.1 - # colcon build deps catkin_pkg empy==3.3.4 lark catkin-pkg PyYAML -setuptools \ No newline at end of file +setuptools +jinja2 +typeguard \ No newline at end of file From 05dea4684c3d72180d4288f25e935991351d817f Mon Sep 17 00:00:00 2001 From: Kane Li <122249106+Li-Kane@users.noreply.github.com> Date: Sat, 15 Nov 2025 13:56:13 -0800 Subject: [PATCH 02/15] update perms --- .github/workflows/main.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index b86795c..1d7d62a 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -1,9 +1,12 @@ name: Test Colcon Build on: + pull_request: + branches: + - main push: jobs: - build_and_test_ros2: + build_and_run: runs-on: ubuntu-22.04 container: image: ros:humble-ros-base @@ -13,6 +16,7 @@ jobs: uses: actions/checkout@v3 with: submodules: recursive + token: ${{ secrets.GITHUB_TOKEN }} - name: Set up Python virtual environment shell: bash From ce00d959481d8cba008c14d8be455aac1956ca0f Mon Sep 17 00:00:00 2001 From: Kane Li <122249106+Li-Kane@users.noreply.github.com> Date: Sat, 15 Nov 2025 13:57:42 -0800 Subject: [PATCH 03/15] small fix and rerun ci --- requirements/all_requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/all_requirements.txt b/requirements/all_requirements.txt index 44909c6..0dd2bf4 100644 --- a/requirements/all_requirements.txt +++ b/requirements/all_requirements.txt @@ -11,7 +11,7 @@ typeguard==4.4.4 # for messages numpy==1.26.4 -# # for sim_node +# for sim_node mani_skill==3.0.0b21 torch==2.9.1 pynput==1.8.1 \ No newline at end of file From 6db2ad79db201cd1ea3f737e3ea8e3345bc65251 Mon Sep 17 00:00:00 2001 From: Kane Li <122249106+Li-Kane@users.noreply.github.com> Date: Sat, 15 Nov 2025 14:06:59 -0800 Subject: [PATCH 04/15] better perms --- .github/workflows/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 1d7d62a..18d567a 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -16,7 +16,7 @@ jobs: uses: actions/checkout@v3 with: submodules: recursive - token: ${{ secrets.GITHUB_TOKEN }} + token: ${{ secrets.GH_PAT }} - name: Set up Python virtual environment shell: bash From df467d350b843f026b783db9b8c720511e56714e Mon Sep 17 00:00:00 2001 From: Kane Li <122249106+Li-Kane@users.noreply.github.com> Date: Sat, 15 Nov 2025 14:08:38 -0800 Subject: [PATCH 05/15] Update main.yaml --- .github/workflows/main.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 18d567a..47f438f 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -23,6 +23,7 @@ jobs: run: | # Install python3-venv if not available apt-get update + apt-get install -y python3-venv # Create virtual environment python3 -m venv .venv From 5c6e000db2588037db3aa05a765cc9cac76b4e76 Mon Sep 17 00:00:00 2001 From: Kane Li <122249106+Li-Kane@users.noreply.github.com> Date: Sat, 15 Nov 2025 14:16:04 -0800 Subject: [PATCH 06/15] cache venv and rosdep cache venv and rosdep so it doesn't take as long --- .github/workflows/main.yaml | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 47f438f..056235b 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -18,6 +18,22 @@ jobs: submodules: recursive token: ${{ secrets.GH_PAT }} + - name: Cache Python dependencies + uses: actions/cache@v3 + with: + path: .venv + key: venv-${{ runner.os }}-${{ hashFiles('requirements/all_requirements.txt') }} + restore-keys: | + venv-${{ runner.os }}- + + - name: Cache apt packages + uses: actions/cache@v3 + with: + path: /var/cache/apt + key: apt-${{ runner.os }}-${{ hashFiles('src/**/package.xml') }} + restore-keys: | + apt-${{ runner.os }}- + - name: Set up Python virtual environment shell: bash run: | @@ -25,8 +41,10 @@ jobs: apt-get update apt-get install -y python3-venv - # Create virtual environment - python3 -m venv .venv + # Create virtual environment if it doesn't exist + if [ ! -d ".venv" ]; then + python3 -m venv .venv + fi # Activate and install dependencies source .venv/bin/activate From b6ad33c2914f0c86e451e63520bf7ab0dad66ccf Mon Sep 17 00:00:00 2001 From: Kane Li <122249106+Li-Kane@users.noreply.github.com> Date: Sat, 15 Nov 2025 14:41:30 -0800 Subject: [PATCH 07/15] cleaner structure --- .github/workflows/main.yaml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 056235b..3f60621 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -33,25 +33,25 @@ jobs: key: apt-${{ runner.os }}-${{ hashFiles('src/**/package.xml') }} restore-keys: | apt-${{ runner.os }}- - - - name: Set up Python virtual environment + + - name: Install Python Venv (if cache miss) + if: steps.cache-python-dependencies.outputs.cache-hit != 'true' shell: bash run: | # Install python3-venv if not available apt-get update apt-get install -y python3-venv - # Create virtual environment if it doesn't exist - if [ ! -d ".venv" ]; then - python3 -m venv .venv - fi + # Create virtual environment + python3 -m venv .venv # Activate and install dependencies source .venv/bin/activate pip install --upgrade pip pip install -r requirements/all_requirements.txt - - - name: Install rosdep dependencies + + - name: Install rosdep dependencies (if cache miss) + if: steps.cache-apt-packages.outputs.cache-hit != 'true' run: | # Update rosdep apt-get update From d78b346b012dc4b20660e833b0b5fbb72b48d40c Mon Sep 17 00:00:00 2001 From: Kane Li <122249106+Li-Kane@users.noreply.github.com> Date: Sat, 15 Nov 2025 14:51:08 -0800 Subject: [PATCH 08/15] Update main.yaml --- .github/workflows/main.yaml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 3f60621..f093c17 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -20,19 +20,23 @@ jobs: - name: Cache Python dependencies uses: actions/cache@v3 + id: cache-venv with: path: .venv key: venv-${{ runner.os }}-${{ hashFiles('requirements/all_requirements.txt') }} restore-keys: | venv-${{ runner.os }}- - - name: Cache apt packages + - name: Cache rosdep packages uses: actions/cache@v3 + id: cache-rosdep with: - path: /var/cache/apt - key: apt-${{ runner.os }}-${{ hashFiles('src/**/package.xml') }} + path: | + /var/cache/apt/archives + /var/lib/apt/lists + key: rosdep-${{ runner.os }}-${{ hashFiles('src/**/package.xml') }} restore-keys: | - apt-${{ runner.os }}- + rosdep-${{ runner.os }}- - name: Install Python Venv (if cache miss) if: steps.cache-python-dependencies.outputs.cache-hit != 'true' From 05536475896569596de40353175aae28665454cd Mon Sep 17 00:00:00 2001 From: Kane Li <122249106+Li-Kane@users.noreply.github.com> Date: Sat, 22 Nov 2025 14:18:38 -0800 Subject: [PATCH 09/15] cache rosdep properly --- .github/workflows/main.yaml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index f093c17..267c5c2 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -39,7 +39,7 @@ jobs: rosdep-${{ runner.os }}- - name: Install Python Venv (if cache miss) - if: steps.cache-python-dependencies.outputs.cache-hit != 'true' + if: steps.cache-venv.outputs.cache-hit != 'true' shell: bash run: | # Install python3-venv if not available @@ -54,9 +54,11 @@ jobs: pip install --upgrade pip pip install -r requirements/all_requirements.txt - - name: Install rosdep dependencies (if cache miss) - if: steps.cache-apt-packages.outputs.cache-hit != 'true' + - name: Install rosdep dependencies run: | + # Ensure apt cache is preserved + rm -f /etc/apt/apt.conf.d/docker-clean + # Update rosdep apt-get update rosdep update From 624329966a9502fd145a827d2c7b8db1b75869d9 Mon Sep 17 00:00:00 2001 From: Kane Li <122249106+Li-Kane@users.noreply.github.com> Date: Sat, 24 Jan 2026 13:35:26 -0800 Subject: [PATCH 10/15] check clangd --- .github/workflows/main.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 267c5c2..4a82561 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -65,6 +65,15 @@ jobs: # Install dependencies from all packages in src/ rosdep install --from-paths src --ignore-src -r -y + + - name: Install clang-format + run: | + apt-get update + apt-get install -y clang-format + + - name: Check formatting + run: | + find src -iname *.h -o -iname *.hpp -o -iname *.cpp -o -iname *.c | xargs clang-format --dry-run --Werror - name: Build with colcon shell: bash From 628ed22d2f7262c589b2f3ffda2489c9f780ecd2 Mon Sep 17 00:00:00 2001 From: Kane Li <122249106+Li-Kane@users.noreply.github.com> Date: Sat, 24 Jan 2026 13:44:03 -0800 Subject: [PATCH 11/15] split jobs --- .github/workflows/main.yaml | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 4a82561..ad1132d 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -6,7 +6,23 @@ on: push: jobs: - build_and_run: + lint: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Install clang-format + run: | + sudo apt-get update + sudo apt-get install -y clang-format + + - name: Check formatting + run: | + find src -iname *.h -o -iname *.hpp -o -iname *.cpp -o -iname *.c | xargs clang-format --dry-run --Werror + + build: + needs: lint runs-on: ubuntu-22.04 container: image: ros:humble-ros-base @@ -65,15 +81,6 @@ jobs: # Install dependencies from all packages in src/ rosdep install --from-paths src --ignore-src -r -y - - - name: Install clang-format - run: | - apt-get update - apt-get install -y clang-format - - - name: Check formatting - run: | - find src -iname *.h -o -iname *.hpp -o -iname *.cpp -o -iname *.c | xargs clang-format --dry-run --Werror - name: Build with colcon shell: bash From 39ea73b777b50472af072e8f6064470201df08ac Mon Sep 17 00:00:00 2001 From: Kane Li <122249106+Li-Kane@users.noreply.github.com> Date: Sat, 24 Jan 2026 13:50:52 -0800 Subject: [PATCH 12/15] reucursive fix --- .github/workflows/main.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index ad1132d..0756c60 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -11,6 +11,9 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v3 + with: + submodules: recursive + token: ${{ secrets.GH_PAT }} - name: Install clang-format run: | From 027d7c4e6e9ee95b24638cfd8f9547cfccb087e1 Mon Sep 17 00:00:00 2001 From: Kane Li <122249106+Li-Kane@users.noreply.github.com> Date: Sat, 24 Jan 2026 14:13:38 -0800 Subject: [PATCH 13/15] python format add python formatting with Ruff --- .github/workflows/main.yaml | 139 +++++++++++++++++++----------------- ruff.toml | 8 +++ 2 files changed, 81 insertions(+), 66 deletions(-) create mode 100644 ruff.toml diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 0756c60..b40a801 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -6,7 +6,7 @@ on: push: jobs: - lint: + format: runs-on: ubuntu-latest steps: - name: Checkout code @@ -24,79 +24,86 @@ jobs: run: | find src -iname *.h -o -iname *.hpp -o -iname *.cpp -o -iname *.c | xargs clang-format --dry-run --Werror - build: - needs: lint - runs-on: ubuntu-22.04 - container: - image: ros:humble-ros-base + - name: Install Ruff + run: pip install ruff + + - name: Check Python formatting + run: ruff format --check . + + # Currently this takes 3+ minutes, but I'm keeping this here if we ever need it + # build: + # needs: format + # runs-on: ubuntu-22.04 + # container: + # image: ros:humble-ros-base - steps: - - name: Checkout code - uses: actions/checkout@v3 - with: - submodules: recursive - token: ${{ secrets.GH_PAT }} + # steps: + # - name: Checkout code + # uses: actions/checkout@v3 + # with: + # submodules: recursive + # token: ${{ secrets.GH_PAT }} - - name: Cache Python dependencies - uses: actions/cache@v3 - id: cache-venv - with: - path: .venv - key: venv-${{ runner.os }}-${{ hashFiles('requirements/all_requirements.txt') }} - restore-keys: | - venv-${{ runner.os }}- + # - name: Cache Python dependencies + # uses: actions/cache@v3 + # id: cache-venv + # with: + # path: .venv + # key: venv-${{ runner.os }}-${{ hashFiles('requirements/all_requirements.txt') }} + # restore-keys: | + # venv-${{ runner.os }}- - - name: Cache rosdep packages - uses: actions/cache@v3 - id: cache-rosdep - with: - path: | - /var/cache/apt/archives - /var/lib/apt/lists - key: rosdep-${{ runner.os }}-${{ hashFiles('src/**/package.xml') }} - restore-keys: | - rosdep-${{ runner.os }}- + # - name: Cache rosdep packages + # uses: actions/cache@v3 + # id: cache-rosdep + # with: + # path: | + # /var/cache/apt/archives + # /var/lib/apt/lists + # key: rosdep-${{ runner.os }}-${{ hashFiles('src/**/package.xml') }} + # restore-keys: | + # rosdep-${{ runner.os }}- - - name: Install Python Venv (if cache miss) - if: steps.cache-venv.outputs.cache-hit != 'true' - shell: bash - run: | - # Install python3-venv if not available - apt-get update - apt-get install -y python3-venv + # - name: Install Python Venv (if cache miss) + # if: steps.cache-venv.outputs.cache-hit != 'true' + # shell: bash + # run: | + # # Install python3-venv if not available + # apt-get update + # apt-get install -y python3-venv - # Create virtual environment - python3 -m venv .venv + # # Create virtual environment + # python3 -m venv .venv - # Activate and install dependencies - source .venv/bin/activate - pip install --upgrade pip - pip install -r requirements/all_requirements.txt + # # Activate and install dependencies + # source .venv/bin/activate + # pip install --upgrade pip + # pip install -r requirements/all_requirements.txt - - name: Install rosdep dependencies - run: | - # Ensure apt cache is preserved - rm -f /etc/apt/apt.conf.d/docker-clean + # - name: Install rosdep dependencies + # run: | + # # Ensure apt cache is preserved + # rm -f /etc/apt/apt.conf.d/docker-clean - # Update rosdep - apt-get update - rosdep update + # # Update rosdep + # apt-get update + # rosdep update - # Install dependencies from all packages in src/ - rosdep install --from-paths src --ignore-src -r -y + # # Install dependencies from all packages in src/ + # rosdep install --from-paths src --ignore-src -r -y - - name: Build with colcon - shell: bash - run: | - # Activate venv and source ROS2 and workspace environment - source .venv/bin/activate - source /opt/ros/humble/setup.bash + # - name: Build with colcon + # shell: bash + # run: | + # # Activate venv and source ROS2 and workspace environment + # source .venv/bin/activate + # source /opt/ros/humble/setup.bash - # Make sure build works (ignore hardware specific packages) - colcon build --packages-ignore \ - camera_node \ - tr-camera-basler \ - lidar_node \ - yolox_ros_cpp \ - yolox_ros \ - yolox_cpp \ No newline at end of file + # # Make sure build works (ignore hardware specific packages) + # colcon build --packages-ignore \ + # camera_node \ + # tr-camera-basler \ + # lidar_node \ + # yolox_ros_cpp \ + # yolox_ros \ + # yolox_cpp \ No newline at end of file diff --git a/ruff.toml b/ruff.toml new file mode 100644 index 0000000..183edfa --- /dev/null +++ b/ruff.toml @@ -0,0 +1,8 @@ +line-length = 88 +indent-width = 4 + +[format] +quote-style = "double" +indent-style = "space" +skip-magic-trailing-comma = false +line-ending = "auto" From b2afb2cd2e6417081c136f8fe9b0707c123b7807 Mon Sep 17 00:00:00 2001 From: Kane Li <122249106+Li-Kane@users.noreply.github.com> Date: Sat, 24 Jan 2026 15:15:29 -0800 Subject: [PATCH 14/15] linting add python linting --- .github/workflows/main.yaml | 5 ++++- .gitignore | 1 + .md/cpp_python_lsp_setup.md | 2 +- requirements/all_requirements.txt | 5 ++++- requirements/requirements.txt | 5 ++++- 5 files changed, 14 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index b40a801..c934718 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -6,7 +6,7 @@ on: push: jobs: - format: + lint_and_format: runs-on: ubuntu-latest steps: - name: Checkout code @@ -30,6 +30,9 @@ jobs: - name: Check Python formatting run: ruff format --check . + - name: Check Python linting + run: ruff check . + # Currently this takes 3+ minutes, but I'm keeping this here if we ever need it # build: # needs: format diff --git a/.gitignore b/.gitignore index c952ef4..75eeaf1 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ rosbag2* # clangd cache .cache/ +.ruff_cache/ \ No newline at end of file diff --git a/.md/cpp_python_lsp_setup.md b/.md/cpp_python_lsp_setup.md index d42bc4a..85cc6e6 100644 --- a/.md/cpp_python_lsp_setup.md +++ b/.md/cpp_python_lsp_setup.md @@ -39,7 +39,7 @@ optionally also add the following to save on format 1. Install the `Python` and `Pylance` extensions by microsoft 2. install `Robot Developer Extensions for Ros2` by `Ranch Hand Robotics LLC` ![extension](ros2_vscode_extension.png) - +3. Install `Ruff` by Astral Software 3. run `ROS2: Update Python Path` (you may need to run this periodically when you add new files or make major changes) 4. you can verify it worked by checking `.vscode/settings.json` and seeing it has added python auto complete and analysis extra paths. 5. you should now have type hints for ros msg definitions and custom msg definitions like tr_messages inside python! diff --git a/requirements/all_requirements.txt b/requirements/all_requirements.txt index 0dd2bf4..b0dae8f 100644 --- a/requirements/all_requirements.txt +++ b/requirements/all_requirements.txt @@ -14,4 +14,7 @@ numpy==1.26.4 # for sim_node mani_skill==3.0.0b21 torch==2.9.1 -pynput==1.8.1 \ No newline at end of file +pynput==1.8.1 + +# for linting & formatting +ruff==0.14.14 \ No newline at end of file diff --git a/requirements/requirements.txt b/requirements/requirements.txt index 469c334..9e95335 100644 --- a/requirements/requirements.txt +++ b/requirements/requirements.txt @@ -6,4 +6,7 @@ catkin-pkg PyYAML setuptools jinja2 -typeguard \ No newline at end of file +typeguard + +# for linting & formatting +ruff==0.14.14 \ No newline at end of file From 2b49843a33c6a3fb0b01179852b3378f84b04fa3 Mon Sep 17 00:00:00 2001 From: Kane Li <122249106+Li-Kane@users.noreply.github.com> Date: Sat, 24 Jan 2026 16:35:37 -0800 Subject: [PATCH 15/15] Update cpp_python_lsp_setup.md --- .md/cpp_python_lsp_setup.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.md/cpp_python_lsp_setup.md b/.md/cpp_python_lsp_setup.md index 85cc6e6..11e71e7 100644 --- a/.md/cpp_python_lsp_setup.md +++ b/.md/cpp_python_lsp_setup.md @@ -34,6 +34,11 @@ optionally also add the following to save on format "editor.formatOnSave": true, ``` +If you want to auto-format using the terminal, run: +``` +find . -name "*.cpp" -o -name "*.h" | xargs clang-format -i -style=file +``` + ## Python 1. Install the `Python` and `Pylance` extensions by microsoft