tsqllint
tsqllint documentation
- Version in Mega-Linter: 1.14.0.0
- Visit Official Web Site
- See How to configure tsqllint rules
- See How to disable tsqllint rules in files
- See Index of problems detected by tsqllint
Configuration in Mega-Linter
- Enable tsqllint by adding
SQL_TSQLLINT
in ENABLE_LINTERS variable - Disable tsqllint by adding
SQL_TSQLLINT
in DISABLE_LINTERS variable
Variable | Description | Default value |
---|---|---|
SQL_TSQLLINT_ARGUMENTS | User custom arguments to add in linter CLI call Ex: -s --foo "bar" |
|
SQL_TSQLLINT_FILTER_REGEX_INCLUDE | Custom regex including filter Ex: (src\|lib) |
Include every file |
SQL_TSQLLINT_FILTER_REGEX_EXCLUDE | Custom regex excluding filter Ex: (test\|examples) |
Exclude no file |
SQL_TSQLLINT_CLI_LINT_MODE | Override default CLI lint mode - file : Calls the linter for each file- list_of_files : Call the linter with the list of files as argument- project : Call the linter from the root of the project |
{linter.cli_lint_mode} |
SQL_TSQLLINT_FILE_EXTENSIONS | Allowed file extensions. "*" matches any extension, "" matches empty extension. Empty list excludes all filesEx: [".py", ""] |
[".sql"] |
SQL_TSQLLINT_FILE_NAMES_REGEX | File name regex filters. Regular expression list for filtering files by their base names using regex full match. Empty list includes all files Ex: ["Dockerfile(-.+)?", "Jenkinsfile"] |
Include every file |
SQL_TSQLLINT_PRE_COMMANDS | List of bash commands to run before the linter | None |
SQL_TSQLLINT_POST_COMMANDS | List of bash commands to run after the linter | None |
SQL_TSQLLINT_CONFIG_FILE | tsqllint configuration file nameUse LINTER_DEFAULT to let the linter find it |
.tsqllintrc |
SQL_TSQLLINT_RULES_PATH | Path where to find linter configuration file | Workspace folder, then Mega-Linter default rules |
SQL_TSQLLINT_DISABLE_ERRORS | Run linter but consider errors as warnings | false |
SQL_TSQLLINT_DISABLE_ERRORS_IF_LESS_THAN | Maximum number of errors allowed | 0 |
IDE Integration
Use tsqllint in your favorite IDE to catch errors before Mega-Linter !
IDE | Extension Name | Install | |
---|---|---|---|
Visual Studio Code | TSQL Lint |
Mega-Linter Flavours
This linter is available in the following flavours
Flavor | Description | Embedded linters | Info | |
---|---|---|---|---|
all | Default Mega-Linter Flavor | 94 | ||
dotnet | Optimized for C, C++, C# or VB based projects | 47 |
Behind the scenes
How are identified applicable files
- File extensions:
.sql
How the linting is performed
- tsqllint is called once with the list of files as arguments
Example calls
tsqllint myfile.sql
tsqllint myfile.sql myfile2.sql
Help content
tsqllint [options] [file.sql] | [dir] | [file.sql | dir]
-c, --config Used to specify a .tsqllintrc file path other than the
default
-f, --force Used to force generation of default config file when
one already exists
-i, --init Generate default .tsqllintrc config file
-p, --print-config Print path to config file
-l, --list-plugins List the loaded plugins
-v, --version Display tsqllint version
-h, --help Display this help dialog
Installation on mega-linter Docker image
- Dockerfile commands :
RUN dotnet tool install --global TSQLLint