Skip to content

WIP: Add a plugin that wraps shellcheck utility

Morten Volden requested to merge volden/kdevelop:addShellCheckPlugin into master

Overview

This plugin wraps the shellcheck utility. It can:

  • Configure various setting for shellcheck such as shell dialect, things to check for, severity level, etc.
  • Check your script and point out potential problems in the problems tool view
  • Suggest fixes using the solutionAssistant interface

The change just adds the plugin. No changes to the existing framework is made.

Motivation

Making KDevelop able to assist when hacking shell scripts. I personally found shellcheck very useful, so naturally I would like to have it integrated in my IDE.

The plugin needs to have shellcheck installed in order to work ( apt install shellcheck on Ubuntu )

After that is is just a matter of right clicking a .sh file and choose 'Analyze current file with' -> Shellcheck.

shellcheck_checkfile shellcheck_fixed_issue The plugin can be configured to exclude various checks, what types of issues to output, ect shellcheck_settings

Issues still to fix (or discuss with other kdevelop devs):

  • In order to see all output from shellcheck as inline notes, we currently need to change the settings in the language support setting. Maybe include that as part of the setting of this plugin?
  • Implement suggested fixes using the solutionAssistant interface
    • Find out how to get the pop-ups for shellcheck problems (And suggested fixes)
    • Set a text in the problem model when starting and finished.
    • Connect the setFullUpdate button with running shellcheck.
  • I think I need to inherit from ProblemModel to implement forceFullUpdate in the child class.
  • Various checks for the presence of shellcheck
  • General cleanup of debug loglines
  • General overhaul of class comments and testcases
Edited by Morten Volden

Merge request reports