GithubHelp home page GithubHelp logo

yeyee2901 / nvim-buf-lint Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 237 KB

Neovim plugin to interface with https://buf.build/product/cli/ .

License: Other

Lua 100.00%
editor editor-plugin grpc neovim neovim-plugin protobuf

nvim-buf-lint's Introduction

Nvim Buf Lint

img

Goals ๐Ÿƒ

  • Are you a developer that's actively working with Protobuf?
  • Are you using buf cli to simplify your workflow with Protobuf?
  • AND, are you a neovim user?

Then, this plugin is a perfect addition to your neovim experience when dealing with Google's Protobuf! This plugin, while simple, provides a way for buf cli to interact with vim.diagnostic framework, enriching your development experience in dealing with Protobuf by providing linting error messages!.

The Idea Behind This Plugin

  • I just noticed that buf lint has an option --error-format which can spit out JSON formatted linting errors! ๐Ÿค”
  • I thought to myself, well this can work well with Neovim diagnostic framework then. And I immediately started prototyping this plugin, and completed a simple linter integration on that day.
  • If there are any suggestions, you're welcome to put up issues / pull requests! I'm really new to neovim plugin development at the moment, so I will appreciate any help you guys give to by contributing to this project. ๐Ÿ™‡

Installation ๐Ÿ“ฆ

  • Requires Neovim > 0.6.0 (which was the time vim.diagnostic framework was introduced)
  • Packer
require("packer").startup(function(use)
    use({ "yeyee2901/nvim-buf-lint" })
end)

Setup ๐Ÿ”ง

require("nvim-buf-lint").init()

You may also pass a table of options.

require("nvim-buf-lint").init{
    -- some options ...
}

The init() function accepts these option parameters:

  • exe_path : The full path to buf executable (defaults to "buf", or in otherwords system wide installation taken from your $PATH)

Usage ๐Ÿ”Ž

  • Go to any of your Protobuf project.
  • Open neovim from the root directory of the project (the root directory is the directory containing buf.yaml file)
  • Go to any of your proto files
  • Run lua require("nvim-buf-lint").lint() or you can run the provided user command :BufLintCurrentBuffer

Current Limitations

  • The linter will only run on command invocation

Roadmap ๐Ÿš€

  • โœ… Simple linting
  • ๏˜ฐ Toggle lint on save option
  • ๏˜ฐ Integrate with quickfix
  • ๏˜ฐ Inject diagnostic error message in all buffer (?)
  • ๏˜ฐ Integrate with telescope.nvim !

nvim-buf-lint's People

Contributors

yeyee2901 avatar

Stargazers

Yuta Katayama avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.