Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add git filter for selected lines in vscode config json #332

Merged
merged 5 commits into from
Jan 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading