From: Patrick Nawracay Date: Fri, 30 Nov 2018 15:37:59 +0000 (+0100) Subject: mgr/dashboard: Fix modified files only (frontend) X-Git-Tag: v14.1.0~191^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ac8efbbed020b657b14e70610e2755016c7ce038;p=ceph.git 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 --- diff --git a/src/pybind/mgr/dashboard/frontend/package.json b/src/pybind/mgr/dashboard/frontend/package.json index 481972229f7d..b2fa350ea2c3 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,