c++ linter instructions #14676

issue Sjors opened this issue on November 7, 2018
  1. Sjors commented at 10:13 AM on November 7, 2018: member

    After dozens of nits from @practicalswift I decided to bite the bullet and figure out how to get a c++ linter running in my IDE. I haven't figured it out yet, but I took some notes... Can add to developer docs later:

    Command line:

    ...  the_file_you_worked_on.[h/cpp]
    

    Atom

    Install linter-gcc and its dependencies.

    Create a new file .gcc-flags.json with the following:

    {
      "gccIncludePaths": "src"
    }
    

    TODO:

    • figure how to add dependencies to include path and/or how not to duplicate that effort (call make?)
    • add .gcc-flags.json to project or to .gitignore in the PR along with these instructions

    macOS specific

    Install gcc via Homebrew: brew install gcc, and point to that binary in the GCC Executable Path setting: /usr/local/Cellar/gcc/8.2.0/bin/g++-8

    [other editor]

  2. fanquake added the label Docs on Nov 7, 2018
  3. MarcoFalke commented at 3:54 PM on November 7, 2018: member

    I think @fanquake and @ryanofsky brought up that make check could run the linters.

  4. MarcoFalke added the label Brainstorming on Nov 7, 2018
  5. Sjors commented at 7:11 PM on November 7, 2018: member

    That seems a little slow for inside an editor though, but it's a start.

  6. fanquake commented at 3:02 AM on November 10, 2018: member

    @Sjors Which linter are you setting up? clang-tidy?

  7. Sjors commented at 8:28 AM on November 10, 2018: member

    @fanquake whatever https://atom.io/packages/linter-gcc uses under the hood, though there are other linter packages for Atom too.

  8. practicalswift commented at 8:23 AM on November 13, 2018: contributor
  9. Sjors commented at 2:35 PM on February 19, 2019: member

    @practicalswift can you explain what commands and tools you're normally using to find all these nits? I'm assuming you're not a bot yourself and can spot these things instantly through AI magic :-)

  10. fanquake commented at 2:36 AM on March 18, 2019: member

    @Sjors I've started writing some notes on using Clang tools, such as clang-tidy and clang-format, on macOS. Available here: https://github.com/fanquake/core-review/blob/master/clang-tools.md.

  11. practicalswift commented at 6:38 PM on March 22, 2019: contributor

    @Sjors I'm using a wide range of tools of which some are open source, some are commercial and some are homegrown. I've written my own infrastructure for handling/normalising/triaging the results from these tools.

    But generally I would recommend simply starting with what Clang provides: clang-tidy and the Clang Static Analyser. That will give the most bang for the buck to start with :-) @fanquake's notes in https://github.com/fanquake/core-review/blob/master/clang-tools.md seems like a good start.

  12. practicalswift commented at 7:19 PM on March 22, 2019: contributor

    @Sjors If you're interested in static analysis generally I can recommend Gerard Holzmann's presentation on how NASA's Jet Propulsion Laboratory made use of static analysis during the Mars Curiosity software development project:

    Unrelated to the video, but NASA's Software Verification and Validation unit is doing some really interesting sound static analysis work.

    Tax dollars well spent!

  13. MarcoFalke commented at 11:19 PM on May 8, 2020: member

    The feature request didn't seem to attract much attention in the past. Also, the issue seems not important enough right now to keep it sitting around idle in the list of open issues.

    Closing due to lack of interest. Pull requests with improvements are always welcome.

  14. MarcoFalke closed this on May 8, 2020

  15. MarcoFalke locked this on Feb 15, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-14 09:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me