Skip to content
This repository has been archived by the owner on Sep 1, 2022. It is now read-only.

Commit

Permalink
Kovri: add cpplint filter + update style guide
Browse files Browse the repository at this point in the history
- Adds cpplint filter file
- Updates formatting command order
- Updates links/instructions
- Adds Vim/Emacs integration info
  • Loading branch information
anonimal committed Feb 11, 2017
1 parent 15cc720 commit 944e4dc
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
1 change: 1 addition & 0 deletions CPPLINT.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
filter=-whitespace/braces,-whitespace/newline,-whitespace/line_length
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
- [FAQ's](https://github.com/monero-project/kovri/blob/master/doc/FAQ.md) and other documentation available in the [doc directory](https://github.com/monero-project/kovri/tree/master/doc)

## Developers
- [Contributing Guide](https://github.com/monero-project/kovri/blob/master/doc/CONTRIBUTING.md) before sending a pull-request
- [Contributing Guide](https://github.com/monero-project/kovri/blob/master/doc/CONTRIBUTING.md) and [Style Guide](https://github.com/monero-project/kovri/blob/master/doc/STYLE.md) before sending a pull-request
- [Forum Funding System](https://forum.getmonero.org/8/funding-required) to get funded for your work, [submit a proposal](https://forum.getmonero.org/7/open-tasks/2379/forum-funding-system-ffs-sticky)
- [build.getmonero.org](https://build.getmonero.org/) or monero-build.i2p for detailed build information
- [repo.getmonero.org](https://repo.getmonero.org/monero-project/kovri) or monero-repo.i2p are alternatives to GitHub for non-push repository access
Expand Down
19 changes: 14 additions & 5 deletions doc/STYLE.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
# Style
1. Read [Google's C++ Style Guide](https://google.github.io/styleguide/cppguide.html)
2. Run [cpplint](https://pypi.python.org/pypi/cpplint/)
1. Read [Google's C++ Style Guide](https://google.github.io/styleguide/cppguide.html) (particularly for non-formatting style reference)
2. Run [clang-format](http://clang.llvm.org/docs/ClangFormat.html) with ```-style=file``` (which uses our provided [.clang-format](https://github.com/monero-project/kovri/blob/master/.clang-format))
```bash
$ cpplint src/path/to/my/file
$ cd kovri/ && clang-format -i -style=file src/path/to/my/file
```
3. Run [clang-format](http://llvm.org/releases/3.8.0/tools/clang/docs/ClangFormat.html) with ```-style=file``` using provided [.clang-format](https://github.com/monero-project/kovri/blob/master/.clang-format)
3. Run [cpplint](https://pypi.python.org/pypi/cpplint/) (which uses our provided [CPPLINT.cfg](https://github.com/monero-project/kovri/blob/master/CPPLINT.cfg)) to catch any issues that were missed by clang-format
```bash
$ cd kovri/ && clang-format -i -style=file src/path/to/my/file
$ cd kovri/ && cpplint src/path/to/my/file && [edit file manually to apply fixes]
```

### Plugins

- Vim integration
- [clang-format](http://clang.llvm.org/docs/ClangFormat.html#vim-integration)
- [cpplint.vim](https://github.com/vim-syntastic/syntastic/blob/master/syntax_checkers/cpp/cpplint.vim)
- Emacs integration
- [clang-format](http://clang.llvm.org/docs/ClangFormat.html#emacs-integration) + [clang-format.el](https://llvm.org/svn/llvm-project/cfe/trunk/tools/clang-format/clang-format.el)
- [flycheck-google-cpplint.el](https://github.com/flycheck/flycheck-google-cpplint)

## Here's what's currently not caught by clang-format and differs from Google's proposed C++ style

- Expressions can be broken before operators if:
Expand Down

0 comments on commit 944e4dc

Please sign in to comment.