Skip to content

Commit 1f82629

Browse files
authored
cpplint: Use pypi version (#1871)
* cpplint: Use pypi version Also does not need python 2 anymore * cpplint: Ignore new suggestions
1 parent 3f3fa3d commit 1f82629

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+46872
-7502
lines changed

lib/cpplint_1.4.5/.flake8

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
[flake8]
2+
ignore =
3+
# indentation is not a multiple of four,
4+
E111,E114,
5+
# visually indented line with same indent as next logical line,
6+
E129,
7+
# expected 2 blank lines, found 1
8+
E302,E305,
9+
# closing bracket does not match indentation of opening bracket's line
10+
E123,
11+
# multiple spaces before operator
12+
E221,
13+
# line break before binary operator
14+
W503,
15+
# line break after binary operator
16+
W504,
17+
# multiple statements on one line
18+
E701,
19+
# continuation line under-indented for hanging indent
20+
E121,
21+
# closing bracket does not match visual indentation
22+
E124,
23+
# continuation line with same indent as next logical line
24+
E125,
25+
# continuation line over-indented for visual indent
26+
E127,
27+
# continuation line under-indented for visual indent
28+
E128,
29+
# unexpected indentation
30+
E116,
31+
# too many blank lines
32+
E303,
33+
# missing whitespace around arithmetic operator
34+
E226,
35+
# test for membership should be 'not in'
36+
E713,
37+
max-line-length=120

lib/cpplint_1.4.5/.gitignore

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
### Python ###
2+
# Byte-compiled / optimized / DLL files
3+
__pycache__/
4+
*.py[cod]
5+
*$py.class
6+
7+
# C extensions
8+
*.so
9+
10+
# Distribution / packaging
11+
.Python
12+
build/
13+
develop-eggs/
14+
dist/
15+
downloads/
16+
eggs/
17+
.eggs/
18+
lib/
19+
lib64/
20+
parts/
21+
sdist/
22+
var/
23+
wheels/
24+
*.egg-info/
25+
.installed.cfg
26+
*.egg
27+
MANIFEST
28+
29+
# PyInstaller
30+
# Usually these files are written by a python script from a template
31+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
32+
*.manifest
33+
*.spec
34+
35+
# Installer logs
36+
pip-log.txt
37+
pip-delete-this-directory.txt
38+
39+
# Unit test / coverage reports
40+
htmlcov/
41+
.tox/
42+
.nox/
43+
.coverage
44+
.coverage.*
45+
.cache
46+
nosetests.xml
47+
coverage.xml
48+
*.cover
49+
.hypothesis/
50+
.pytest_cache/
51+
52+
# Translations
53+
*.mo
54+
*.pot
55+
56+
# Django stuff:
57+
*.log
58+
local_settings.py
59+
db.sqlite3
60+
61+
# Flask stuff:
62+
instance/
63+
.webassets-cache
64+
65+
# Scrapy stuff:
66+
.scrapy
67+
68+
# Sphinx documentation
69+
docs/_build/
70+
71+
# PyBuilder
72+
target/
73+
74+
# Jupyter Notebook
75+
.ipynb_checkpoints
76+
77+
# IPython
78+
profile_default/
79+
ipython_config.py
80+
81+
# pyenv
82+
.python-version
83+
84+
# celery beat schedule file
85+
celerybeat-schedule
86+
87+
# SageMath parsed files
88+
*.sage.py
89+
90+
# Environments
91+
.env
92+
.venv
93+
env/
94+
venv/
95+
ENV/
96+
env.bak/
97+
venv.bak/
98+
99+
# Spyder project settings
100+
.spyderproject
101+
.spyproject
102+
103+
# Rope project settings
104+
.ropeproject
105+
106+
# mkdocs documentation
107+
/site
108+
109+
# mypy
110+
.mypy_cache/
111+
.dmypy.json
112+
dmypy.json
113+
114+
### Python Patch ###
115+
.venv/
116+
117+
### Python.VirtualEnv Stack ###
118+
# Virtualenv
119+
# http://iamzed.com/2009/05/07/a-primer-on-virtualenv/
120+
[Bb]in
121+
[Ii]nclude
122+
[Ll]ib
123+
[Ll]ib64
124+
[Ll]ocal
125+
[Ss]cripts
126+
pyvenv.cfg
127+
pip-selfcheck.json

lib/cpplint_1.4.5/.pylintrc

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
[BASIC]
2+
include-naming-hint=yes
3+
method-rgx=[A-Z_][A-Za-z0-9]{2,49}$
4+
function-rgx=[A-Z_][A-Za-z0-9]{2,49}$|main|unicode_escape_decode
5+
const-rgx=[a-zA-Z_][A-Za-z0-9_]{2,49}$
6+
variable-rgx=[a-z_][a-z0-9_]{0,49}$
7+
argument-rgx=[a-z_][a-z0-9_]{0,49}$
8+
class-rgx=[A-Z_][a-zA-Z0-9]+$|basestring|unicode|long|xrange
9+
10+
[MESSAGES CONTROL]
11+
disable=
12+
global-statement,
13+
multiple-statements,
14+
missing-docstring,
15+
no-else-return,
16+
no-self-use,
17+
consider-merging-isinstance,
18+
bad-continuation,
19+
fixme,
20+
bad-option-value,
21+
anomalous-unicode-escape-in-string,
22+
unused-argument,
23+
useless-object-inheritance,
24+
consider-using-dict-comprehension,
25+
consider-using-in,
26+
unnecessary-pass
27+
28+
[REPORTS]
29+
output-format=colorized
30+
reports=no
31+
score=no
32+
33+
[FORMAT]
34+
indent-string=' '
35+
indent-after-paren=4
36+
max-module-lines=10000
37+
38+
[DESIGN]
39+
max-locals=25
40+
max-line-length=100
41+
max-attributes=10
42+
max-branches=30
43+
max-args=20
44+
max-statements=75
45+
max-returns=10
46+
min-public-methods=0
47+
max-bool-expr=10

lib/cpplint_1.4.5/.style.yapf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[style]
2+
based_on_style = chromium
3+
dedent_closing_brackets = True
4+
coalesce_brackets = True
5+
continuation_indent_width = 2

lib/cpplint_1.4.5/.travis.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
language: python
2+
3+
python:
4+
- "3.8"
5+
- "3.7"
6+
- "3.6"
7+
- "3.5"
8+
- "2.7"
9+
- "pypy"
10+
- "pypy3"
11+
12+
install:
13+
- pip install --upgrade pip
14+
- pip install --upgrade setuptools
15+
- pip install -e .[dev]
16+
- pip install tox-travis
17+
18+
script:
19+
- tox

lib/cpplint_1.4.5/CONTRIBUTING.rst

Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
Contributing guide
2+
==================
3+
4+
Thanks for your interest in contributing to cpplint.
5+
6+
Any kinds of contributions are welcome: Bug reports, Documentation, Patches.
7+
8+
However cpplint is a bit special as a project because it aims to closely follow what Google does in the upstream repository.
9+
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.
10+
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.
11+
12+
Here are some tips to make best use of your time:
13+
14+
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.
15+
16+
2. Consider the goals and non-goals of this project:
17+
18+
Goals:
19+
20+
* Provides cpplint as a PyPI package for multiple python versions
21+
* Add a few features and fixes aimed at usages outside Google
22+
23+
Non-Goals:
24+
25+
* Become an independent fork adding major features
26+
* Fix python style issues in cpplint
27+
28+
29+
Development
30+
-----------
31+
32+
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::
33+
34+
1. (Optional) Install multiple python versions
35+
36+
1. (Optional) Install [pyenv](https://github.com/pyenv/pyenv-installer) to manage python versions
37+
2. (Optional) Using pyenv, install the python versions used in testing::
38+
39+
pyenv install 2.7.16
40+
pyenv install 3.6.8
41+
42+
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/ ):
43+
44+
1. (Optional) Setup a local virtual environment with all necessary tools and libraries::
45+
46+
mkvirtualenv cpplint [-p /usr/bin/python3]
47+
pip install .[dev]
48+
49+
Alternatively you can locally install patches like this::
50+
51+
pip install --user -e .[dev]
52+
53+
You can setup your local environment for developing patches for cpplint like this:
54+
55+
.. code-block:: bash
56+
57+
# run a single test
58+
pytest cpplint_unittest.py -k testExclude
59+
# run all tests
60+
./setup.py test
61+
./setup.py lint
62+
./setup.py style
63+
./setup.py ci # all the above
64+
./tox # all of the above in all python environments
65+
66+
Releasing
67+
---------
68+
69+
To release a new version:
70+
71+
.. code-block:: bash
72+
73+
# prepare files for release
74+
vi cpplint.py # increment the version
75+
vi changelog.rst # log changes
76+
git commit -m "Releasing x.y.z"
77+
git add cpplint.py changelog.rst
78+
# test-release (on env by mkvirtualenv -p /usr/bin/python3)
79+
pip install --upgrade setuptools wheel twine
80+
python3 setup.py sdist bdist_wheel
81+
twine upload --repository testpypi dist/*
82+
# ... Check website and downloads from https://test.pypi.org/project/cpplint/
83+
# Actual release
84+
twine upload dist/*
85+
git tag x.y.z
86+
git push
87+
git push --tags
88+
89+
90+
Catching up with Upstream
91+
-------------------------
92+
93+
For maintainers, it is a regular duty to look at what cpplint changes were merged upstream, to include them in this fork.
94+
95+
Checkout here and upstream google:
96+
97+
.. code-block:: bash
98+
99+
git clone [email protected]:cpplint/cpplint.git
100+
cd cpplint
101+
git remote add google https://github.com/google/styleguide
102+
103+
To incorporate google's changes:
104+
105+
.. code-block:: bash
106+
107+
git fetch google gh-pages
108+
git checkout -b updates FETCH_HEAD
109+
git rebase master # this will have a lot of conflicts, most of which can be solved with the next command (run repeatedly)
110+
# 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)
111+
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
112+
113+
git push -u origin updates
114+
# check travis
115+
git push origin --delete updates
116+
117+
git rebase updates master
118+
git branch -D updates
119+
git push
120+
121+
Setup fetching of pull requests in .git/config:
122+
123+
.. code-block:: bash
124+
125+
[remote "origin"]
126+
url = [email protected]:cpplint/cpplint.git
127+
fetch = +refs/heads/*:refs/remotes/origin/*
128+
# following line should be new, fetches PRs from cpplint
129+
fetch = +refs/pull/*/head:refs/remotes/origin/pr/*
130+
[remote "google"]
131+
url = https://github.com/google/styleguide
132+
fetch = +refs/heads/*:refs/remotes/google/*
133+
# following line should be new, fetches PRs from google/styleguides
134+
fetch = +refs/pull/*/head:refs/remotes/google/pr/*
135+
136+
137+
To compare this for with upstream (after git fetch):
138+
139+
.. code-block:: bash
140+
141+
git diff google/gh-pages:cpplint/cpplint.py master:cpplint.py
142+
git diff google/gh-pages:cpplint/cpplint_unittest.py master:cpplint_unittest.py

0 commit comments

Comments
 (0)