File tree Expand file tree Collapse file tree 3 files changed +2
-51
lines changed
Expand file tree Collapse file tree 3 files changed +2
-51
lines changed Original file line number Diff line number Diff line change @@ -15,23 +15,6 @@ Returns `0` if everything looks properly formatted.
1515
1616PATH_TO_FORMAT_SCRIPT=" $( pwd) /mason_packages/.link/bin/clang-format"
1717
18- # to speed up re-runs, only re-create environment if needed
19- if [[ ! -f local.env ]] || [[ ! -f ${PATH_TO_FORMAT_SCRIPT} ]]; then
20- # automatically setup environment
21- ./scripts/setup.sh --config local.env
22- fi
23-
24- # source the environment
25- source local.env
26-
27- # to speed up re-runs, only install clang-format if needed
28- if [[ ! -f ${PATH_TO_FORMAT_SCRIPT} ]]; then
29- # The MASON_LLVM_RELEASE variable comes from `local.env`
30- node_modules/.bin/mason-js install clang-format=${MASON_LLVM_RELEASE} --type=compiled
31- node_modules/.bin/mason-js link clang-format=${MASON_LLVM_RELEASE} --type=compiled
32- # We link the tools to make it easy to know ${PATH_TO_FORMAT_SCRIPT}
33- fi
34-
3518# Run clang-format on all cpp and hpp files in the /src directory
3619find src/ -type f -name ' *.hpp' -o -name ' *.cpp' \
3720 | xargs -I{} ${PATH_TO_FORMAT_SCRIPT} -i -style=file {}
Original file line number Diff line number Diff line change @@ -16,15 +16,8 @@ always returns 0 even on errors.
1616'
1717
1818PATH_TO_CLANG_TIDY_SCRIPT=" $( pwd) /mason_packages/.link/share/run-clang-tidy.py"
19-
20- # to speed up re-runs, only re-create environment if needed
21- if [[ ! -f local.env ]] || [[ ! -f ${PATH_TO_CLANG_TIDY_SCRIPT} ]]; then
22- # automatically setup environment
23- ./scripts/setup.sh --config local.env
24- fi
25-
26- # source the environment
27- source local.env
19+ # make sure that run-clang-tidy.py can find the right clang-tidy
20+ export PATH=$( pwd) /mason_packages/.link/bin:${PATH}
2821
2922# build the compile_commands.json file if it does not exist
3023if [[ ! -f build/compile_commands.json ]]; then
@@ -40,14 +33,6 @@ if [[ ! -f build/compile_commands.json ]]; then
4033 make | scripts/generate_compile_commands.py > build/compile_commands.json
4134fi
4235
43- # to speed up re-runs, only install clang-tidy if needed
44- if [[ ! -f ${PATH_TO_CLANG_TIDY_SCRIPT} ]]; then
45- # The MASON_LLVM_RELEASE variable comes from `local.env`
46- node_modules/.bin/mason-js install clang-tidy=${MASON_LLVM_RELEASE} --type=compiled
47- node_modules/.bin/mason-js link clang-tidy=${MASON_LLVM_RELEASE} --type=compiled
48- # We link the tools to make it easy to know ${PATH_TO_CLANG_TIDY_SCRIPT}
49- fi
50-
5136# change into the build directory so that clang-tidy can find the files
5237# at the right paths (since this is where the actual build happens)
5338cd build
Original file line number Diff line number Diff line change @@ -6,15 +6,6 @@ set -o pipefail
66export MASON_RELEASE=" ${MASON_RELEASE:- eeba3b5} "
77export MASON_LLVM_RELEASE=" ${MASON_LLVM_RELEASE:- 5.0.0} "
88
9- PLATFORM=$( uname | tr A-Z a-z)
10- if [[ ${PLATFORM} == ' darwin' ]]; then
11- PLATFORM=" osx"
12- fi
13-
14- MASON_URL=" https://s3.amazonaws.com/mason-binaries/${PLATFORM} -$( uname -m) "
15-
16- llvm_toolchain_dir=" $( pwd) /.toolchain"
17-
189function run() {
1910 local config=${1}
2011 # unbreak bash shell due to rvm bug on osx: https://github.com/direnv/direnv/issues/210#issuecomment-203383459
@@ -23,14 +14,6 @@ function run() {
2314 echo ' shell_session_update() { :; }' > ~ /.direnvrc
2415 fi
2516
26- # Ensure toolchain is installed via mason-js
27- if [[ ! -f ./node_modules/.bin/mason-js ]]; then
28- npm install mason-js-sdk
29- fi
30-
31- node_modules/.bin/mason-js install clang++=${MASON_LLVM_RELEASE} --type=compiled
32- node_modules/.bin/mason-js link clang++=${MASON_LLVM_RELEASE} --type=compiled
33-
3417 #
3518 # ENV SETTINGS
3619 #
You can’t perform that action at this time.
0 commit comments