Sublime Forum

CppLint in Project

#1

Hi,
I am new to sublime text and trying to configure cpplint. I tried on the terminal and it works as expected but under sublime text there seems something wrong? I read the doc to SublimeLinter and I didn’t understand it very well. So I am not sure where to place the linter configuration.
Here I put it in the example.sublime-project file

{
  "folders":
  [
    {
      "name": "Example",
      "path": "."
    }
  ],

  "settings":
  {
    "working_dir":".",
    "SublimeLinter.linters.cppcheck.args":
    [
      "--language=c++",
      "--std=c++17",
      "--enable=all"
    ],
    "SublimeLinter.linters.cpplint.args":
    [
      "--root=src"
      "--filter=-whitespace/,-runtime/indentation_namespace"
    ]
  }
}

It seems that cpplint is ignoring the arguments.

TEST (TestIt, OneIsOne) {
  ASSERT_EQ( 1, 1);
}

In the first two lines it is showing me the following lint errors:

cpplint: error
Extra space before ( in function call [whitespace/parens] [4]

My expectation is that the errors should be gone…

0 Likes

#2

OK… I found out, if I explicitly open the project file with “open project” then it works. I thought it is enough to open a folder and the project file is loaded implicitly.
Sorry for the previous post…

0 Likes

#3

You may find the Project → Quick Switch Project… menu item helpful.

0 Likes