diff options
| author | Mario Reder <mreder1289@gmail.com> | 2020-02-14 15:25:03 +0100 |
|---|---|---|
| committer | Mario Reder <mreder1289@gmail.com> | 2020-02-26 14:07:07 +0100 |
| commit | 1e2fd9c92f8cd6e389525ca1a999fca4c90b5921 (patch) | |
| tree | aace341dbef4b15e37ddf260d6be857a11cca104 /install.ps1 | |
| parent | 7e8530b21ff355c9b52e07eb3ba25278746a6932 (diff) | |
feat: Add clippy lints
- adds a new 'clippy' category for exercises
- clippy exercises should throw no warnings
- install script now also installs clippy
is related to https://github.com/rust-lang/rust-clippy/issues/2604
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." |
