Skip to main content

Usage

$ lintnet --help
NAME:
lintnet - Powerful, Secure, Shareable Linter Powered by Jsonnet. https://lintnet.github.io/

USAGE:
lintnet [global options] [command [command options]]

VERSION:
0.4.11 (0ba58ccc5316e997ea48b0e289529b0399764457)

COMMANDS:
lint, l Lint files
info Output the information regarding lintnet
init Scaffold configuration file
test, t Test lint files
new Create a lint file and a test file
completion Output shell completion script for bash, zsh, or fish
version Show version
help, h Shows a list of commands or help for one command

GLOBAL OPTIONS:
--log-level string log level [$LINTNET_LOG_LEVEL]
--log-color string Log color. One of 'auto' (default), 'always', 'never' [$LINTNET_LOG_COLOR]
--config string, -c string Configuration file path [$LINTNET_CONFIG]
--help, -h show help
--version, -v print the version

lintnet lint

$ lintnet lint --help
NAME:
lintnet lint - Lint files

USAGE:
lintnet lint [command options] [lint file paths and data file paths]

DESCRIPTION:
Lint files

$ lintnet lint

You can lint only specific files.

$ lintnet lint [lint file paths and data file paths]

You can also lint only a specific target.

$ lintnet lint -target [target id]

By default, lintnet outputs nothing when the lint succeeds.
You can output JSON even if the lint succeeds. This is useful if you pass the output to other program such as jq.

$ lintnet lint -output-success


OPTIONS:
--output string, -o string You can customize the output format. You can specify an output id
--target string, -t string Lint only a specific target. You can specify a target id
--error-level string, -e string Set the error level [$LINTNET_ERROR_LEVEL]
--shown-error-level string Set the shown error level [$LINTNET_SHOWN_ERROR_LEVEL]
--output-success Output the result even if the lint succeeds (default: false) [$LINTNET_OUTPUT_SUCCESS]
--help, -h show help

lintnet info

$ lintnet info --help
NAME:
lintnet info - Output the information regarding lintnet

USAGE:
lintnet info [command options]

DESCRIPTION:
Output the information regarding lintnet.

$ lintnet info
{
"version": "v0.3.0",
"config_file": "lintnet.jsonnet",
"root_dir": "/Users/foo/Library/Application Support/lintnet",
"data_root_dir": "/Users/foo/repos/src/github.com/lintnet/lintnet",
"env": {
"GITHUB_TOKEN": "(masked)",
"LINTNET_LOG_LEVEL": "warn"
}
}

This command is useful for trouble shooting and sharing your environment in GitHub Issues.

You can mask the current user name.

$ lintnet info -mask-user

You can also get the root directory where modules are installed.

$ lintnet info -module-root-dir


OPTIONS:
--module-root-dir Show only the root directory where modules are installed (default: false)
--mask-user Mask the current user name (default: false)
--help, -h show help

lintnet init

$ lintnet init --help
NAME:
lintnet init - Scaffold configuration file

USAGE:
lintnet init

DESCRIPTION:
Scaffold configuration file.

$ lintnet init

This command generates lintnet.jsonnet.
If the file already exists, this command does nothing.


OPTIONS:
--help, -h show help

lintnet test

$ lintnet test --help
NAME:
lintnet test - Test lint files

USAGE:
lintnet test [<lint file, test file, or directory> ...]

DESCRIPTION:
Test lint files.

If you run "lintnet test" without any argument,
lintnet searches lint files using a configuration file and tests all lint files having test files.
Lint files without test files are ignored.
You can test only specific files by specifying files as arguments.
If you specify files explicitly, a configuration file is unnecessary.
This means when you develop modules, you don't have to prepare a configuration file.
If you specify directories, lint files in those directories and subdirectories are tested.
For example, "lintnet test ." searches files matching the glob pattern "**/*.jsonnet",
and "lintnet test foo" search files matching "foo/**/*.jsonnet".
If a configuration file isn't specified and isn't found, "lintnet test" works as "lintnet test .".

You can test only a specific target with -target option.


OPTIONS:
--target string, -t string Target ID
--help, -h show help

lintnet new

$ lintnet new --help
NAME:
lintnet new - Create a lint file and a test file

USAGE:
lintnet new [<lint file|main.jsonnet>]

DESCRIPTION:
Create a lint file and a test file.

$ lintnet new [<lint file|main.jsonnet>]

This command creates a lint file and a test file.
If the argument is not given, the lint file is created as "main.jsonnet".


OPTIONS:
--help, -h show help

lintnet completion

$ lintnet completion --help
NAME:
lintnet completion - Output shell completion script for bash, zsh, or fish

USAGE:
lintnet completion [command [command options]]

DESCRIPTION:
Output shell completion script for bash, zsh, or fish.
Source the output to enable completion.

e.g.

.bash_profile

if command -v lintnet &> /dev/null; then
source <(lintnet completion bash)
fi

.zprofile

if command -v lintnet &> /dev/null; then
source <(lintnet completion zsh)
fi

fish

lintnet completion fish > ~/.config/fish/completions/lintnet.fish


COMMANDS:
bash Output shell completion script for bash
zsh Output shell completion script for zsh
fish Output shell completion script for fish

OPTIONS:
--help, -h show help

completion bash

$ completion bash --help
NAME:
lintnet completion bash - Output shell completion script for bash

USAGE:
lintnet completion bash

OPTIONS:
--help, -h show help

completion zsh

$ completion zsh --help
NAME:
lintnet completion zsh - Output shell completion script for zsh

USAGE:
lintnet completion zsh

OPTIONS:
--help, -h show help

completion fish

$ completion fish --help
NAME:
lintnet completion fish - Output shell completion script for fish

USAGE:
lintnet completion fish

OPTIONS:
--help, -h show help

lintnet version

$ lintnet version --help
NAME:
lintnet version - Show version

USAGE:
lintnet version

OPTIONS:
--json, -j Output version in JSON format (default: false)
--help, -h show help