Git Product home page Git Product logo

Comments (16)

w0rp avatar w0rp commented on May 22, 2024 1

I think Clippy is supposed to be used as plugin for cargo check, which can be configured in a configuration file, so I'll close this. If anyone has anything they want to add for Clippy, open up a pull request.

from ale.

loyd avatar loyd commented on May 22, 2024 1

Ok, it's possible to use with adding clippy to projects directly.

But there is a problem with this approach: it requires

let g:ale_rust_cargo_include_features = 'clippy'

So, every project that do not use explicitly clippy as plugin, will fail checking with cargo check.

It seems more flexible to have a separate clippy linter, am I right?

from ale.

euclio avatar euclio commented on May 22, 2024

It would be nice to use --error-format=json for this instead of trying to parse the output.

from ale.

w0rp avatar w0rp commented on May 22, 2024

That could be done. We'd have to first change a few things to let you enable accepting JSON output. We'd have to make sure it would also work in NeoVim. That could be an issue.

from ale.

hauleth avatar hauleth commented on May 22, 2024

@w0rp NeoVim has stricter JSON parser, but IIRC it doesn't matter as Rust always output valid JSON.

from ale.

neersighted avatar neersighted commented on May 22, 2024

Per neovim/neovim#4131 the jsondecode() function exists in both Vim 8 and NeoVim.

from ale.

w0rp avatar w0rp commented on May 22, 2024

I think we'd probably have to take the raw JSON text in NeoVim, and then decode the data ourselves with jsondecode(), but in Vim 8 we can make it pass on JSON data instead. It will be a bit of work, but it's possible. I'd open up another issue for it. I'd be in favour of first parsing text output for the warnings and errors, if that's not too much trouble, and then later work with the JSON data once that works.

from ale.

neersighted avatar neersighted commented on May 22, 2024

I would just take in text and jsondecode() it for now (in the handler) in vim and neovim, and later decide if we want to use Vim 8's system() json support.

from ale.

w0rp avatar w0rp commented on May 22, 2024

Yeah, that could be one step along the way. The advantage of using Vim 8's built in JSON encoding and decoding in the job itself is that it can run the decoding asynchronously, as to not slow down editing files.

from ale.

euclio avatar euclio commented on May 22, 2024

There is also the question on whether to use -Z parse-only vs. -Z no-trans.

from ale.

hauleth avatar hauleth commented on May 22, 2024

@euclio there is bigger problem: all -Z options will soon stop working on stable rust-lang/rust#31847

from ale.

hauleth avatar hauleth commented on May 22, 2024

Also I would vote for -Z parse-only as -Z no-trans forces us to build whole project, otherwise we will get a lot of "module not found"-kind of errors (as it also try to resolve dependencies).

from ale.

euclio avatar euclio commented on May 22, 2024

Seems like a moot point now that rust-lang/cargo#3296 is merged. However, there's still the trickiness of figuring out when to send --bin, --lib, etc.

from ale.

EinfachToll avatar EinfachToll commented on May 22, 2024

Just wanted to inform you that I made an integration for rustc and cargo as linters (without noticing this issue here). See #230. I didn't use cargo check, because it's at the moment only included in nightly and AFAIK won't be included before rust 1.16 and because it has some bugs.

from ale.

w0rp avatar w0rp commented on May 22, 2024

The pull request looks like it could work, but not as you type. It might not be possible for some linters to check for problems as you type, but only on enter or on save. We could consider disabling particular linters with a new option for checking for changes while you type.

from ale.

loyd avatar loyd commented on May 22, 2024

@w0rp, how can I use clippy as a plugin for cargo-check?

from ale.

Related Issues (20)

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.