cpplint-extension icon indicating copy to clipboard operation
cpplint-extension copied to clipboard

cpplint installed but not working on vscode

Open TeachMeTW opened this issue 4 years ago • 5 comments

1 2

4 5 1 Basically, cpplint is installed but it is not working on the vscode gui. I can run the command and it shows the problems but does not highlight or do anything to vscode.

TeachMeTW avatar Jun 23 '21 03:06 TeachMeTW

i'm win10, use python3.9 inatall the cpplint.exe, not working on vscode.
I found the problem, the folder or file opened by VSCode cannot contain Chinese characters...

weycen avatar Jul 27 '21 12:07 weycen

I met a similar issue:

  • First, I am sure cpplint is installed
$ cpplint

Syntax: cpplint.py [--verbose=#] [--output=vs7] [--filter=-x,+y,...]
                   [--counting=total|toplevel|detailed] [--root=subdir]
                   [--linelength=digits]
        <file> [file] ...

  The style guidelines this tries to follow are those in
    http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml

  Every problem is given a confidence score from 1-5, with 5 meaning we are
  certain of the problem, and 1 meaning it could be a legitimate construct.
  This will miss some errors, and is not a substitute for a code review.

  To suppress false-positive errors of a certain category, add a
  'NOLINT(category)' comment to the line.  NOLINT or NOLINT(*)
  suppresses errors of all categories on that line.

  The files passed in will be linted; at least one file must be provided.
  Default linted extensions are .cc, .cpp, .cu, .cuh and .h.  Change the
  extensions with the --extensions flag.

  Flags:

    output=vs7
      By default, the output is formatted to ease emacs parsing.  Visual Studio
      compatible output (vs7) may also be used.  Other formats are unsupported.
  • Second, it is also correctly configured in vscode's settings.json. image

However, it never displays code-style or other info in vscode...

BIAOXYZ avatar Aug 04 '21 12:08 BIAOXYZ

@BIAOXYZ Is your operating system Windows? If it is, i think your path is wrong, here are my settings:

"cpplint.cpplintPath": "D:\\ProgramFiles\\Python39\\Scripts\\cpplint.exe"

Maybe you can wrapper cpplint.py as a script cpplint.bat, refer to #16 . I have tried this method, it is feasible.

weycen avatar Aug 05 '21 01:08 weycen

@BIAOXYZ Is your operating system Windows? If it is, i think your path is wrong, here are my settings:

"cpplint.cpplintPath": "D:\\ProgramFiles\\Python39\\Scripts\\cpplint.exe"

Maybe you can wrapper cpplint.py as a script cpplint.bat, refer to #16 . I have tried this method, it is feasible.

@weycen Thanks a lot for your help.

The OS of my development machine (where the project as well as the settings.json file lies in) is Debian 9. However, I use vscode's remote ssh mode, so the picture is a screenshot from a Mac Book Pro.

I've already tried adding .py to the end, namely, using this ("/usr/local/bin/cpplint.py") as the value of key "cpplint.cpplintPath". But vscode immediately prompt this:

image

BIAOXYZ avatar Aug 05 '21 14:08 BIAOXYZ

@BIAOXYZ Is your operating system Windows? If it is, i think your path is wrong, here are my settings:

"cpplint.cpplintPath": "D:\\ProgramFiles\\Python39\\Scripts\\cpplint.exe"

Maybe you can wrapper cpplint.py as a script cpplint.bat, refer to #16 . I have tried this method, it is feasible.

@weycen Thanks a lot for your help.

The OS of my development machine (where the project as well as the settings.json file lies in) is Debian 9. However, I use vscode's remote ssh mode, so the picture is a screenshot from a Mac Book Pro.

I've already tried adding .py to the end, namely, using this ("/usr/local/bin/cpplint.py") as the value of key "cpplint.cpplintPath". But vscode immediately prompt this:

image

Same problem here. Is there any solution?

SimonNie98 avatar Jul 02 '24 08:07 SimonNie98