Skip to content
This repository has been archived by the owner on Aug 12, 2023. It is now read-only.

failed to run generator: solhint #1576

Open
5 tasks done
getarealcomputer opened this issue May 23, 2023 · 0 comments
Open
5 tasks done

failed to run generator: solhint #1576

getarealcomputer opened this issue May 23, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@getarealcomputer
Copy link

FAQ

  • I have checked the FAQ and it didn't resolve my problem.

Issues

  • I have checked existing issues and there are no issues with the same problem.

Neovim Version

NVIM v0.9.0 Build type: RelWithDebInfo LuaJIT 2.1.0-beta3 Compilation: /usr/bin/gcc -O2 -g -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wvla -Wdouble-promotion -Wmissing-noreturn -Wmissing-format-attribute -Wmissing-prototypes -fno-common -Wno-unused-result -Wimplicit-fallthrough -fdiagnostics-color=auto -fstack-protector-strong -DUNIT_TESTING -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -I/usr/include/luajit-2.1 -I/usr/include -I/usr/include/luajit-2.1 -I/builddir/build/BUILD/neovim-0.9.0/redhat-linux-build/src/nvim/auto -I/builddir/build/BUILD/neovim-0.9.0/redhat-linux-build/include -I/builddir/build/BUILD/neovim-0.9.0/redhat-linux-build/cmake.config -I/builddir/build/BUILD/neovim-0.9.0/src -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include system vimrc file: "$VIM/sysinit.vim" fall-back for $VIM: "/usr/share/nvim"

Dev Version?

  • I am using a stable Neovim release version, or if I am using a dev version of Neovim I have confirmed that my issue is reproducible on a stable version.

Operating System

Fedora 38

Minimal Config

-- this template is borrowed from nvim-lspconfig
local on_windows = vim.loop.os_uname().version:match("Windows")

local function join_paths(...)
    local path_sep = on_windows and "\\" or "/"
    local result = table.concat({ ... }, path_sep)
    return result
end

vim.g.loaded_remote_plugins = ""
vim.cmd([[set runtimepath=$VIMRUNTIME]])

local temp_dir = vim.loop.os_getenv("TEMP") or "/tmp"

vim.cmd("set packpath=" .. join_paths(temp_dir, "nvim", "site"))

local package_root = join_paths(temp_dir, "nvim", "site", "pack")
local install_path = join_paths(package_root, "packer", "start", "packer.nvim")
local compile_path = join_paths(install_path, "plugin", "packer_compiled.lua")

local null_ls_config = function()
    local null_ls = require("null-ls")
    -- add only what you need to reproduce your issue
    null_ls.setup({
        sources = {
          null_ls.builtins.diagnostics.solhint,
        },
        debug = true,
    })
end

local function load_plugins()
    -- only add other plugins if they are necessary to reproduce the issue
    require("packer").startup({
        {
            "wbthomason/packer.nvim",
            {
                "jose-elias-alvarez/null-ls.nvim",
                requires = { "nvim-lua/plenary.nvim" },
                config = null_ls_config,
            },
        },
        config = {
            package_root = package_root,
            compile_path = compile_path,
        },
    })
end

if vim.fn.isdirectory(install_path) == 0 then
    vim.fn.system({ "git", "clone", "https://github.com/wbthomason/packer.nvim", install_path })
    load_plugins()
    require("packer").sync()
else
    load_plugins()
    require("packer").sync()
end

Steps to Reproduce

  1. npm i -g solhint
  2. nvim --clean -u ~/minimal_init.lua contracts/unstoppable/UnstoppableVault.sol
    UnstoppableVault.zip

Reproducibility Check

  • I confirm that my minimal config is based on the minimal_init.lua template and that my issue is reproducible by running nvim --clean -u minimal_init.lua and following the steps above.

Expected Behavior

Diagnostics message should be on the left of the line that the linter detected

Actual Behavior

Nothing show up on my document, not even on the line that the linter warn me about. Only messages show up when starting nvim.

Debug Log

[TRACE Wed May 24 00:07:25 2023] .../site/pack/packer/start/null-ls.nvim/lua/null-ls/rpc.lua:102: received LSP request for method shutdown
[TRACE Wed May 24 00:07:25 2023] .../site/pack/packer/start/null-ls.nvim/lua/null-ls/rpc.lua:127: received LSP notification for method exit
[TRACE Wed May 24 00:07:27 2023] ...te/pack/packer/start/null-ls.nvim/lua/null-ls/client.lua:97: starting null-ls client
[TRACE Wed May 24 00:07:27 2023] .../site/pack/packer/start/null-ls.nvim/lua/null-ls/rpc.lua:102: received LSP request for method initialize
[DEBUG Wed May 24 00:07:27 2023] ...te/pack/packer/start/null-ls.nvim/lua/null-ls/client.lua:152: unable to notify client for method textDocument/didOpen (client not active): {
textDocument = {
uri = "file:///mnt/c/Users/servicelaptop/projects/solidity/damn-vulnerable-defi/contracts/unstoppable/UnstoppableVault.sol"
}
}
[TRACE Wed May 24 00:07:27 2023] .../site/pack/packer/start/null-ls.nvim/lua/null-ls/rpc.lua:127: received LSP notification for method initialized
[TRACE Wed May 24 00:07:27 2023] .../site/pack/packer/start/null-ls.nvim/lua/null-ls/rpc.lua:127: received LSP notification for method textDocument/didOpen
[TRACE Wed May 24 00:07:27 2023] ...ack/packer/start/null-ls.nvim/lua/null-ls/generators.lua:21: running generators for method NULL_LS_DIAGNOSTICS_ON_OPEN
[DEBUG Wed May 24 00:07:27 2023] ...t/null-ls.nvim/lua/null-ls/helpers/generator_factory.lua:320: spawning command "solhint" at /mnt/c/Users/servicelaptop/projects/solidity/damn-vulnerable-defi with args { "/mnt/c/Users/servicelaptop/projects/solidity/damn-vulnerable-defi/contracts/unstoppable/UnstoppableVault.sol", "--formatter", "unix" }
[TRACE Wed May 24 00:07:28 2023] ...t/null-ls.nvim/lua/null-ls/helpers/generator_factory.lua:204: error output: /mnt/c/Users/servicelaptop/projects/solidity/damn-vulnerable-defi/contracts/unstoppable/UnstoppableVault.sol:101:2: Line length must be no more than 120 but current length is 130. [Error/max-line-length]

1 problem

[TRACE Wed May 24 00:07:28 2023] ...t/null-ls.nvim/lua/null-ls/helpers/generator_factory.lua:205: output: nil
[WARN Wed May 24 00:07:28 2023] ...ack/packer/start/null-ls.nvim/lua/null-ls/generators.lua:94: failed to run generator: ...t/null-ls.nvim/lua/null-ls/helpers/generator_factory.lua:219: error in generator output: /mnt/c/Users/servicelaptop/projects/solidity/damn-vulnerable-defi/contracts/unstoppable/UnstoppableVault.sol:101:2: Line length must be no more than 120 but current length is 130. [Error/max-line-length]

1 problem

Help

No

Implementation Help

No response

Requirements

  • I have read and followed the instructions above and understand that my issue will be closed if I did not provide the required information.
@getarealcomputer getarealcomputer added the bug Something isn't working label May 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant