Giter Site home page Giter Site logo

jmbeach / tsqllint Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tsqllint/tsqllint

0.0 2.0 0.0 379 KB

Configurable linting for TSQL

License: MIT License

C# 95.06% PLpgSQL 1.20% SQLPL 0.04% PLSQL 0.04% Batchfile 0.89% PowerShell 2.38% JavaScript 0.24% Shell 0.16%

tsqllint's Introduction

npm version Build Status codecov

npm Gitter chat

tsqllint

tsqllint is a tool for describing, identifying, and reporting on undesirable patterns in TSQL scripts

Installation

The recommended method of installing tsqllint is to install the tool globally using NPM.

This binary can be installed though the npm registry. First, install Node.js version 4 or higher, and then installation is done using the npm install command:

$ npm install tsqllint -g

Configuration

# generate a default .tsqllintrc file using the init flag
$ tsqllint --init

Usage

# lint a single file
$ tsqllint test.sql

# lint all files in a directory
$ tsqllint c:\database_scripts

# lint a list of files and directories, paths with whitespace must be enclosed in quotes
$ tsqllint file_one.sql file_two.sql "c:\database scripts"

# lint using wild cards
$ tsqllint c:\database_scripts\file*.sql

# print path to .tsqllintrc config file
$ tsqllint --print

# display usage info
$ tsqllint --help

Creating custom configurations

Configure tsqllint by editing its config file, which is called .tsqllintrc, you can find its location with the "--print-confg" or "-p" option.

Rules may be set to off, warning, or error.

{
    "rules": {
        "conditional-begin-end": "error",
        "data-compression": "error",
        "data-type-length": "error",
        "disallow-cursors": "error",
        "information-schema": "error",
        "keyword-capitalization": "error",
        "multi-table-alias": "error",
        "object-property": "error",
        "print-statement": "error",
        "schema-qualify": "error",
        "select-star": "error",
        "semicolon-termination": "error",
        "set-ansi": "error",
        "set-nocount": "error",
        "set-quoted-identifier": "error",
        "set-transaction-isolation-level": "error",
        "set-variable": "error",
        "upper-lower": "error"
    }
}

tsqllint's People

Contributors

nathan-boyd avatar dougwilson avatar geoffbaker avatar

Watchers

Jared Beach avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.