Skip to content

Commit

Permalink
Tools improvements (#11)
Browse files Browse the repository at this point in the history
Improve code tools
  • Loading branch information
andreiavrammsd authored Sep 3, 2024
1 parent 6678359 commit b6be18e
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 5 deletions.
5 changes: 4 additions & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@ RUN SNIPPET="export PROMPT_COMMAND='history -a' && export HISTFILE=/commandhisto
&& chown -R $USERNAME /commandhistory \
&& echo "$SNIPPET" >> "/home/$USERNAME/.bashrc"

# Set the user to vscode
# Git completion
RUN echo ". /usr/share/bash-completion/completions/git" >> "/home/$USERNAME/.bashrc"

# Set the user to vscode
USER $USERNAME

# Set the workspace directory
Expand Down
3 changes: 2 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,6 @@
"--security-opt",
"seccomp=unconfined"
],
"remoteUser": "vscode"
"remoteUser": "vscode",
"postStartCommand": "./tools/generate-compilation-database.sh $PWD build-code-quality Debug tests"
}
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
],
"clang-tidy-on-active-file.autoRunOnSave": true,
"clang-tidy-on-active-file.configPath": "/workspace/.clang-tidy",
"clang-tidy-on-active-file.optionalArgs": "-p=build-code-quality",
"C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools",
"C_Cpp.codeAnalysis.clangTidy.enabled": true,
"C_Cpp.codeAnalysis.clangTidy.useBuildPath": true,
Expand Down Expand Up @@ -117,5 +118,5 @@
"typeinfo": "cpp",
"semaphore": "cpp",
"iostream": "cpp"
},
}
}
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# ZIP

[![build](https://github.com/andreiavrammsd/cpp-zip/workflows/build/badge.svg)](https://github.com/andreiavrammsd/cpp-zip/actions)
[![build](https://github.com/andreiavrammsd/cpp-zip/workflows/build/badge.svg)](https://github.com/andreiavrammsd/cpp-zip/actions/workflows/test.yml)
  [![build](https://github.com/andreiavrammsd/cpp-zip/workflows/release/badge.svg)](https://github.com/andreiavrammsd/cpp-zip/actions/workflows/release.yml)
  [![codecov](https://codecov.io/github/andreiavrammsd/cpp-zip/graph/badge.svg?token=TBV8ID8QK0)](https://codecov.io/github/andreiavrammsd/cpp-zip)
  [![documentation](https://img.shields.io/badge/msd::zip-Documentation-4EC820?labelColor=5E5E5E)](https://andreiavrammsd.github.io/cpp-zip/)

Expand Down
6 changes: 6 additions & 0 deletions tools/code-quality.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ fi

./tools/generate-compilation-database.sh ${workspace} ${build_path} ${build_type} ${build_target}

# Build
cwd=$PWD
cd ${build_path}
cmake --build . --config ${build_type} --target ${build_target}
cd ${cwd}

# Find files
files=$(if [ $event == "pull_request" ]; then
git diff --name-only origin/"${default_branch}"...HEAD include
Expand Down
1 change: 0 additions & 1 deletion tools/generate-compilation-database.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,5 @@ cmake ${workspace} \
-DCMAKE_BUILD_TYPE=${build_type} \
-DENABLE_TESTS=ON \
-DENABLE_BENCHMARKS=ON
cmake --build . --config ${build_type} --target ${build_target}

cd ${cwd}

0 comments on commit b6be18e

Please sign in to comment.