Skip to content
This repository has been archived by the owner on Aug 7, 2023. It is now read-only.

Support Cargo #5

Closed
wants to merge 4 commits into from
Closed

Support Cargo #5

wants to merge 4 commits into from

Conversation

liigo
Copy link

@liigo liigo commented Dec 19, 2014

This PR add the support of Cargo to Rust Linter. We try to find file Cargo.toml first, to decide which we should use it to lint the source file, cargo (if we found a Cargo.toml) or rustc (if not found). Both rustc and cargo's path are configurable.

We also need to improve Linter repo to complete this work. Currently, blocked by steelbrain/linter#290 and steelbrain/linter#304. These two PRs of mine are under reviewing.

Closes #4

update:
one limitation: when lint using cargo, you must save the editing file first. it is too expensive to copy the full cargo package to tmp directory, imo.

@gmist
Copy link
Member

gmist commented Dec 19, 2014

Thank you for your work, looks great.

@@ -3,7 +3,11 @@ module.exports =
executablePath:
type: 'string'
default: 'rustc'
description: 'Path to rust compiller.'
description: 'Path to rust compiler'
executablePath2:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably should use more understandable names of config variables, e.g. rustcPath and cargoPath

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gmist executablePath is used by upstream Linter. If i remove executablePath (and add rustcPath, cargoPath as you suggested) here, Linter will always add another executablePath in settings page, which looks weird. Maybe I'm wrong.

@liigo
Copy link
Author

liigo commented Mar 12, 2015

@dgriffen Fixed. Thank you!

@liigo liigo changed the title [WIP] Support Cargo Support Cargo Apr 9, 2015
@frewsxcv
Copy link

frewsxcv commented May 9, 2015

Any updates on this?

@bb010g
Copy link

bb010g commented May 21, 2015

@frewsxcv Blocked on steelbrain/linter#304.

gmist added a commit that referenced this pull request May 22, 2015
@liigo
Copy link
Author

liigo commented Jul 7, 2015

Closing, 34ae462 was committed, already works for cargo.

@liigo liigo closed this Jul 7, 2015
@sryze
Copy link

sryze commented Aug 25, 2015

Does it work for anybody on Windows? I'm using Cargo and currently getting an unresolved import error from the linter. I'm following this tutorial from the Rust book.

Edit:

Nevermind, I forgot to type the extern crate rand; part, it works okay now.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use Cargo instead of rustc
6 participants