From ac8efbbed020b657b14e70610e2755016c7ce038 Mon Sep 17 00:00:00 2001 From: Patrick Nawracay Date: Fri, 30 Nov 2018 16:37:59 +0100 Subject: [PATCH] mgr/dashboard: Fix modified files only (frontend) Introduces a new npm command: `npm run fixmod` which, unlike `npm run fix`, only fixes modified files in the current git repository. This is faster than the comprehensive `npm run fix` solution and can hence be called more often with less disturbance. Signed-off-by: Patrick Nawracay --- src/pybind/mgr/dashboard/frontend/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pybind/mgr/dashboard/frontend/package.json b/src/pybind/mgr/dashboard/frontend/package.json index 481972229f7..b2fa350ea2c 100644 --- a/src/pybind/mgr/dashboard/frontend/package.json +++ b/src/pybind/mgr/dashboard/frontend/package.json @@ -18,6 +18,7 @@ "lint": "npm run lint:tslint && npm run lint:prettier && npm run lint:html", "fix:prettier": "prettier --write \"{src,e2e}/**/*.{ts,scss}\"", "fix:tslint": "npm run lint:tslint -- --fix", + "fixmod": "prettier --write $(git rev-parse --show-toplevel)/$(git status --porcelain | grep -E '^(\\sM|\\?\\?|A)' | sed -e 's/^...//' | grep -E '^(src|e2e).*\\.(ts|scss)$') 1>/dev/null 2>&1 && echo 'done' || echo 'no changes found'", "fix": "npm run fix:tslint; npm run fix:prettier" }, "private": true, -- 2.39.5