Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cpplint.py requires a particular python version and fails silently with a different version #132

Closed
bhaller opened this issue May 11, 2016 · 6 comments
Labels

Comments

@bhaller
Copy link

bhaller commented May 11, 2016

Hi. This is my first time trying to use cpplint, so my problems are likely to be clueless noob problems, sorry.

I've downloaded the whole styleguide-ghpages branch, and am now trying to run cpplint.py. If I run just the command itself (in my case, since I haven't moved it somewhere sensible yet, by typing /Users/bhaller/Desktop/styleguide-gh-pages/cpplint/cpplint.py), I get the dump of the command syntax etc., so it seems like my python install is OK, and the cpplint.py file is OK, and so forth. However, if I try to actually lint a .cpp file, I get no output at all:

darwin:/DocumentsSynced/Research/Messer lab/SLiM project/SLiM/core bhaller $ /Users/bhaller/Desktop/styleguide-gh-pages/cpplint/cpplint.py ./slim_sim.cpp
darwin:
/DocumentsSynced/Research/Messer lab/SLiM project/SLiM/core bhaller $ ls -l ./slim_sim.cpp
-rw-r--r--@ 1 bhaller staff 132287 May 6 11:46 ./slim_sim.cpp

As you can see, the .cpp in question does exist. I would expect a river of error reports, since I make no effort to follow Google's C++ style. (All I want to use cpplint for is its build/include_what_you_use check.)

This is on Mac OS X. I'm using python 3.4.4, since that is what I happen to have installed:

darwin:/DocumentsSynced/Research/Messer lab/SLiM project/SLiM/core bhaller $ which python
/opt/local/bin/python
darwin:
/DocumentsSynced/Research/Messer lab/SLiM project/SLiM/core bhaller $ python --version
Python 3.4.4

I don't know python at all, so I'm at a loss at to how to proceed with diagnosing the problem. Thanks for any help.

@bhaller
Copy link
Author

bhaller commented May 15, 2016

Well, I figured out how to switch my macports install of python to version 2.7.11, and cpplint.py runs fine and produces output given that. So, progress! I guess the bug here, then, is either that (a) cpplint.py should work with later versions of python such as 3.4.4, or that (b) cpplint.py should detect emit an error message and terminate when run with versions of python with which it is not compatible.

@bhaller bhaller changed the title Can't get cpplint.py to actually do anything cpplint.py requires a particular python version and fails silently with a different version May 15, 2016
@DronMDF
Copy link

DronMDF commented Nov 21, 2017

I have this problem too...

$ find ./ -name "*.cpp" | xargs python2 ./cpplint.py 
[SKIPPED]
Done processing ./2out/2out/Success.cpp
Done processing ./2out/2out/CountError.cpp
Done processing ./2out/2out/Failure.cpp
Done processing ./2out/2out/TestSuite.cpp
Total errors found: 0
$ find ./ -name "*.cpp" | xargs python ./cpplint.py 
[NO OUTPUT]
$ python
Python 3.6.3 (default, Oct  3 2017, 21:45:48) 
[GCC 7.2.0] on linux

This python is default for ubuntu 17.10.

@GeorgeAtKistler
Copy link

Wow, 6 years passed and nobody cared to get it ready for Python 3, what a disappointment :(
The readme does not even give a hint, but it got updated a year ago...

@JaphyFan
Copy link

JaphyFan commented Nov 9, 2023 via email

@aaronliu0130
Copy link

aaronliu0130 commented Feb 2, 2024

@GeorgeAtKistler You can use the https://github.com/cpplint/cpplint fork.

@vapier vapier added the cpplint label Jul 8, 2024
@vapier
Copy link
Member

vapier commented Jan 17, 2025

public cpplint development in this repository has been halted (see #837). please migrate to https://github.com/cpplint/cpplint now.

@vapier vapier closed this as not planned Won't fix, can't repro, duplicate, stale Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants