diff options
| author | bors <bors@rust-lang.org> | 2020-02-26 14:22:51 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2020-02-26 14:22:51 +0000 |
| commit | a03d9655a85351557c466f144a76d6bebfa27256 (patch) | |
| tree | aace341dbef4b15e37ddf260d6be857a11cca104 /install.ps1 | |
| parent | 7e8530b21ff355c9b52e07eb3ba25278746a6932 (diff) | |
| parent | 1e2fd9c92f8cd6e389525ca1a999fca4c90b5921 (diff) | |
Auto merge of #269 - Tarnadas:master, r=fmoko
feat: Add clippy lints
This is a feature PR which adds the possiblity to create clippy exercises.
Clippy has many awesome linting rules, which can give a deeper understanding about the Rust programming language, therefor I made this PR.
Diffstat (limited to 'install.ps1')
| -rw-r--r-- | install.ps1 | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/install.ps1 b/install.ps1 index f644610..04ea4a0 100644 --- a/install.ps1 +++ b/install.ps1 @@ -72,14 +72,19 @@ if (!($LASTEXITCODE -eq 0)) { # but anyone running pwsh 5 will have to pass the argument. $version = Invoke-WebRequest -UseBasicParsing https://api.github.com/repos/rust-lang/rustlings/releases/latest ` | ConvertFrom-Json | Select-Object -ExpandProperty tag_name -Write-Host "Checking out version $version..." -Set-Location $path -git checkout -q tags/$version Write-Host "Installing the 'rustlings' executable..." -cargo install --force --path . +cargo install --force --git https://github.com/rust-lang/rustlings --tag $version if (!(Get-Command rustlings -ErrorAction SilentlyContinue)) { Write-Host "WARNING: Please check that you have '~/.cargo/bin' in your PATH environment variable!" } +# Checking whether Clippy is installed. +# Due to a bug in Cargo, this must be done with Rustup: https://github.com/rust-lang/rustup/issues/1514 +$clippy = (rustup component list | Select-String "clippy" | Select-String "installed") | Out-String +if (!$clippy) { + Write-Host "Installing the 'cargo-clippy' executable..." + rustup component add clippy +} + Write-Host "All done! Run 'rustlings' to get started." |
