Skip to content

Commit

Permalink
Update pre-commit configuration (backport #28) (#30)
Browse files Browse the repository at this point in the history
* Update pre-commit configuration (#28)

* Replaced clang-format executable with hook

* added recent formatting changes

(cherry picked from commit d48bcbd)

# Conflicts:
#	.devcontainer/nouveau/Dockerfile
#	.devcontainer/nvidia/Dockerfile
#	.docker/Dockerfile
#	.github/workflows/ci.yml
#	.github/workflows/docker.yml
#	.pre-commit-config.yaml
#	.vscode/c_cpp_properties.json
#	.vscode/settings.json

* Resolve backport conflicts

---------

Co-authored-by: Evan Palmer <evanp922@gmail.com>
  • Loading branch information
mergify[bot] and evan-palmer committed Aug 15, 2024
1 parent f029df4 commit e56e7c3
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/nouveau/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"esbenp.prettier-vscode",
"xaver.clang-format",
"charliermarsh.ruff",
"jeff-hykin.better-cpp-syntax"
"ms-vscode.cmake-tools"
]
}
}
Expand Down
3 changes: 1 addition & 2 deletions .devcontainer/nvidia/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@
"esbenp.prettier-vscode",
"xaver.clang-format",
"charliermarsh.ruff",
"ms-python.black-formatter",
"jeff-hykin.better-cpp-syntax"
"ms-vscode.cmake-tools"
]
}
}
Expand Down
6 changes: 3 additions & 3 deletions .docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,6 @@ RUN sudo apt-get update \
&& sudo rm -rf /var/lib/apt/lists/*

# Env vars for the nvidia-container-runtime.
ENV NVIDIA_VISIBLE_DEVICES all
ENV NVIDIA_DRIVER_CAPABILITIES graphics,utility,compute
ENV QT_X11_NO_MITSHM 1
ENV NVIDIA_VISIBLE_DEVICES=all
ENV NVIDIA_DRIVER_CAPABILITIES=graphics,utility,compute
ENV QT_X11_NO_MITSHM=1
17 changes: 9 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,16 @@ repos:
hooks:
- id: codespell

- repo: local
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v18.1.8
hooks:
- id: clang-format
name: clang-format
description: Format files with ClangFormat.
entry: clang-format-14
language: system
files: \.(c|cc|cxx|cpp|frag|glsl|h|hpp|hxx|ih|ispc|ipp|java|js|m|proto|vert)$
args: ['-fallback-style=Google', '-i']
- id: clang-format
types_or: [c++, c]

- repo: https://github.com/BlankSpruce/gersemi
rev: 0.13.5
hooks:
- id: gersemi

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
Expand Down
5 changes: 4 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
"C_Cpp.codeAnalysis.clangTidy.enabled": true,
"C_Cpp.codeAnalysis.clangTidy.codeAction.formatFixes": true,
"clang-format.executable": "/usr/bin/clang-format-14",
"xml.format.maxLineWidth": 120,
"xml.format.splitAttributes": "alignWithFirstAttr",
"[cpp]": {
"editor.rulers": [120],
"editor.tabSize": 2,
Expand Down Expand Up @@ -73,5 +75,6 @@
"**/build": true,
"**/install": true,
"**/log": true
}
},
"cmake.ignoreCMakeListsMissing": true
}
6 changes: 2 additions & 4 deletions example_pkg/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
cmake_minimum_required(VERSION 3.8)
project(example_pkg)

set(THIS_PACKAGE_INCLUDE_DEPENDS
ament_cmake
)
set(THIS_PACKAGE_INCLUDE_DEPENDS ament_cmake)

foreach(Dependency IN ITEMS ${THIS_PACKAGE_INCLUDE_DEPENDS})
find_package(${Dependency} REQUIRED)
find_package(${Dependency} REQUIRED)
endforeach()

ament_package()

0 comments on commit e56e7c3

Please sign in to comment.