-
Notifications
You must be signed in to change notification settings - Fork 20
Installing and running CPILint
This page describes how to get CPILint set up on your computer.
The only requirement for running CPILint is that you have a Java 11 runtime installed on your computer. Everything else is included in the download.
Please download the latest version from GitHub.
Uncompress the downloaded ZIP archive to the location, where you want to install CPILint. Then add the bin directory to your PATH environment variable using the Control Panel.
Uncompress the downloaded ZIP archive to the location, where you want to install CPILint. Then add the bin directory to your PATH variable, by editing the appropriate file (probably .bash_profile or .profile). Finally, run the following command to make the Bash launch script executable by your user:
chmod u+x <install dir>/bin/cpilint
If you set the environment variable CPILINT_JAVA_HOME to point to a Java runtime, the launch scripts will use that runtime to execute CPILint. If the variable is not set, the scripts will use JAVA_HOME instead. If that variable is also not set, the launch scripts will assume that the java command is in the PATH.
To check whether CPILint was installed correctly, open a new command line window and enter the following command:
cpilint -version
If everything has been set up correctly, you should see output similar to the following:
CPILint version 1.0.5, copyright (c) 2019-2024 Morten N. Wittrock
To display usage information, run the following command:
cpilint -help
Once the bin directory is in your PATH, you can run CPILint from the command line as follows:
cpilint <options>
If you are in an environment with no launch script, you can still run CPILint. To do so, execute the following command:
java -classpath "<install dir>/lib/*:<install dir>/logback" dk.mwittrock.cpilint.CliClient <options>
CPILint returns the following exit codes:
- 0 if the inspection finished and found no issues
- 1 if the inspection finished and at least one issue was found
- 2 if there was an error and the inspection didn't finish
To remove CPILint from your system, merely delete the installation directory, and remove the bin directory from your PATH.