Skip to content

Commit

Permalink
Add git filter for selected lines in vscode config json (#332)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaagut authored Jan 29, 2024
2 parents 57b5723 + dbc8b9f commit 56011d7
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.vscode/settings.json filter=removeFullHomePath
10 changes: 7 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -191,11 +191,15 @@

// 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": [
"/opt/ros/iron/lib/python3.10/site-packages"
],
"python.analysis.extraPaths": [
"/opt/ros/iron/lib/python3.10/site-packages"
],


// DO NOT COMMIT THESE ABSOLUTE PYTHON PATHS:


}
13 changes: 10 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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))))
Expand All @@ -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
Expand Down Expand Up @@ -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

0 comments on commit 56011d7

Please sign in to comment.