Make doctor diagnostics optionally correctable

Overview

Right now, gdk doctor only points out potential problems or recommends improvements but some of them could be auto-correctable, similar to Rubocop offenses.

Impacted categories

The following categories relate to this issue:

Proposal (optional)

Allow running gdk doctor -C or gdk doctor --correct to apply recommendations or fix easily fixable problems.

Idea for diagnostics:

module GDK
  module Diagnostic
    class GitMaintenance < Base
      # ...

      def correctable?
        true
      end

      def correct!
        repos_without_git_maintenance.map do |path|
          GDK::Shellout.new(%w[git maintenance start], chdir: path)
        end
      end

      # ...
    end
  end
end
Edited by Kev Kloss