Skip to content
This repository was archived by the owner on Jul 13, 2019. It is now read-only.

Commit c9eb748

Browse files
committed
add setup.py for publishing, travis-ci integration, gitignore, README.md
1 parent e612a2e commit c9eb748

File tree

5 files changed

+163
-0
lines changed

5 files changed

+163
-0
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.svn
2+
*.pyc
3+
cpplint.egg-info
4+
build

.travis.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
language: python
2+
python:
3+
- "3.4"
4+
- "3.3"
5+
- "3.2"
6+
- "2.7"
7+
- "2.6"
8+
# command to install dependencies, e.g. pip install -r requirements.txt --use-mirrors
9+
# install: "sudo apt-get install"
10+
# command to run tests, e.g. python setup.py test
11+
script: python cpplint_unittest.py

README.md

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# cpplint - static code checker for C++
2+
3+
[![Build Status](https://travis-ci.org/tkruse/cpplint.svg)](https://travis-ci.org/tkruse/cpplint)
4+
5+
This project provides cpplint as a pypi package
6+
(https://pypi.python.org/pypi/cpplint). It follows the code maintained as SVN
7+
repository by google employees at
8+
http://google-styleguide.googlecode.com/svn/trunk/cpplint.
9+
10+
11+
It is possible that this repo lags behind the SVN repo, if you notice this,
12+
feel free to open an issue asking for an update.
13+
The ```svn``` branch should be a 1-to-1 copy of the history in SVN.
14+
The ```pypi`` branch contains all local patches on top of svn.
15+
This branch will be rebased frequently.
16+
17+
To install from pypi:
18+
19+
```
20+
$ pip install cpplint
21+
```
22+
23+
The run by calling
24+
```
25+
$ cpplint [OPTIONS] files
26+
```
27+
28+
For more info, see [Original README](README)
29+
30+
## Customizations
31+
32+
The modifications in this branch are minor fixes and cosmetic changes:
33+
34+
- more default extensions
35+
- python 3k compatibility
36+
- minor fixes around default file extensions
37+
- continuous integration on travis
38+
39+
## Maintaining
40+
41+
The strategy here is to have 3 branches: master, svn and pypi.
42+
In the svn branch, only commits from the original svn repo are added.
43+
The Pypi contains patches to upstream, that are intended to be rebased often.
44+
The master branch will be update to the latest pypi state (Either by tedious
45+
manual merging or by hard resets).
46+
47+
Prerequisites: Install git-svn.
48+
To fetch the latest changes from SVN upstream after cloning:
49+
50+
```
51+
# once after cloning
52+
git svn init http://google-styleguide.googlecode.com/svn/trunk/cpplint/
53+
# this creates a remote git-svn and get all new commits
54+
git svn fetch
55+
# update svn branch
56+
git checkout master
57+
git branch -D svn
58+
git checkout git-svn -b svn
59+
# this build will fail in travis, ignore that
60+
git push origin -f svn
61+
# rebase local patches
62+
git checkout pypi
63+
git rebase svn
64+
# run tests, fix if fail
65+
python cpplint_unittest.py
66+
# when all good, push pypi to let travis have a go with all python versions
67+
git push origin -f pypi
68+
# check travis is happy (github badge on pypi branch)
69+
git checkout master
70+
# evil hard push, maintainer must be careful, or do a tedious merge instead
71+
git reset --hard pypi
72+
git push origin -f master
73+
```
74+
75+
Then:
76+
- Wait and see if travis likes the changes
77+
- if necessary fix errors, like python3 compatibility (see earlier commit on common fixes)
78+
- Version Bump in setup.py, update changelog
79+
- Create new release in pypi:
80+
- ensure ~/.pypirc is valid
81+
- run:
82+
```
83+
python setup.py sdist register -r pypi
84+
python setup.py sdist bdist upload -r pypi
85+
```

changelog.rst

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
Changelog
2+
---------
3+
4+
0.0.5
5+
-----
6+
7+
Maintenance release, undoes earlier project folder structure changes
8+
to remain as true to upstream as possible.
9+
10+
0.0.4
11+
-----
12+
13+
- Merged with upstream revision r141 (2014-12-04)
14+
This includes many new checks, see commit messages for details.
15+
This also reverts some renaming of files, to stay close to the original project.
16+
17+
18+
0.0.3
19+
-----
20+
21+
- py3k compatibility
22+
23+
0.0.2
24+
-----
25+
26+
- fixed and extended allowed extensions
27+
28+
0.0.1
29+
-----
30+
31+
- import from googlecode, added setup.py
32+
- imported revision r83 (2012-05-11)

setup.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
from setuptools import setup
2+
3+
4+
setup(name='cpplint',
5+
version='0.0.5',
6+
py_modules=['cpplint'],
7+
# generate platform specific start script
8+
entry_points={
9+
'console_scripts': [
10+
'cpplint = cpplint:main'
11+
]
12+
},
13+
install_requires=[],
14+
url="http://en.wikipedia.org/wiki/Cpplint",
15+
download_url="https://github.com/tkruse/cpplint",
16+
keywords=["lint", "python", "c++"],
17+
maintainer = 'Thibault Kruse',
18+
maintainer_email = 'see_github@nospam.com',
19+
classifiers=["Programming Language :: Python",
20+
"Programming Language :: Python :: 2",
21+
"Programming Language :: Python :: 3",
22+
"Programming Language :: C++",
23+
"License :: Freely Distributable"],
24+
description="This is automated checker to make sure a C++ file follows Google's C++ style guide",
25+
long_description="""This is automated checker to make sure a C++ file follows Google's C++ style
26+
guide (http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml). As it
27+
heavily relies on regular expressions, cpplint.py won't catch all violations of
28+
the style guide and will very occasionally report a false positive. There is a
29+
list of things we currently don't handle very well at the top of cpplint.py,
30+
and we welcome patches to improve it.
31+
Original SVN download URL: http://google-styleguide.googlecode.com/svn/trunk/cpplint/""")

0 commit comments

Comments
 (0)