Code Monkey home page Code Monkey logo

atom-linter-cppcheck's Introduction

⚠ This software is no longer maintained! ⚠

linter-cppcheck is no longer maintained, and should be considered deprecated. We do no longer accept bug reports, feature requests or pull requests.

If you’d like to take over ownership of this project, please contact @biffen.

linter-cppcheck

Build Status License Downloads


A linter for Atom using Cppcheck.

Requirements

Cppcheck needs to be installed (or at least available). Its path can be configured.

Without Linter this package is rather useless.

Configuration

The package settings are available at: Edit > Preferences > Packages > linter-cppcheck

You can configure the location of the Cppcheck executable. The default is to look for cppcheck in your $PATH environment variable. In most cases this should ‘just work’.

For Windows users: Cppcheck’s executable is probably not available as cppcheck in your %PATH%. On Windows you will most likely have to configure the path yourself in the Executable field (e.g. C:\Program Files\Cppcheck\cppcheck.exe, but it may vary).

You can also configure which checks Cppcheck should perform. If you want to know more about these checks please see the Cppcheck Manual or run man cppcheck.

Acknowledgements

This package is really a tiny amount of glue between other great pieces of software, namely the Linter package, the atom-linter module and — of course — Cppcheck.

atom-linter-cppcheck's People

Contributors

arcanemagus avatar biffen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

atom-linter-cppcheck's Issues

Deprecated selector in `linter-cppcheck/styles/linter-cppcheck.less`

In linter-cppcheck/styles/linter-cppcheck.less:

Starting from Atom v1.13.0, the contents of atom-text-editor elements are no longer encapsulated within a shadow DOM boundary. This means you should stop using :host and ::shadow pseudo-selectors, and prepend all your syntax selectors with syntax--. To prevent breakage with existing style sheets, Atom will automatically upgrade the following selectors:

  • atom-text-editor::shadow .linter-highlight.information:not(.line-number), .linter-highlight.information:not(.line-number) => atom-text-editor.editor .linter-highlight.information:not(.line-number), .linter-highlight.information:not(.line-number)

  • atom-text-editor::shadow .linter-highlight.information .linter-gutter, .linter-highlight.information .linter-gutter => atom-text-editor.editor .linter-highlight.information .linter-gutter, .linter-highlight.information .linter-gutter

  • atom-text-editor::shadow .linter-highlight.information .region, .linter-highlight.information .region => atom-text-editor.editor .linter-highlight.information .region, .linter-highlight.information .region

  • atom-text-editor::shadow .linter-highlight.performance:not(.line-number), .linter-highlight.performance:not(.line-number), atom-text-editor::shadow .linter-highlight.portability:not(.line-number), .linter-highlight.portability:not(.line-number), atom-text-editor::shadow .linter-highlight.style:not(.line-number), .linter-highlight.style:not(.line-number) => atom-text-editor.editor .linter-highlight.performance:not(.line-number), .linter-highlight.performance:not(.line-number), atom-text-editor.editor .linter-highlight.portability:not(.line-number), .linter-highlight.portability:not(.line-number), atom-text-editor.editor .linter-highlight.syntax--style:not(.line-number), .linter-highlight.style:not(.line-number)

  • atom-text-editor::shadow .linter-highlight.performance .linter-gutter, .linter-highlight.performance .linter-gutter, atom-text-editor::shadow .linter-highlight.portability .linter-gutter, .linter-highlight.portability .linter-gutter, atom-text-editor::shadow .linter-highlight.style .linter-gutter, .linter-highlight.style .linter-gutter => atom-text-editor.editor .linter-highlight.performance .linter-gutter, .linter-highlight.performance .linter-gutter, atom-text-editor.editor .linter-highlight.portability .linter-gutter, .linter-highlight.portability .linter-gutter, atom-text-editor.editor .linter-highlight.syntax--style .linter-gutter, .linter-highlight.style .linter-gutter

  • atom-text-editor::shadow .linter-highlight.performance .region, .linter-highlight.performance .region, atom-text-editor::shadow .linter-highlight.portability .region, .linter-highlight.portability .region, atom-text-editor::shadow .linter-highlight.style .region, .linter-highlight.style .region => atom-text-editor.editor .linter-highlight.performance .region, .linter-highlight.performance .region, atom-text-editor.editor .linter-highlight.portability .region, .linter-highlight.portability .region, atom-text-editor.editor .linter-highlight.syntax--style .region, .linter-highlight.style .region

Automatic translation of selectors will be removed in a few release cycles to minimize startup time. Please, make sure to upgrade the above selectors as soon as possible.

Clear instructions how to even get this thing started for beginners?

I installed linter and installed cppcheck and I have no clue how to even get this started, it doesn't check my errors.
I just want to something to live error check my code such as syntax error and etc instead of me using make file to find my errors. that's it.
I don't understand why there are no clear instructions on what to do after you installed these packages.

False positives: "struct member is never used"

While scanning a *.h file for Style errors, the linter flags as "not being used" several members of a struct defined therein, even though they are all used inside the *.cc file that includes the *.h.

Searching the internet I got the impression that *.h files are not supposed to be scanned independently. Instead, they are scanned from within the *.cc when a #include directive is found.

Is it possible to disable scanning of C++ headers (for Style errors)?

using MissingInclude and UnusedFunction causes cppcheck not to run

I had to create some console logging to determine what command and args were being run to troubleshoot why cppcheck was not finding errors. I realized that when using MissingInclude and UnusedFunction checks I was getting the following error (when running via command line to reproduce the problem):
cppcheck: there is no --enable parameter with the name 'missinginclude'
cppcheck: there is no --enable parameter with the name 'unusedfunction'

The problem here is the parameter is not camelCase (ie. missingInclude works).

In linter-cppcheck.js you lower case the enables string and therefor the entire parameter is lower case.

1.) Can you use something like this to get the correct case:
enables.push(enable.charAt(0).toLowerCase() + enable.slice(1));

2.) Also, can you add some logging so that we can troubleshoot better what is going on.

Thanks,
Trevor

Option to configure the execution time and show if linter is running

Hello, I don't know if this is possible, but would be nice if I could configure the execution timeout, because sometimes with a big file, the "linter" never finish, because execution is stopped in the middle.

Other problem is that I can't know when "linter" is running or not, it would be nice show somewhere that "linter" is running, so I can know when it finished! Today I have to save the file and wait looking to the screen to see if something happens!

Its not working

It is just not. I have windows 10, have installed cppcheck, and i still does not work

Add C++14 grammar

Hello!
I was just developing my own cppcheck linter when I say your own... I'm not used to github way of proposing changes and It seems that currently my atom setup is confused between your plugin and my plugin.

But I just wanted to add grammar support to your package. Its just adding a new case statement. I guess that that issue can happen if the user has installed the language-cpp14 plugin for atom.

const grammar = textEditor.getGrammar().name;
switch (grammar) {
case 'C':
args.push('--language=c');
break;

    case 'C++':
case 'C++14':
      args.push('--language=c++');
      break;

    default:
      console.warn(
        `[linter-cppcheck] Unrecognised grammar ‘${grammar}’`
      );
      break;
  }

Thanks

cppcheck failing

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)

CppCheck Showing Error

Whenever i compile a c++ programme in atom, an error pops up -;

[linter] Error Running cppcheck.
See developer console for more info.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.