From 586a4baf3bd1b8dc8aabe4fd00b906ce33aec265 Mon Sep 17 00:00:00 2001 From: Florian Vahl Date: Fri, 26 Jan 2024 22:00:54 +0100 Subject: [PATCH 1/5] Add cleaned settings --- .vscode/settings.json | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 63d7eb784..d4cc246cb 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -194,8 +194,15 @@ "ros.rosSetupScript": "${env:COLCON_WS}/install/setup.bash", "ros.distro": "iron", "search.useIgnoreFiles": false, + "python.autoComplete.extraPaths": [ + // DO NOT COMMIT THESE ABSOLUTE PYTHON PATHS: + "/opt/ros/iron/lib/python3.10/site-packages" + ], + "python.analysis.extraPaths": [ + // DO NOT COMMIT THESE ABSOLUTE PYTHON PATHS: + "/opt/ros/iron/lib/python3.10/site-packages" + ], + - // DO NOT COMMIT THESE ABSOLUTE PYTHON PATHS: - } From 90cfe6bf1c015e98c57d96a2d0cddbf8d888f383 Mon Sep 17 00:00:00 2001 From: Florian Vahl Date: Fri, 26 Jan 2024 22:01:19 +0100 Subject: [PATCH 2/5] Add hook to clean settings at "git add" --- .gitattributes | 1 + 1 file changed, 1 insertion(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..f74aebe48 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +.vscode/settings.json filter=removeFullHomePath From 7b1b19906d460a982459e9c53b81784c47d642e6 Mon Sep 17 00:00:00 2001 From: Florian Vahl Date: Fri, 26 Jan 2024 22:04:39 +0100 Subject: [PATCH 3/5] Remove message --- .vscode/settings.json | 2 -- 1 file changed, 2 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index d4cc246cb..f393e8858 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -195,11 +195,9 @@ "ros.distro": "iron", "search.useIgnoreFiles": false, "python.autoComplete.extraPaths": [ - // DO NOT COMMIT THESE ABSOLUTE PYTHON PATHS: "/opt/ros/iron/lib/python3.10/site-packages" ], "python.analysis.extraPaths": [ - // DO NOT COMMIT THESE ABSOLUTE PYTHON PATHS: "/opt/ros/iron/lib/python3.10/site-packages" ], From 18276b9f1c6885a4d31eb9b476fd27c0a02ca49f Mon Sep 17 00:00:00 2001 From: Florian Vahl Date: Fri, 26 Jan 2024 22:06:08 +0100 Subject: [PATCH 4/5] Remove setup script call as it is not necessary anymore (I think that) --- .vscode/settings.json | 1 - 1 file changed, 1 deletion(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index f393e8858..e54bbe668 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -191,7 +191,6 @@ // Tell the ROS extension where to find the setup.bash // This also utilizes the COLCON_WS environment variable, which needs to be set - "ros.rosSetupScript": "${env:COLCON_WS}/install/setup.bash", "ros.distro": "iron", "search.useIgnoreFiles": false, "python.autoComplete.extraPaths": [ From dbc8b9fc263a7170385d5fcf453e7b5ea564f02b Mon Sep 17 00:00:00 2001 From: Florian Vahl Date: Sat, 27 Jan 2024 11:29:35 +0100 Subject: [PATCH 5/5] Add git filter for vscode config --- Makefile | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 28a98e8bf..2f825c909 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY : basler install install-no-root pip pre-commit format pull-all pull-init pull-repos pull-files fresh-libs remove-libs setup-libs rosdep status update update-no-root +.PHONY : basler install install-no-root pip pre-commit install-git-filters format pull-all pull-init pull-repos pull-files fresh-libs remove-libs setup-libs rosdep status update update-no-root HTTPS := "" REPO:=$(dir $(abspath $(firstword $(MAKEFILE_LIST)))) @@ -19,6 +19,13 @@ pre-commit: # Install pre-commit hooks for all submodules that have a .pre-commit-config.yaml file pre-commit install +install-git-filters: + # Install git filters + # The vscode settings file gets updated by the ros extension and contains the full path to the current user's home directory. + # We don't want to commit this path, so we use a git filter to remove it when git adds the file to the staging area. + # This does not affect the file on disk, so vscode will still work as expected. + git config filter.removeFullHomePath.clean "sed '/\/home.*\(install\|build\)/d'" + format: # Format all files in the repository pre-commit run --all-files @@ -78,6 +85,6 @@ status: # Show status of all repositories vcs status . --nested -update: pull-all rosdep pip pre-commit +update: pull-all rosdep pip install-git-filters pre-commit -update-no-root: pull-all pip pre-commit +update-no-root: pull-all pip install-git-filters pre-commit