Skip to content
Merged
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
37 changes: 37 additions & 0 deletions lib/cpplint_1.4.5/.flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
[flake8]
ignore =
# indentation is not a multiple of four,
E111,E114,
# visually indented line with same indent as next logical line,
E129,
# expected 2 blank lines, found 1
E302,E305,
# closing bracket does not match indentation of opening bracket's line
E123,
# multiple spaces before operator
E221,
# line break before binary operator
W503,
# line break after binary operator
W504,
# multiple statements on one line
E701,
# continuation line under-indented for hanging indent
E121,
# closing bracket does not match visual indentation
E124,
# continuation line with same indent as next logical line
E125,
# continuation line over-indented for visual indent
E127,
# continuation line under-indented for visual indent
E128,
# unexpected indentation
E116,
# too many blank lines
E303,
# missing whitespace around arithmetic operator
E226,
# test for membership should be 'not in'
E713,
max-line-length=120
127 changes: 127 additions & 0 deletions lib/cpplint_1.4.5/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
### Python ###
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

### Python Patch ###
.venv/

### Python.VirtualEnv Stack ###
# Virtualenv
# http://iamzed.com/2009/05/07/a-primer-on-virtualenv/
[Bb]in
[Ii]nclude
[Ll]ib
[Ll]ib64
[Ll]ocal
[Ss]cripts
pyvenv.cfg
pip-selfcheck.json
47 changes: 47 additions & 0 deletions lib/cpplint_1.4.5/.pylintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
[BASIC]
include-naming-hint=yes
method-rgx=[A-Z_][A-Za-z0-9]{2,49}$
function-rgx=[A-Z_][A-Za-z0-9]{2,49}$|main|unicode_escape_decode
const-rgx=[a-zA-Z_][A-Za-z0-9_]{2,49}$
variable-rgx=[a-z_][a-z0-9_]{0,49}$
argument-rgx=[a-z_][a-z0-9_]{0,49}$
class-rgx=[A-Z_][a-zA-Z0-9]+$|basestring|unicode|long|xrange

[MESSAGES CONTROL]
disable=
global-statement,
multiple-statements,
missing-docstring,
no-else-return,
no-self-use,
consider-merging-isinstance,
bad-continuation,
fixme,
bad-option-value,
anomalous-unicode-escape-in-string,
unused-argument,
useless-object-inheritance,
consider-using-dict-comprehension,
consider-using-in,
unnecessary-pass

[REPORTS]
output-format=colorized
reports=no
score=no

[FORMAT]
indent-string=' '
indent-after-paren=4
max-module-lines=10000

[DESIGN]
max-locals=25
max-line-length=100
max-attributes=10
max-branches=30
max-args=20
max-statements=75
max-returns=10
min-public-methods=0
max-bool-expr=10
5 changes: 5 additions & 0 deletions lib/cpplint_1.4.5/.style.yapf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[style]
based_on_style = chromium
dedent_closing_brackets = True
coalesce_brackets = True
continuation_indent_width = 2
19 changes: 19 additions & 0 deletions lib/cpplint_1.4.5/.travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
language: python

python:
- "3.8"
- "3.7"
- "3.6"
- "3.5"
- "2.7"
- "pypy"
- "pypy3"

install:
- pip install --upgrade pip
- pip install --upgrade setuptools
- pip install -e .[dev]
- pip install tox-travis

script:
- tox
142 changes: 142 additions & 0 deletions lib/cpplint_1.4.5/CONTRIBUTING.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
Contributing guide
==================

Thanks for your interest in contributing to cpplint.

Any kinds of contributions are welcome: Bug reports, Documentation, Patches.

However cpplint is a bit special as a project because it aims to closely follow what Google does in the upstream repository.
That means Google remains the source of all major requirements and functinoality of cpplint, where as this fork adds extensions to cpplint run on more environments and in more companies.
The difference between this cpplint and Google should remain so small that anyone can at a glance see there is no added change that could be regarded as a security vulnerability.

Here are some tips to make best use of your time:

