From bf86719412e71485c88a4f516514355db3fbaa67 Mon Sep 17 00:00:00 2001 From: Jake McDermott Date: Mon, 1 Jul 2019 14:16:17 -0400 Subject: [PATCH 1/2] add a note about running the formatter --- awx/ui_next/CONTRIBUTING.md | 1 + 1 file changed, 1 insertion(+) diff --git a/awx/ui_next/CONTRIBUTING.md b/awx/ui_next/CONTRIBUTING.md index b9c39d9791..b1bf60cf69 100644 --- a/awx/ui_next/CONTRIBUTING.md +++ b/awx/ui_next/CONTRIBUTING.md @@ -29,6 +29,7 @@ Have questions about this document or anything not covered here? Feel free to re - All code submissions are done through pull requests against the `devel` branch. - If collaborating with someone else on the same branch, please use `--force-with-lease` instead of `--force` when pushing up code. This will prevent you from accidentally overwriting commits pushed by someone else. For more information, see https://git-scm.com/docs/git-push#git-push---force-with-leaseltrefnamegt +- We use a [code formatter](https://prettier.io/). Before adding a new commit or opening a PR, please apply the formatter using `npm run prettier` ## Setting up your development environment From 945d9156a6076d6708c7eec532dff608200ee6b5 Mon Sep 17 00:00:00 2001 From: Jake McDermott Date: Mon, 1 Jul 2019 14:25:08 -0400 Subject: [PATCH 2/2] do formatting check with ci linter --- Makefile | 1 + awx/ui_next/package.json | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 8ad5c8d881..495549741c 100644 --- a/Makefile +++ b/Makefile @@ -524,6 +524,7 @@ jshint: $(UI_DEPS_FLAG_FILE) ui-next-lint: $(NPM_BIN) --prefix awx/ui_next install $(NPM_BIN) run --prefix awx/ui_next lint + $(NPM_BIN) run --prefix awx/ui_next prettier-check ui-next-test: $(NPM_BIN) --prefix awx/ui_next install diff --git a/awx/ui_next/package.json b/awx/ui_next/package.json index 5ed872d98f..aab41746ae 100644 --- a/awx/ui_next/package.json +++ b/awx/ui_next/package.json @@ -11,7 +11,8 @@ "add-locale": "lingui add-locale", "extract-strings": "lingui extract", "compile-strings": "lingui compile", - "prettier": "prettier --write \"src/**/*.{js,jsx,scss}\"" + "prettier": "prettier --write \"src/**/*.{js,jsx,scss}\"", + "prettier-check": "prettier --check \"src/**/*.{js,jsx,scss}\"" }, "keywords": [], "author": "",