-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Idea: FIXME lints #2360
Comments
When I wrote of my original suggestion, I was thinking of it being rolled together with the RFC I suggested it on, based on time rather than availability or stability of features. But since it's been split off, I'll go along with it. That said, giving it a fresh look, the most obvious problem would be to get people on board the new format, or to make the tools smart enough to figure things out for the end user. This might need some more thought than I first imagined. |
If clippy learned Git, you could find when the FIXME was added and compare that to current time. Which means the developer does not need to use a new format. Or perhaps this is better done in a different linter. |
Perhaps adding a fixme attribute to the compiler itself is a good idea? |
@shaleh That seems like an effective idea, but I'd prefer not to have to jump between tools, it is better to just have to execute one command for all lints in my opinion. Also, not all projects use git =) |
I used Git as an example. A similar solution would work with other revision systems. Teaching clippy about revision control is not that hard. |
I think this is out of scope for Clippy, at least the integration with VCSes |
I can understand that. |
This might be somewhat controversial (mainly because this could be seen as out of scope for Clippy), but apart from a FIXME attribute, I'd actually love a lint that detects Is this something that would be accepted? |
I am a fan of those @theduke. Emacs marks FIXME, TODO, and XXX in bold, bright colors for me. |
Yes, this could be implemented as a restriction lint. |
It's worth noting that only doc comments are accessible to Clippy. |
@phansch that sadly means the idea is void, since most |
Something similar could be achieved using rustfmt's report_fixme. You should be able to set it to "Unnumbered", to force people to create issues for FIXMEs, then filter your project's issues by date. The question is how to get more projects to discover and use it.
@phansch Then how does rustfmt get access to comments? It seems to just use libsyntax, |
IIUC, I think we can close this, since rustfmt implements this already? |
rustfmt has removed Now that Span has access to the source text "including spaces and comments", is this a viable thing to build into clippy? |
The span thing has nothing to do with clippy capabilities. We can get the source text already. But I'm not sure if we should be relexing everything to get the comments. It feels a bit weird in clippy, I'm not convinced this is the right place for it. (the original proposal is kinda doable) |
Makes sense, thanks :) So if in a hypothetical future |
syn also has nothing to do with clippy's capabilities. we are not a proc macro, we do not use the user facing infra for operating on rust code, we use that of the compiler |
I am unsure of whether this is the right place for this issue.
The idea was originally brought up at: rust-lang/rfcs#2281 (comment)
One could perhaps write:
#[cfg_attr(feature = "cargo-clippy", FIXME("2018-01-15", "<description of what to fix>"))]
The text was updated successfully, but these errors were encountered: