-
Notifications
You must be signed in to change notification settings - Fork 580
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
Add rust-clippy bear for rust support #50
Comments
@sudheesh001 does it support another output |
From @AbdealiJK on February 9, 2016 1:44 You may want to try http://atomlinter.github.io/ is a list of all available atom linters |
From @sudheesh001 on February 13, 2016 8:16 I think this can be parked for some time, |
@sudheesh001 can you give a link to the upstream bug? |
From @sudheesh001 on February 13, 2016 13:2 @sils1297 Its not a bug, its in their documentation itself https://github.com/Manishearth/rust-clippy#usage for the nightly only support |
Hi people,
Does this still count? I'd suppose it does. If so, would it be better to have an external Bear for this? (Is that already possible?) In any case, in the end, I would love to have it in the official Docker image (gitlab ci)... Which would of course enlarge the Docker image by a huge amount. |
Also: am I the best link between Rust and coala atm? Because I think that that link is very weak :D |
It does:
The json: Short example (unused function){
"message":"function is never used: `testssss`",
"code":null,
"level":"warning",
"spans":[
{
"file_name":"src/lib.rs",
"byte_start":0,
"byte_end":17,
"line_start":1,
"line_end":2,
"column_start":1,
"column_end":2,
"is_primary":true,
"text":[
{
"text":"fn testssss() {",
"highlight_start":1,
"highlight_end":16
},
{
"text":"}",
"highlight_start":1,
"highlight_end":2
}
],
"label":null,
"suggested_replacement":null,
"expansion":null
}
],
"children":[
{
"message":"#[warn(dead_code)] on by default",
"code":null,
"level":"note",
"spans":[
],
"children":[
],
"rendered":null
}
],
"rendered":null
} Longer example (Rust specific, with suggestion){
"message":"you seem to be trying to use match for destructuring a single pattern. Consider using `if let`",
"code":null,
"level":"warning",
"spans":[
{
"file_name":"src/lib.rs",
"byte_start":110,
"byte_end":193,
"line_start":8,
"line_end":11,
"column_start":9,
"column_end":10,
"is_primary":true,
"text":[
{
"text":" match x {",
"highlight_start":9,
"highlight_end":18
},
{
"text":" Some(y) => println!(\"{:?}\", y),",
"highlight_start":1,
"highlight_end":44
},
{
"text":" _ => ()",
"highlight_start":1,
"highlight_end":20
},
{
"text":" }",
"highlight_start":1,
"highlight_end":10
}
],
"label":null,
"suggested_replacement":null,
"expansion":null
}
],
"children":[
{
"message":"#[warn(single_match)] on by default",
"code":null,
"level":"note",
"spans":[
],
"children":[
],
"rendered":null
},
{
"message":"try this",
"code":null,
"level":"help",
"spans":[
{
"file_name":"src/lib.rs",
"byte_start":110,
"byte_end":193,
"line_start":8,
"line_end":11,
"column_start":9,
"column_end":10,
"is_primary":true,
"text":[
{
"text":" match x {",
"highlight_start":9,
"highlight_end":18
},
{
"text":" Some(y) => println!(\"{:?}\", y),",
"highlight_start":1,
"highlight_end":44
},
{
"text":" _ => ()",
"highlight_start":1,
"highlight_end":20
},
{
"text":" }",
"highlight_start":1,
"highlight_end":10
}
],
"label":null,
"suggested_replacement":"if let Some(y) = x { $ crate :: io :: _print ( format_args ! ( $ ( $ arg ) * ) ) }",
"expansion":null
}
],
"children":[
],
"rendered":" if let Some(y) = x { $ crate :: io :: _print ( format_args ! ( $ ( $ arg ) * ) ) }"
},
{
"message":"for further information visit https://github.com/Manishearth/rust-clippy/wiki#single_match",
"code":null,
"level":"help",
"spans":[
],
"children":[
],
"rendered":null
}
],
"rendered":null
} Please not that the suggested replacement in this case is bad code; if let Some(y) = x {
println!("{:?}", y)
} which is correctly set out in their README.md The command used:
breakdown:
Also note that the linter produces one JSON document per line of output. |
Useful for this issue: coala/coala#3652 |
Reassigning due to inactivity. |
Unassigning due to inactivity. |
I haven't pushed the changes yet, I was testing the rust clippy linter locally with regex. Sorry I got busy with other issue and exams, didn't got much time to work on this one. |
Assigned as a part of GSoC project "Improve Linter Bears". Do not reassign for the duration of the coding period unless the assignee releases the issue themselves. |
Feel free to ping me on Gitter for advice. |
From @sudheesh001 on February 8, 2016 19:19
Rust clippy is one of the linters for
rustc
the Rust programming language.https://github.com/Manishearth/rust-clippy#usage
It gives the linter warning in the following format
Copied from original issue: coala/coala#1324
The text was updated successfully, but these errors were encountered: