Skip to content

Commit e340f78

Browse files
committed
clang format 12
1 parent acdcf61 commit e340f78

File tree

6 files changed

+1319
-1446
lines changed

6 files changed

+1319
-1446
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,3 +78,13 @@ Please note that the cpp11 project is released with a [Contributor Code of Condu
7878

7979
cpp11 would not exist without Rcpp.
8080
Thanks to the Rcpp authors, Dirk Eddelbuettel, Romain Francois, JJ Allaire, Kevin Ushey, Qiang Kou, Nathan Russell, Douglas Bates and John Chambers for their work writing and maintaining Rcpp.
81+
82+
## Clang format
83+
84+
To match GHA, use clang-format-12 to format C++ code. With systems that provide clang-format-14 or newer, you can use Docker:
85+
86+
```bash
87+
docker run --rm -v "$PWD":/work -w /work ubuntu:22.04 bash -lc "\
88+
apt-get update && apt-get install -y clang-format-12 && \
89+
find . -name '*.cpp' -o -name '*.hpp' -o -name '*.h' | xargs -r clang-format-12 -i"
90+
```

inst/include/cpp11/list_of.hpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,13 @@ class list_of : public writable::list {
5454

5555
#ifdef LONG_VECTOR_SUPPORT
5656
proxy operator[](int pos) {
57-
return { writable::list::operator[](static_cast<R_xlen_t>(pos)) };
57+
return {writable::list::operator[](static_cast<R_xlen_t>(pos))};
5858
}
5959
#endif
6060

6161
proxy operator[](R_xlen_t pos) { return writable::list::operator[](pos); }
6262

63-
proxy operator[](const char* pos) {
64-
return { writable::list::operator[](pos) };
65-
}
63+
proxy operator[](const char* pos) { return {writable::list::operator[](pos)}; }
6664

6765
proxy operator[](const std::string& pos) {
6866
return writable::list::operator[](pos.c_str());

0 commit comments

Comments
 (0)