From 1e2fd9c92f8cd6e389525ca1a999fca4c90b5921 Mon Sep 17 00:00:00 2001 From: Mario Reder Date: Fri, 14 Feb 2020 15:25:03 +0100 Subject: 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 --- install.ps1 | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'install.ps1') 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." -- cgit v1.2.3