diff options
| author | flip1995 <philipp.krones@embecosm.com> | 2021-07-01 18:17:38 +0200 |
|---|---|---|
| committer | flip1995 <philipp.krones@embecosm.com> | 2021-07-01 18:17:38 +0200 |
| commit | 1a385b80dca128bfc5c9fc4cfb0bc8e9f5a3ef07 (patch) | |
| tree | 79a5fb72746db0fe2833c57dc197c2dd85a77c47 /src/tools/clippy/util/etc | |
| parent | 3cb1c1134050c059a15d9ca7a00d4dd89111a373 (diff) | |
| parent | 61eb38aeda6cb54b93b872bf503d70084c4d621c (diff) | |
Merge commit '61eb38aeda6cb54b93b872bf503d70084c4d621c' into clippyup
Diffstat (limited to 'src/tools/clippy/util/etc')
| -rwxr-xr-x | src/tools/clippy/util/etc/pre-commit.sh | 21 | ||||
| -rw-r--r-- | src/tools/clippy/util/etc/vscode-tasks.json | 57 |
2 files changed, 78 insertions, 0 deletions
diff --git a/src/tools/clippy/util/etc/pre-commit.sh b/src/tools/clippy/util/etc/pre-commit.sh new file mode 100755 index 00000000000..528f8953b25 --- /dev/null +++ b/src/tools/clippy/util/etc/pre-commit.sh @@ -0,0 +1,21 @@ +#!/bin/sh + +# hide output +set -e + +# Update lints +cargo dev update_lints +git add clippy_lints/src/lib.rs + +# Formatting: +# Git will not automatically add the formatted code to the staged changes once +# fmt was executed. This collects all staged files rs files that are currently staged. +# They will later be added back. +# +# This was proudly stolen and adjusted from here: +# https://medium.com/@harshitbangar/automatic-code-formatting-with-git-66c3c5c26798 +files=$( (git diff --cached --name-only --diff-filter=ACMR | grep -Ei "\.rs$") || true) +if [ ! -z "${files}" ]; then + cargo dev fmt + git add $(echo "$files" | paste -s -d " " -) +fi diff --git a/src/tools/clippy/util/etc/vscode-tasks.json b/src/tools/clippy/util/etc/vscode-tasks.json new file mode 100644 index 00000000000..a4bb26b9f90 --- /dev/null +++ b/src/tools/clippy/util/etc/vscode-tasks.json @@ -0,0 +1,57 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "cargo check", + "type": "shell", + "command": "cargo check", + "problemMatcher": [], + "group": { + "kind": "build", + "isDefault": true, + }, + }, + { + "label": "cargo dev fmt", + "type": "shell", + "command": "cargo dev fmt", + "problemMatcher": [], + "group": "none", + }, + { + "label": "cargo uitest", + "type": "shell", + "command": "cargo uitest", + "options": { + "env": { + "RUST_BACKTRACE": "1", + // This task will usually execute all UI tests inside `tests/ui` you can + // optionally uncomment the line below and only run a specific test. + // + // See: https://github.com/rust-lang/rust-clippy/blob/master/doc/adding_lints.md#testing + // + // "TESTNAME": "<TODO>", + }, + }, + "problemMatcher": [], + "group": { + "kind": "test", + "isDefault": true, + } + }, + { + "label": "cargo test", + "type": "shell", + "command": "cargo test", + "problemMatcher": [], + "group": "test", + }, + { + "label": "cargo dev bless", + "type": "shell", + "command": "cargo dev bless", + "problemMatcher": [], + "group": "none", + }, + ], +} |
