Comments (16)
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.
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.
It would be nice to use --error-format=json
for this instead of trying to parse the output.
from ale.
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.
@w0rp NeoVim has stricter JSON parser, but IIRC it doesn't matter as Rust always output valid JSON.
from ale.
Per neovim/neovim#4131 the jsondecode()
function exists in both Vim 8 and NeoVim.
from ale.
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.
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.
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.
There is also the question on whether to use -Z parse-only
vs. -Z no-trans
.
from ale.
@euclio there is bigger problem: all -Z
options will soon stop working on stable rust-lang/rust#31847
from ale.
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.
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.
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.
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.
@w0rp, how can I use clippy as a plugin for cargo-check
?
from ale.
Related Issues (20)
- Statusline info cache doesn't refresh correctly with integrating with third-party sources like coc.nvim HOT 1
- Support hurlfmt as fixer and linter
- Add support for include-what-you-use
- Add support for basedpyright
- rust ALEGoToDefinition does not trigger any action HOT 1
- ALE linting .tsx as .ts files when using Biome
- [Biome] Linter not usable
- Should/could ALE pass --no-fix argument to ruff when linting (to override project configuration)? HOT 5
- ALEHover text not appearing in floating preview HOT 1
- Cannot use ALE in MacVim when the file is opened via the right-click context menu or the File > Open dialog in MacVim HOT 1
- error loading shared lib: libicui18n.so.73 HOT 1
- json linting with jq doesn't report errors correctly
- On Windows 11, shell=pwsh/powershell continues breaking ALE lint HOT 1
- `write-good` plugin need make separate files that only have text
- cspell option “-c config.yaml” not work
- `sqlfluff` does not work in Neovim, throws an error when trying to lint an opened file HOT 1
- Signs cannot be customized HOT 4
- ALEFix with clangtidy not updating the buffer
- clang++ command not getting correct include paths
- error highlights entire function
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ale.