Don't use cargo +TOOLCHAIN
shortcut and move --cfg bevy_lint
logic
#264
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The
bevy_lint
executable currently runs:This broke for someone on Discord, however, because the
+TOOLCHAIN
syntax requires Rustup'scargo
proxy, which may not be in theirPATH
. This PR fixes this by instead callingrustup run
directly:Both versions do the exact same thing, and both will fail if you do not have Rustup installed, but the latter version should work in a few more scenarios. (And it makes the error message clearer, since it mentions Rustup.)
Furthermore, this PR moves the
--cfg bevy_lint
logic from thebevy_lint
executable tobevy_lint_driver
. While the linter should still behave the same, this means programs will still be able to detect the linter even if the use calledbevy_lint_driver
directly instead ofbevy_lint
.1Footnotes
For example, our UI tests call
bevy_lint_driver
directly. This means we can now technically use#[cfg(bevy_lint)]
in our UI tests, even if it doesn't make sense to do so. ↩