Debugging
Plugin errors
A plugin error indicates that a plugin exited with a status code that is interpretted as an error. This can occur for a number of different reasons. For example, some linters will crash if they attempt to analyze files with invalid syntax.
Some linters exit with a non-zero code when they find issues. Qlty treats these exit codes as success to differentiate the case where a plugin ran successfully identified issues vs. a crash or unexpected failure.
Verbose and debug output
Typically the first step to investigating a plugin error is to re-run the plugin with verbose or debug output enabled. Here is an example:
The --debug
option will increase the amount of detail in the logs going to .qlty/logs/qlty-cli.*
. You can tail this log as you run the CLI to watch for issues with tail -f .qlty/logs/qlty-cli.*
.
The --verbose
option will cause the CLI to print a summary of every invocation (execution) of the plugin from the run. The full details of each invocation are recorded in an output file saved to the .qlty/out/invocations/
directory. Here is an example:
From this file you can see the exact command that was run, the environment variables that were set, and the output that was produced. If any errors occurred, they will be included.
Could not find "[package-name]"
(Missing plugin extension)
A common error is that a plugin may be missing an extension references in its configuration. For example:
This error indicates that the Stylelint plugin was unable to load @blueprintjs/stylelint-plugin
. The reason that this would happen is because the Qlty CLI installs static analysis tools into sandboxes in order to create conssitent, reporducible results whereever it is run.
When an erorr like this occurs, you will generally find that the references package (in this case, @blueprintjs/stylelint-plugin
) is included in the project’s package.json
file. By default, we do not install the packages in the package.json
file when we run analysis.
There are a three ways to fix this:
Could not find "[config file].[json]"
(Missing configuration file)
If you have a static analysis configuration file that is not using one of the tool’s standard configuration filenames, Qlty needs to know about it. Otherwise, you will see errors like this:
The fix is to make the Qlty CLI aware of the configuration filename, in this case stylelintrc.shared.json
. To do this, you need to override the definition of the Stylelint plugin to include all of the configuration file names you use in your project.
For example, you can add this towards the top of your .qlty/qlty.toml
file:
This will cause Qlty to ensure that all of those listed configuration files, including the custom, shared configuration file, are properly made available to the plugin.
Plugin parser errors
A parse error indicates that Qlty was unable to process the results output by the plugin. This can happen is a static analysis tool changes its output format.
If you encounter a parse error with a plugin, please contact support for assistance.