Name: linter
Owner: AUV-IITK
Description: Generic (C++, python) linter and auto formatter package
Created: 2018-05-08 05:20:50.0
Updated: 2018-05-08 05:20:52.0
Pushed: 2018-05-03 16:32:48.0
Size: 169
Language: Python
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
This repo contains a (C++, python (experimental)) linter and auto formatter package that can be included into your repository as a submodule. 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.
EXPERIMENTAL - Python files:
WARNING: The default linter settings are very strict and might not actually conform with the formatting produced by autopep8. If you want to use this linter for python you will need to do some tweaking.
pip install autopep8
sudo apt-get install clang-format-3.X
w install clang-format
-s /usr/local/share/clang/clang-format-diff.py /usr/local/bin/clang-format-diff-3.8
YOUR_REPO
submodule add git@github.com:ethz-asl/linter.git
nter/init-git-hooks.py
You can also add the linter submodule in a subfolder of your repo, e.g.:
r $YOUR_REPO/dev_tools
submodule add git@github.com:ethz-asl/linter.git dev_tools/linter
v_tools/linter/init-git-hooks.py
Define the project-specific C++ format by adding a file .clang-format
to your projects root folder. Example:
uage: Cpp
dOnStyle: Google
vePointerAlignment: false
terAlignment: Left
mnLimit: 80
wShortFunctionsOnASingleLine: Empty
wShortIfStatementsOnASingleLine: false
wShortLoopsOnASingleLine: false
nAfterOpenBracket: AlwaysBreak
udeCategories:
Regex: '^<.*'
Priority: 1
Regex: '.*'
Priority: 2