sky-uk / bslint

A linter for the BrightScript language.
BSD 3-Clause "New" or "Revised" License
24 stars 9 forks source link

BrightScript Linter

CircleCI

We're hiring! http://developers.sky.com

Description

This is a tool for linting BrightScript.

This tool has been made because there aren't any tools currently available to help developers keep their coding standards consistent. The linter validates against the official BrightScript Language Reference. Currently the linter only lexes the file and validates styling. We are actively developing a parser which will be integrated into this project.

Installing bslint via pip3

The package is published on pip3, to install follow the steps below:

  1. Ensure that you've got Python3 installed on your machine (https://www.python.org/downloads/). To check if python3 is already installed, run python3 -V in your terminal.

  2. Install bslint by running the following command in terminal pip3 install bslint.

Upgrading bslint via pip3

To upgrade bslint run the following command in terminal pip3 install bslint --upgrade.

Running bslint from terminal

To run bslint from the terminal, cd to the directory that you wish to lint and run the command bslint.

Basic Options

You can run bslint in multiple ways:

Advanced Options

You can create a .bslintrc file, this MUST be in the same directory as your manifest file. The .bslintrc file must be valid JSON. In this file you can specify specific directories you want to ignore each time and override the default styling rules checks.

Every key in the .bslintrc file is optional (except for ignore, which can be left as an empty array )

{
    "ignore": ["components", "src/subdirectory_name"],
    "spell_check": {
        "active": true,
        "params": {
            "dictionary": "en_GB"
        }
    }
}

For a full list of styling rules, view the default config file in bslint/config in the Github source code

Watching for Changes

If you want to run the linter each time a file changes then refer to this page in the wiki: https://github.com/sky-uk/bslint/wiki/Watching-For-Changes

Roku SDK Documentation

BrightScript Language Reference

Support Channel

If you have any questions try contacting us on Gitter

Team Members

Name Github
Shane Bloomer @sbsky
Jack Ingleton @JackIngleton
Zac Robinson @zac-robinson
Daniele Sassoli @DanieleSassoli