Skip to content

Cannot install linter -- Unknown plugin #3366

@shmitchel

Description

@shmitchel

Description of the problem or steps to reproduce

I can't seem to install the linter:

Through the command line

$ micro -plugin install linter
Unknown plugin "linter"

Through command mode

$ micro
// type <ctrl-e>
> plugin install linter
Unknown plugin "linter"

Specifications

Version 2.0.14-dev.185
Commit hash 9176508
Compiled May 21, 2024
OS PureOS
Terminal Tilix

Attempts to fix

Manual Install

I've tried installing the linter manually to ~/.config/micro/plug by cloning the repo and copying the relevant directory:

$ tree ~/.config/micro/plug/linter
/home/guy/.config/micro/plug/linter/
├── help/
│   └── linter.md
└── linter.lua

Copy linter to repo

I've tried adding the linter to a personal repository, tagged it, set up the repo.json, and then added that repository to my configs:
~/.config/micro/channel.json

[
  ...
    // linter plugin
  "https://raw.githubusercontent.com/shitchell/micro-linter/v1.0.0/repo.json"
]

~/.config/micro/settings.json

{
  ...
  "pluginrepos": ["https://raw.githubusercontent.com/shitchell/micro-linter/main/repo.json"],
  ...
}

And this does let me install it! When I run micro -plugin install linter, it fetches the zip and installs it to ~/.config/micro/plug. But... it still doesn't do anything. I tried adding a basic linter in my init.lua:
~/.config/micro/init.lua

function init()
    linter.makeLinter("typescript", "ts", "tsc", {"--noEmit"}, "%f:%l:%c:.+: %m")
end

And when I launch micro, it gives me the following error:

$ micro
Plugin initlua: init:2: attempt to index a non-table object(nil) with key 'makeLinter'
stack traceback:
        init:2: in main chunk
        [G]: ?

Press enter to continue

Using micro -debug registers nothing related except for a line saying that the "linter" plugin is overridden.:

$ micro -debug
$ cat log.txt
2024/07/02 09:47:47 Micro started
2024/07/02 09:47:47 linter built-in plugin overridden by user-defined one

And that's only when I use the cloned linter plugin. In other scenarios, I only get the "Micro started" line.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions