Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions r/README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,24 @@ remotes::install_github("romainfrancois/decor")
install.packages(c("dplyr", "purrr", "glue"))
```

We use Google C++ style in our C++ code. Check for style errors with

```
./lint.sh
```

Fix any style issues before committing with

```
./lint.sh --fix
```

The lint script requires Python 3 and `clang-format-7`. If the command isn't
found, you can explicitly provide the path to it like
`CLANG_FORMAT=$(which clang-format-7) ./lint.sh`. On macOS,
you can get this by installing LLVM via Homebrew and running the script as
`CLANG_FORMAT=$(brew --prefix llvm@7)/bin/clang-format ./lint.sh`

### Useful functions

Within an R session, these can help with package development:
Expand Down
14 changes: 14 additions & 0 deletions r/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,20 @@ remotes::install_github("romainfrancois/decor")
install.packages(c("dplyr", "purrr", "glue"))
```

We use Google C++ style in our C++ code. Check for style errors with

./lint.sh

Fix any style issues before committing with

./lint.sh --fix

The lint script requires Python 3 and `clang-format-7`. If the command
isn’t found, you can explicitly provide the path to it like
`CLANG_FORMAT=$(which clang-format-7) ./lint.sh`. On macOS, you can get
this by installing LLVM via Homebrew and running the script as
`CLANG_FORMAT=$(brew --prefix llvm@7)/bin/clang-format ./lint.sh`

### Useful functions

Within an R session, these can help with package development:
Expand Down
5 changes: 4 additions & 1 deletion r/lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,14 @@
# specific language governing permissions and limitations
# under the License.

# This script requires Python 3 and clang-format, which should already be
# on your system. See r/README.md for further guidance

SOURCE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
CPP_BUILD_SUPPORT=$SOURCE_DIR/../cpp/build-support

# Run clang-format
CLANG_FORMAT=clang-format-7
: ${CLANG_FORMAT:=clang-format-7}
$CPP_BUILD_SUPPORT/run_clang_format.py \
--clang_format_binary=$CLANG_FORMAT \
--exclude_glob=$CPP_BUILD_SUPPORT/lint_exclusions.txt \
Expand Down