1. Feature suggestions should initially be opened at the `upstream repository <https://github.com/google/styleguide>`_, but feel free to open an issue here to and link to the upstream issue.

2. Consider the goals and non-goals of this project:

Goals:

* Provides cpplint as a PyPI package for multiple python versions
* Add a few features and fixes aimed at usages outside Google

Non-Goals:

* Become an independent fork adding major features
* Fix python style issues in cpplint


Development
-----------

For many tasks, it is okay to just develop using a single installed python version. But if you need to test/debug the project in multiple python versions, you need to install those version::

1. (Optional) Install multiple python versions

1. (Optional) Install [pyenv](https://github.com/pyenv/pyenv-installer) to manage python versions
2. (Optional) Using pyenv, install the python versions used in testing::

pyenv install 2.7.16
pyenv install 3.6.8

It may be okay to run and test python against locally installed libraries, but if you need to have a consistent build, it is recommended to manage your environment using virtualenv: [virtualenv](https://virtualenv.pypa.io/en/latest/ ), [virtualenvwrapper](https://pypi.org/project/virtualenvwrapper/ ):

1. (Optional) Setup a local virtual environment with all necessary tools and libraries::

mkvirtualenv cpplint [-p /usr/bin/python3]
pip install .[dev]

Alternatively you can locally install patches like this::

pip install --user -e .[dev]

You can setup your local environment for developing patches for cpplint like this:

.. code-block:: bash

# run a single test
pytest cpplint_unittest.py -k testExclude
# run all tests
./setup.py test
./setup.py lint
./setup.py style
./setup.py ci # all the above
./tox # all of the above in all python environments

Releasing
---------

To release a new version:

.. code-block:: bash

# prepare files for release
vi cpplint.py # increment the version
vi changelog.rst # log changes
git commit -m "Releasing x.y.z"
git add cpplint.py changelog.rst
# test-release (on env by mkvirtualenv -p /usr/bin/python3)
pip install --upgrade setuptools wheel twine
python3 setup.py sdist bdist_wheel
twine upload --repository testpypi dist/*
# ... Check website and downloads from https://test.pypi.org/project/cpplint/
# Actual release
twine upload dist/*
git tag x.y.z
git push
git push --tags


Catching up with Upstream
-------------------------

For maintainers, it is a regular duty to look at what cpplint changes were merged upstream, to include them in this fork.

Checkout here and upstream google:

.. code-block:: bash

git clone git@github.com:cpplint/cpplint.git
cd cpplint
git remote add google https://github.com/google/styleguide

To incorporate google's changes:

.. code-block:: bash

git fetch google gh-pages
git checkout -b updates FETCH_HEAD
git rebase master # this will have a lot of conflicts, most of which can be solved with the next command (run repeatedly)
# solve conflicts with files deleted in our fork (this is idempotent and safe to be called. when cpplint.py has conflicts, it will do nothing)
git status | grep 'new file:' | awk '{print $3}' | xargs -r git rm --cached ; git status | grep 'deleted by us' | awk '{print $4}' | xargs -r git rm ; git status --untracked-files=no | grep 'nothing to commit' && git rebase --skip

git push -u origin updates
# check travis
git push origin --delete updates

git rebase updates master
git branch -D updates
git push

Setup fetching of pull requests in .git/config:

.. code-block:: bash

[remote "origin"]
url = git@github.com:cpplint/cpplint.git
fetch = +refs/heads/*:refs/remotes/origin/*
# following line should be new, fetches PRs from cpplint
fetch = +refs/pull/*/head:refs/remotes/origin/pr/*
[remote "google"]
url = https://github.com/google/styleguide
fetch = +refs/heads/*:refs/remotes/google/*
# following line should be new, fetches PRs from google/styleguides
fetch = +refs/pull/*/head:refs/remotes/google/pr/*


To compare this for with upstream (after git fetch):

.. code-block:: bash

git diff google/gh-pages:cpplint/cpplint.py master:cpplint.py
git diff google/gh-pages:cpplint/cpplint_unittest.py master:cpplint_unittest.py
Loading