-
-
Notifications
You must be signed in to change notification settings - Fork 209
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for dynamic commands #18
Comments
Yes, sounds good to me 👍 |
#26 Allows the whole |
Closing this for now - I think #26 should be sufficient. |
Basic setup from [^1]. Basic bundle integration found in [^3]. Open issues: - Linting fails when rubocop is not available in the bundle. One can provide a function for the linter[^2] and should be able to use either the bundled rubocop, or a global rubocop as fallback. - When rubocop itself fails (with error code 2), like when it sees an unrecognized cop in .rubocop.yml, this is unnoticed during editing. - Make rubocop run on BufReadPost, InsertLeave, and TextChanged events. This is mentioned in mfussenegger/nvim-lint#336 [^1]: dietrichm/dotfiles#138 [^2]: mfussenegger/nvim-lint#18 [^3]: https://github.com/pfeiferj/dotfiles/blob/9fe44801e52590610d2090f2c03df6fbb31b6f57/dot_config/nvim/lua/plugins/lint.lua
One drawback of only allowing the whole For some linters, that involves copy/pasting quite a bit of custom logic from this repo, making our own configs more complicated than is ideal making it hard to tell which logic represents our change vs. the default values. |
Some linters may need a dynamic command. For example, RuboCop (https://rubocop.org/) is a popular Ruby linter. Projects managing their Ruby dependencies using Bundler (https://bundler.io/) would have to run RuboCop using
bundle exec rubocop ...
. Projects not using Bundler in turn have to use justrubocop
.Looking at the code of nvim-lint, there's only support for a static linter command (i.e. a string). This makes it impossible (I think?) to change the command to run based on the presence of a certain file (or some other condition).
Would it be possible to extend nvim-lint so the
cmd
field can be a function? In that case it would have to return the command to run. Argument wise I think it would only need the buffer number, as that should be enough to derive all the needed information (e.g. the directory of the buffer file).The text was updated successfully, but these errors were encountered: