commandbox-modules / commandbox-codechecker

A CLI wrapper for the Codechecker project
4 stars 6 forks source link
hacktoberfest
   ______          __     ________              __                ________    ____
  / ____/___  ____/ /__  / ____/ /_  ___  _____/ /_____  _____   / ____/ /   /  _/
 / /   / __ \/ __  / _ \/ /   / __ \/ _ \/ ___/ //_/ _ \/ ___/  / /   / /    / /
/ /___/ /_/ / /_/ /  __/ /___/ / / /  __/ /__/ ,< /  __/ /     / /___/ /____/ /
\____/\____/\__,_/\___/\____/_/ /_/\___/\___/_/|_|\___/_/      \____/_____/___/

CodeChecker CLI

A CLI wrapper for the CodeChecker project. This CLI bundles the CodeChecker core libraries for use in the command line.

Installation

install commandbox-codechecker

Usage

To start a code review against your code, run this command:

codechecker run

Arguments

JSON Configuration

If a .codechecker.json file is found in the current working directory, it will be picked up and used. This file can contain the following keys:

Here is an example .codechecker.json file:

{
    "paths" : "**.cf?",
    "excludePaths" : "modules/,test**",
    "minSeverity" : 1,
    "includeRules" : {
        "Maintenance" : "*",
        "Security Risks - Best Practices" : "*",
        "One-off Rules" : "*",
        "Standards" : [
            "Don't use IS or GT for boolean tests"
        ]
    },
    "excludeRules" : {
        "Maintenance" : [
            "Don't use Log"
        ]
    },
    "ruleFiles" : [
        "myRules.json"
    ],
    "customRules" : [
        {
            "pattern": "cfoutput",
            "message": "CFoutput is lame",
            "category": "One-off Rules",
            "name": "Don't use CFoutput",
            "extensions": "cfm,cfc",
            "severity": "3"
        }
    ]
}

View all Categories/Rules

To view all the categories and rules available to you, run this command:

codechecker categories