MaxCop

Version: 0.2.0
Release Date: 21st December, 2020
Licence: GPLv3
Source: github.com/sodaware/maxcop

Description

MaxCop is a work-in-progress attempt at a BlitzMax source code checker.

maxcop in action

Quick Installation Guide

  1. Extract the contents of the MaxCop zip to a directory.
  2. Optional Add this directory to your PATH variable (how do I do this on Windows?)

Basic Usage

Running maxcop in your project folder will perform a complete scan of any BMX source files.

maxcop also supports passing one or more files or directories.

maxcop src my_file.bmx

Configuring Rules

maxcop searches the directory of the current file for a maxcop_rules.ini or .maxcop.ini file. If one is not found, maxcop will search upwards until it finds a rules files, or until the root directory is reached.

Local rules file override any other rules in the project.

Rules can be disabled by including their full name and setting enabled to false:

[style/type_name_prefix]
enabled=false

Rule options can be set in a similar way.

[metrics/line_length]
max_line_length=80

Optional configuration

To enable scanning of modules, maxcop needs to configured with the correct module paths. maxcop will look for an ini file in the following places:

  • ~/.maxcoprc
  • ~/.config/maxcop.ini
  • ~/.config/maxcop/config.ini
  • maxcop.ini in the maxcop executable directory

An example configuration file looks something like this (replacing the full paths with ones for your system):

[mod_path]
win32 = c:\full\path\to\blitzmax\mods\
linux = /full/path/to/blitzmax/mods/
macos = /full/path/to/blitzmax/mods/

This step is only required if you wish to scan modules by name (e.g. running maxcop brl.basic) instead of with an absolute path.