Program The rantings of a lunatic Scientist

Posts tagged as Linter


Flint++ A CPP Linter for better coding

C/C++ Flint++

A few weeks ago I published a little side project called Flint++ to Github. Flint++ is a Cross-Platform, Zero-Dependency rewrite of Facebook’s flint project which they use to sanitize their codebase. The original flint is a great piece of software, but through poor documentation and difficult library and OS dependencies few people have taken to using it during their workflows. The aim of Flint++ is to make getting and running this tool too easy to pass up, and thereby help incite good coding practices and well written software.

The original flint is published on Github; and for discussions, there is a Google group.

Upcoming Features

  • More lint tests!
  • Visual Studio Integration!
  • JSON Config files to allow project dependent Lint settings
    • Set custom blacklisted identifiers/token sequences/includes
    • Enable/Disable certain tests
    • Track the config file with Git to give everyone on your team the same Lint checks

Current Lint Checks

  • Errors
    • Blacklisted Identifiers
    • Initialization from Self
    • #if #endif Balance
    • Memset Usage
    • Include Associated Header First
    • Include Guards
    • Inl-Header Inclusions
    • explicit single argument constructors
    • try-catch by reference
    • check for throw new ...
  • Warnings
    • Blacklisted Sequences
    • #define name rules
    • deprecated #includes
    • implicit casts
    • protected inheritance
    • function level throws
  • Advice
    • nullptr over NULL

Usage

$ flint++ --help
Usage: flint++ [options:] [files:]

    -r, --recursive         : Search subfolders for files.
    -c, --cmode             : Only perform C based lint checks.
    -j, --json              : Output report in JSON format.
    -l, --level [value:]    : Set the lint level.
                          0 : Errors only
                          1 : Errors & Warnings
                          2 : All feedback

    -h, --help              : Print usage.