]>
Commit | Line | Data |
---|---|---|
1d09f67e TL |
1 | #!/usr/bin/env bash |
2 | ||
3 | # Licensed to the Apache Software Foundation (ASF) under one | |
4 | # or more contributor license agreements. See the NOTICE file | |
5 | # distributed with this work for additional information | |
6 | # regarding copyright ownership. The ASF licenses this file | |
7 | # to you under the Apache License, Version 2.0 (the | |
8 | # "License"); you may not use this file except in compliance | |
9 | # with the License. You may obtain a copy of the License at | |
10 | # | |
11 | # http://www.apache.org/licenses/LICENSE-2.0 | |
12 | # | |
13 | # Unless required by applicable law or agreed to in writing, | |
14 | # software distributed under the License is distributed on an | |
15 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | |
16 | # KIND, either express or implied. See the License for the | |
17 | # specific language governing permissions and limitations | |
18 | # under the License. | |
19 | ||
20 | # This script requires Python 3 and clang-format, which should already be | |
21 | # on your system. See r/README.md for further guidance | |
22 | ||
23 | set -e | |
24 | ||
25 | SOURCE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | |
26 | CPP_BUILD_SUPPORT=$SOURCE_DIR/../cpp/build-support | |
27 | ||
28 | # Run clang-format | |
29 | : ${CLANG_FORMAT:=$(. "${SOURCE_DIR}/../.env" && echo clang-format-${CLANG_TOOLS})} | |
30 | $CPP_BUILD_SUPPORT/run_clang_format.py \ | |
31 | --clang_format_binary=$CLANG_FORMAT \ | |
32 | --exclude_glob=$CPP_BUILD_SUPPORT/lint_exclusions.txt \ | |
33 | --source_dir=$SOURCE_DIR/src --quiet $1 | |
34 | ||
35 | ||
36 | # Run cpplint | |
37 | CPPLINT=$CPP_BUILD_SUPPORT/cpplint.py | |
38 | $CPP_BUILD_SUPPORT/run_cpplint.py \ | |
39 | --cpplint_binary=$CPPLINT \ | |
40 | --exclude_glob=$CPP_BUILD_SUPPORT/lint_exclusions.txt \ | |
41 | --source_dir=$SOURCE_DIR/src --quiet | |
42 | ||
43 | # Run lintr | |
44 | R -e "if(!requireNamespace('lintr', quietly=TRUE)){stop('lintr is not installed, please install it with R -e \"install.packages(\'lintr\')\"')}" | |
45 | NOT_CRAN=true R -e "lintr::lint_package('${SOURCE_DIR}', path_prefix = 'r')" |