Sub-commands and Arguments

Overview of sub-commands:

doc
  Command to generate the JSON documentation of the currently loaded plugins

lint
  Lint a project or a list of files.

yalo doc

Command to generate the JSON documentation of the currently loaded plugins

DESCRIPTION

USAGE

yalo doc [OPTIONS]

Where options are:

  • -C CONFIG-FILE or --config-file CONFIG-FILE Load CONFIG-FILE instead of searching for .yaloconf

  • -I DIR or --include-dir DIR Add DIR to the list of directories when plugins should be searched for

  • -L PLUGIN or --load-plugin PLUGIN Load plugin PLUGIN (a .cmxs or a .ml file)

  • -P PROFILE or --profile PROFILE Specify a profile to load (a yalo-<PROFILE>.conf file)

  • --dir DIRECTORY Target directory for output

  • -e SPEC or --errors SPEC Set errors according to SPEC-ification

  • --no-load-plugins Do not load plugins

  • --print-config Print configuration

  • --save-config FILE Save configuration to FILE

  • -w SPEC or --warnings SPEC Set warnings according to SPEC-ification

yalo lint

Lint a project or a list of files.

DESCRIPTION

Thie command will perform the following actions

Early actions (common to all sub-commands):

  • 1. Lookup the .yaloconf file in the containing folders. if located, chdir to the corresponding directory.

  • 2. If a configuration file was found, load the corresponding file. If profiles are specified in the configuration file, recursively load the profiles too.

  • 3. If plugins are specified on command line, in the configuration file or in profiles specified in the configuration file, load the plugins

Specific actions:

  • a. Enable/disable warnings following command line and configuration options. Enable only linters for enabled warnings.

  • b. Scan the project tree, looking for files to lint. Each file is associated with a set of including projects.

  • c. Lint all the files of selected projects

  • d. Display or output warnings

  • e. Apply autofix patches if available and the –autofix option was used

INITIAL ARGUMENTS

Some arguments MUST be specified before the sub-command name (-L,-P,-I,-C,–no-load-plugins). The reason is that these arguments are used to define which and how plugins should be loaded, either directly or though configuration files, and plugins can define new arguments for sub-commands and even new sub-commands

USAGE

yalo lint FILES [OPTIONS]

Where options are:

  • FILES List of files or directories that should be explicitely linted

  • -C CONFIG-FILE or --config-file CONFIG-FILE Load CONFIG-FILE instead of searching for .yaloconf

  • -I DIR or --include-dir DIR Add DIR to the list of directories when plugins should be searched for

  • -L PLUGIN or --load-plugin PLUGIN Load plugin PLUGIN (a .cmxs or a .ml file)

  • -P PROFILE or --profile PROFILE Specify a profile to load (a yalo-<PROFILE>.conf file)

  • --autofix Apply all automatic replacements (files created in _yalo/)

  • --autofix-inplace Autofix files in place

  • -e SPEC or --errors SPEC Set errors according to SPEC-ification

  • -f FORMAT or --message-format FORMAT Set message format to FORMAT: context (default), human, short, summary, sarif

  • --no-load-plugins Do not load plugins

  • --no-summary Never print any summary

  • -o FILE or --output FILE File for JSON output

  • -p PROJECT or --package PROJECT Lint only files from PROJECT

  • --print-config Print configuration

  • --save-config FILE Save configuration to FILE

  • --skip-config-warnings Skip warnings and errors settings by config file

  • --summary-from NUMBER Print summary when warnings exceed NUMBER

  • -w SPEC or --warnings SPEC Set warnings according to SPEC-ification