Munkei/atom-linter-cppcheck

cppcheck failing

Closed this issue · 10 comments

cppcheck v1.77
atom: latest
cppcheck: latest
windows 10
reproduction: installed it, and it didn't work. I used the installer in atom.

Error: spawn cppcheck ENOENT
    at getENOENTError (C:\Users\user\.atom\packages\linter-cppcheck\node_modules\sb-exec\lib\helpers.js:159:15)
    at ChildProcess.<anonymous> (C:\Users\user\.atom\packages\linter-cppcheck\node_modules\sb-exec\lib\index.js:50:46)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:877:16)
    at Socket.<anonymous> (internal/child_process.js:334:11)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at Pipe._handle.close [as _onclose] (net.js:493:12)

Which version of Linter Cppcheck are you using?

What have you configured for the cppcheck path?

(Just so you know, this is not a good way to report an issue. You're expected to at least say something about what you are doing when the error occurs, what you have tried in order to resolve it, etc. Just dumping a stack trace like this is generally frowned upon.)

Sorry about that. My cpp check version is x64 bit and 1.77. I have the latest version of this linter package. I am running windows 10 with the latest version of atom. I have the latest version of linter installed as well as I tried cpplint. Finally, I have minimap, and linter-write-good. Anything I am missing? I can't think of any other reproduction steps. Ask anything else you need to know and I will do my best to answer.

I'll have to look into this, but I don't have access to a Windows machine for a few day, unfortunately. I'll get back as soon as I can.

If you could post your Linter Cppcheck configuration (verbatim from the configuration file, a screenshot or a transcript) in the meantime that might be helpful.

.editorconfig

# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org

root = true

[*]

# Change these settings to your own preference
indent_style = space
indent_size = 2

# We recommend you to keep these unchanged
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false

this is the only config file I could find.
In atom I have checked:
Enable information
Enable Missing include
enable performance
enable portability
enable style
enable warning

Everything else is unchecked/empty.

That's not Atom's configuration file. I can't remember it's location on Windows, but you can always open it with Edit > Config….

It looks to me like you haven't configured to path to Cppcheck's executable. Could you try entering the full path to it under Executable, then save a C++ file and see if the error disappears (and Cppcheck-related linter issues appear, if there are any)?

"*":
  core:
    disabledPackages: [
      "linter-cpplint"
    ]
  editor:
    fontSize: 15
  "exception-reporting":
    userId: "340568c5-0936-dabc-aad3-d0e0e015f7a0"
  "linter-cppcheck":
    enableMissingInclude: true
  welcome:
    showOnStartup: false

Found it.

I see you have indeed not configured the path to the Cppcheck executable. Could you please try that?

How do I do that? I know I can got to edit-preferences to make a path, but I don't know exactly what I am suppose to do their.

In Linter Cppcheck's preferences there's a field called Executable. Put the full path to cppcheck.exe in there, e.g. C:\some\path\to\cppcheck.exe.

It works! Thank you so much for your time sir, and sorry if I was being difficult.