All Projects → cxxxr → sblint

cxxxr / sblint

Licence: other
A linter for Common Lisp source code using SBCL

Programming Languages

common lisp
692 projects
shell
77523 projects

SBLint

SBLint is a linter for Common Lisp source code using SBCL.

Usage

Just run sblint command in your project directory, then it loads all ASD files and runs lint for all CL source files of those.

$ sblint -h
Usage:
    $ sblint # runs on all ASD files in current directory
    $ sblint [directories or files...]

Installation

As SBLint requires SBCL, make sure it is installed via Roswell:

$ ros install sbcl
# if it's already installed
$ ros use sbcl
$ ros install cxxxr/sblint

Using with reviewdog

reviewdog is an automated code review tool which provides a way to see review comments of diff before publishing it.

$ sblint | reviewdog -efm="%f:%l:%c: %m" -diff="git diff master"

cf. reviewdog — A code review dog who keeps your codebase healthy – Medium

Run before 'git commit'

It can be done by using git-hook's pre-commit. Just add the following script to ~/.git/hooks/pre-commit:

#!/bin/sh

# Copy this file to ./.git/hooks/pre-commit

if [ -z "$(which sblint)" ]; then
    echo "WARNING! sblint not found. Given up to run it."
    exit 0
fi

error_count=$(sblint | wc -l | tr -d '[[:space:]]')

if [ "$error_count" -gt "0" ]; then
    echo "Failed to commit because $error_count errors are found by SBLint."
    exit 1
fi

Author

Copyright

Copyright (c) 2016 Eitaro Fukamachi ([email protected])

License

Licensed under the BSD 2-Clause License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].