Skip to content

Commit

Permalink
Update readme with linter
Browse files Browse the repository at this point in the history
  • Loading branch information
ToniRV committed Jul 11, 2019
1 parent 3c2d8f0 commit b1a0f4f
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 9 deletions.
16 changes: 16 additions & 0 deletions .linterconfig.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Turn the components of the linter individualy on / off.
clangformat: on
cpplint: on
yapf: on
pylint: on

# If on, the linter blocks commits after detecting an error. Otherwise, the
# user is asked whether to proceed with the commit.
block_commits: off

# If this whitelist block is present, the linter only operates on the files and
# directories listed in this whitelist.
whitelist:
- rel/path/to/file.py
- another_file.py
- some/directory
43 changes: 35 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,11 +216,38 @@ Tips for development
> Note: these changes are not sufficient to make the output repeatable between different machines.
Tips for speed
----------------------
- Use ```-march=native``` compiler flag. It will be a problem if you ever want to distribute binaries of this code.
- GTSAM speed depends on: TBB, OpenMP. In principle, TBB speeds-up things, OpenMP not so sure. Verify that on your own computer.
- Make sure OpenCV does not have the `CV_TRACE` cmake flag set-up. This is for profiling. Also use `TBB` as well. Compile with `Lapack`, it seems that operations such as SVD are faster.
- OpenCV could potentially be used with GPU: stereo visual odometry achieves a 7x speed-up.
- Make sure all libraries are compiled with the maximum optimization. Set `CMAKE_BUILD_TYPE` to `Release` and ensure you get a level of optimization at `-O3` for best results.
> Note to self: remember that we are using ```-march=native``` compiler flag, which will be a problem if we ever want to distribute binaries of this code.
>
# Use Linter!
This repo contains a (C++, python) linter and auto formatter package that can be conveniently installed into your repositories using git hooks. It provides the following git hooks:
* **General**
* Prevent commits to master.
* **C++** files:
*
* **clang-format** Formats your code based on your `.clang-format` preferences.
* **cpplint** Checks your C++ code for style errors and warnings.
* **Python** files:
* **yapf** Formats your python code.
* **pylint** Checks your Python code for style errors and warnings.
## Dependencies
* **pylint**
* macOS:
```
pip install pylint
```
* **yapf**
* Ubuntu / macOS: `pip install yapf`
* **clang-format**
* Compatible with `clang-format-3.8 - 6.0`
* Ubuntu: `sudo apt install clang-format-${VERSION}`
* macOS:
```
brew install clang-format
ln -s /usr/local/share/clang/clang-format-diff.py /usr/local/bin/clang-format-diff
2 changes: 1 addition & 1 deletion dev_tools/linter
Submodule linter updated 1 files
+4 −3 linter.py

0 comments on commit b1a0f4f

Please sign in to comment.