File tree 3 files changed +27
-3
lines changed
3 files changed +27
-3
lines changed Original file line number Diff line number Diff line change
1
+ repos :
2
+ - repo : https://github.com/pre-commit/pre-commit-hooks
3
+ rev : v5.0.0
4
+ hooks :
5
+ - id : trailing-whitespace
6
+ - id : end-of-file-fixer
7
+ - repo : https://github.com/pre-commit/mirrors-clang-format
8
+ rev : v19.1.7
9
+ hooks :
10
+ - id : clang-format
11
+ - repo : https://github.com/google/yapf
12
+ rev : v0.43.0
13
+ hooks :
14
+ - id : yapf-diff
Original file line number Diff line number Diff line change @@ -61,6 +61,11 @@ for Python. The CUDA-Q internals on the other hand follow the [MLIR/LLVM style
61
61
guide] [ llvm_style ] . Please ensure that your code includes comprehensive doc
62
62
comments as well as a comment at the top of the file to indicating its purpose.
63
63
64
+ ` pre-commit ` is being test-flown in this repository. If you have the tool
65
+ installed or are using the provided Dev container, run ` pre-commit install ` to
66
+ enable the hooks. ` clang-format ` and ` yapf ` will be automatically run on all
67
+ staged changes.
68
+
64
69
[ python_style ] : https://google.github.io/styleguide/pyguide.html
65
70
[ cpp_style ] : https://www.gnu.org/prep/standards/standards.html
66
71
[ llvm_style ] : https://llvm.org/docs/CodingStandards.html
Original file line number Diff line number Diff line change 10
10
# Build from the repo root with
11
11
# docker build -t nvidia/cuda-quantum-dev:latest -f docker/build/cudaq.dev.Dockerfile .
12
12
#
13
- # If a custom base image is used, then that image (i.e. the build environment) must
13
+ # If a custom base image is used, then that image (i.e. the build environment) must
14
14
# 1) have all the necessary build dependendencies installed
15
- # 2) define the LLVM_INSTALL_PREFIX environment variable indicating where the
15
+ # 2) define the LLVM_INSTALL_PREFIX environment variable indicating where the
16
16
# the LLVM binaries that CUDA-Q depends on are installed
17
17
# 3) set the CC and CXX environment variable to use the same compiler toolchain
18
18
# as the LLVM dependencies have been built with.
@@ -41,8 +41,13 @@ RUN if [ -n "$mpi" ]; \
41
41
fi \
42
42
fi
43
43
44
+ # Install pre-commit
45
+ RUN apt-get update && apt-get install -y --no-install-recommends git \
46
+ && python3 -m pip install --no-cache-dir pre-commit==4.1.0 \
47
+ && apt-get autoremove -y --purge && apt-get clean && rm -rf /var/lib/apt/lists/*
48
+
44
49
# Configuring a base image that contains the necessary dependencies for GPU
45
- # accelerated components and passing a build argument
50
+ # accelerated components and passing a build argument
46
51
# install="CMAKE_BUILD_TYPE=Release CUDA_QUANTUM_VERSION=latest"
47
52
# creates a dev image that can be used as argument to docker/release/cudaq.Dockerfile
48
53
# to create the released cuda-quantum image.
You can’t perform that action at this time.
0 commit comments