From 62e4924f634570b4a31b63159244ddedbaf9f67e Mon Sep 17 00:00:00 2001 From: cathybaptista <161740096+cathybaptista@users.noreply.github.com> Date: Mon, 30 Dec 2024 18:32:19 -0500 Subject: [PATCH 01/13] cb: updating circleci and package.json to allow CI of md files. --- .circleci/config.yml | 19 +++++++++++++++++++ package.json | 4 +++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 80a4ab6dda..9bda9d63d3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -97,6 +97,22 @@ jobs: command: npm run proof - snyk/scan: organization: uswds + lint_and_format: + executor: my-executor + parallelism: 2 + steps: + - checkout + - attach_workspace: + at: ~/project + - run: + name: lint + command: npm run lint + - run: + name: format + command: npm run prettier:md + - run: + name: check + command: npm run format-check test_a11y_desktop: executor: my-executor parallelism: 2 @@ -144,3 +160,6 @@ workflows: - test_a11y_mobile: requires: - build + - lint-and-format-workflow: + jobs: + - lint-and-format diff --git a/package.json b/package.json index bbb008af53..a9173b7175 100644 --- a/package.json +++ b/package.json @@ -58,7 +58,9 @@ "pa11y-ci:sitemap": "pa11y-ci --sitemap http://localhost:4000/sitemap.xml --sitemap-exclude '/*.pdf|next|together/'", "pa11y-ci:sitemap-mobile": "pa11y-ci --config .pa11yci--mobile --sitemap http://localhost:4000/sitemap.xml --sitemap-exclude '/*.pdf|next|together/'", "pa11y-ci:sitemap-json": "pa11y-ci --json > pa11y-results.json --sitemap http://localhost:4000/sitemap.xml --sitemap-exclude '/*.pdf|next|together/'", - "prettier:scss": "npx prettier --write './css/**/*.scss'" + "prettier:scss": "npx prettier --write './css/**/*.scss'", + "prettier:md": "npx prettier --write './**/*.md'", + "prettier": "npm run prettier:md && npm run prettier:scss", }, "devDependencies": { "@18f/identity-stylelint-config": "^2.0.0", From c40c45587b11b35d5c622c41657ea05223ca77b8 Mon Sep 17 00:00:00 2001 From: cathybaptista <161740096+cathybaptista@users.noreply.github.com> Date: Mon, 30 Dec 2024 18:36:41 -0500 Subject: [PATCH 02/13] cb: remove workflow test. --- .circleci/config.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 9bda9d63d3..4f6dae21c3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -160,6 +160,3 @@ workflows: - test_a11y_mobile: requires: - build - - lint-and-format-workflow: - jobs: - - lint-and-format From 3502a784efd88ca7c03ab093fc8d2b1bdcfa2d74 Mon Sep 17 00:00:00 2001 From: cathybaptista <161740096+cathybaptista@users.noreply.github.com> Date: Mon, 30 Dec 2024 18:44:34 -0500 Subject: [PATCH 03/13] cb: remove workflow test. --- .circleci/config.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4f6dae21c3..a06432d853 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -110,9 +110,6 @@ jobs: - run: name: format command: npm run prettier:md - - run: - name: check - command: npm run format-check test_a11y_desktop: executor: my-executor parallelism: 2 From fc7f02465eae9fafca621f1bcdb6f83e573d9fac Mon Sep 17 00:00:00 2001 From: cathybaptista <161740096+cathybaptista@users.noreply.github.com> Date: Mon, 30 Dec 2024 18:47:27 -0500 Subject: [PATCH 04/13] cb: remove typo. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a9173b7175..03bc333f88 100644 --- a/package.json +++ b/package.json @@ -60,7 +60,7 @@ "pa11y-ci:sitemap-json": "pa11y-ci --json > pa11y-results.json --sitemap http://localhost:4000/sitemap.xml --sitemap-exclude '/*.pdf|next|together/'", "prettier:scss": "npx prettier --write './css/**/*.scss'", "prettier:md": "npx prettier --write './**/*.md'", - "prettier": "npm run prettier:md && npm run prettier:scss", + "prettier": "npm run prettier:md && npm run prettier:scss" }, "devDependencies": { "@18f/identity-stylelint-config": "^2.0.0", From d4d83d1449e1bdfc46d46874056ea3d5e24dbaa8 Mon Sep 17 00:00:00 2001 From: cathybaptista <161740096+cathybaptista@users.noreply.github.com> Date: Mon, 6 Jan 2025 17:26:16 -0500 Subject: [PATCH 05/13] cb: stop ignoring md files. --- .prettierignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.prettierignore b/.prettierignore index 670d8ffbe9..caa9862deb 100644 --- a/.prettierignore +++ b/.prettierignore @@ -18,5 +18,4 @@ Gemfile.lock .gitkeep *.csv *.html -*.md *.min.js \ No newline at end of file From e8d8afaca29353a1988ee3964e28fdf5c2591bc8 Mon Sep 17 00:00:00 2001 From: James Mejia Date: Tue, 7 Jan 2025 09:36:30 -0600 Subject: [PATCH 06/13] Add linting and formatting job to workflow --- .circleci/config.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a06432d853..485540d495 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -100,14 +100,15 @@ jobs: lint_and_format: executor: my-executor parallelism: 2 + name: Lint and format steps: - checkout - attach_workspace: at: ~/project - - run: + - run: name: lint command: npm run lint - - run: + - run: name: format command: npm run prettier:md test_a11y_desktop: @@ -151,6 +152,7 @@ workflows: - test_build: requires: - build + - lint_and_format - test_a11y_desktop: requires: - build From 92cb7c93c6ad09b8faf5bf5828bc172616847e4f Mon Sep 17 00:00:00 2001 From: James Mejia Date: Tue, 7 Jan 2025 09:38:39 -0600 Subject: [PATCH 07/13] Move linting and formatting in workflow Doesn't require a build --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 485540d495..4cc0b222ea 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -143,6 +143,7 @@ jobs: workflows: circle-uswds-site: jobs: + - lint_and_format - install_ruby_deps - install_node_deps - build: @@ -152,7 +153,6 @@ workflows: - test_build: requires: - build - - lint_and_format - test_a11y_desktop: requires: - build From 6c6ff757d254d91363aa8065d1ba9bd52dd7a961 Mon Sep 17 00:00:00 2001 From: James Mejia Date: Tue, 7 Jan 2025 09:40:24 -0600 Subject: [PATCH 08/13] Move erroneous job name --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4cc0b222ea..fe6bdeaf48 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -100,7 +100,6 @@ jobs: lint_and_format: executor: my-executor parallelism: 2 - name: Lint and format steps: - checkout - attach_workspace: @@ -143,7 +142,8 @@ jobs: workflows: circle-uswds-site: jobs: - - lint_and_format + - lint_and_format: + name: Lint and format - install_ruby_deps - install_node_deps - build: From 782ac1705b49af9579cbf2067a6cae0f1773db94 Mon Sep 17 00:00:00 2001 From: cathybaptista <161740096+cathybaptista@users.noreply.github.com> Date: Tue, 7 Jan 2025 13:48:12 -0500 Subject: [PATCH 09/13] cb: _uswds-theme-custom-styles.css prettier --- css/_uswds-theme-custom-styles.scss | 3 --- 1 file changed, 3 deletions(-) diff --git a/css/_uswds-theme-custom-styles.scss b/css/_uswds-theme-custom-styles.scss index 6ef34f8e9e..297626741b 100644 --- a/css/_uswds-theme-custom-styles.scss +++ b/css/_uswds-theme-custom-styles.scss @@ -9,7 +9,6 @@ @import "custom-styles/graphic-list"; @import "custom-styles/posts"; - // ======================================== // CUSTOM PROJECT SASS // ---------------------------------------- @@ -1570,8 +1569,6 @@ iframe { margin-bottom: units(4); } - - // Utilities CSS --------------------- // .page-content { From f52e9ebf6e6c88d4300803ab1d7406fccd5e66fe Mon Sep 17 00:00:00 2001 From: cathybaptista <161740096+cathybaptista@users.noreply.github.com> Date: Wed, 29 Jan 2025 16:25:38 -0500 Subject: [PATCH 10/13] cb: check prettier for md files and add scripts for md files. --- .circleci/config.yml | 3 +++ package.json | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index fe6bdeaf48..74da06619d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -69,6 +69,9 @@ jobs: - run: name: Build site assets command: npm run build:all-assets + - run: + name: Check formatting + command: npm run prettier:check - run: name: Build static site command: | diff --git a/package.json b/package.json index 03bc333f88..5dd90fa225 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "clean": "npx gulp cleanAssets", "crawl": "node config/crawl.js", "federalist": "npx gulp build", - "lint": "npx gulp lintJS lintSass && npm run prettier:scss", + "lint": "npx gulp lintJS lintSass && npm run prettier", "prestart": "npx gulp build", "proof": "bundle exec htmlproofer --enforce-https=false --allow-missing-href=true --only_4xx --ignore-status-codes 403,429 --swap-urls 'https\\://designsystem.digital.gov/:/' --ignore-files '/whats-new/updates/(2017|2018|2019|2020|2021)/,/documentation/code-guidelines/' ./_site", "proof:all": "bundle exec htmlproofer --enforce-https=false --allow-missing-href=true --ignore-status-codes 0 --swap-urls 'https\\://designsystem.digital.gov/:/' --ignore-files '/whats-new/updates/(2017|2018|2019|2020|2021)/,/documentation/code-guidelines/' ./_site", @@ -60,7 +60,8 @@ "pa11y-ci:sitemap-json": "pa11y-ci --json > pa11y-results.json --sitemap http://localhost:4000/sitemap.xml --sitemap-exclude '/*.pdf|next|together/'", "prettier:scss": "npx prettier --write './css/**/*.scss'", "prettier:md": "npx prettier --write './**/*.md'", - "prettier": "npm run prettier:md && npm run prettier:scss" + "prettier": "npm run prettier:md && npm run prettier:scss", + "prettier:check": "npx prettier -c ./packages/**/*.{scss,md}" }, "devDependencies": { "@18f/identity-stylelint-config": "^2.0.0", From 17a2882c9a6ba569fadd28f206a51951a086a272 Mon Sep 17 00:00:00 2001 From: cathybaptista <161740096+cathybaptista@users.noreply.github.com> Date: Wed, 29 Jan 2025 16:49:18 -0500 Subject: [PATCH 11/13] cb: remove extraneous job from file. --- .circleci/config.yml | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 74da06619d..87462d6cfd 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -100,19 +100,6 @@ jobs: command: npm run proof - snyk/scan: organization: uswds - lint_and_format: - executor: my-executor - parallelism: 2 - steps: - - checkout - - attach_workspace: - at: ~/project - - run: - name: lint - command: npm run lint - - run: - name: format - command: npm run prettier:md test_a11y_desktop: executor: my-executor parallelism: 2 @@ -145,8 +132,6 @@ jobs: workflows: circle-uswds-site: jobs: - - lint_and_format: - name: Lint and format - install_ruby_deps - install_node_deps - build: From ab7831ac261459996098dcc7bbe38b3b195b1f5c Mon Sep 17 00:00:00 2001 From: cathybaptista <161740096+cathybaptista@users.noreply.github.com> Date: Wed, 29 Jan 2025 17:15:26 -0500 Subject: [PATCH 12/13] cb: make sure prettier is running against the right directory for site. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5dd90fa225..c6de18ba92 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,7 @@ "prettier:scss": "npx prettier --write './css/**/*.scss'", "prettier:md": "npx prettier --write './**/*.md'", "prettier": "npm run prettier:md && npm run prettier:scss", - "prettier:check": "npx prettier -c ./packages/**/*.{scss,md}" + "prettier:check": "npx prettier -c ./**/*.{scss,md}" }, "devDependencies": { "@18f/identity-stylelint-config": "^2.0.0", From 89e0ace7c66cced29548351d2caa8a1db3ae196b Mon Sep 17 00:00:00 2001 From: cathybaptista <161740096+cathybaptista@users.noreply.github.com> Date: Fri, 31 Jan 2025 10:26:23 -0500 Subject: [PATCH 13/13] cb: add vendor/bundle to .prettierignore so that md files that are part of gems are excluded from prettier. --- .prettierignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.prettierignore b/.prettierignore index caa9862deb..a6fbfbda90 100644 --- a/.prettierignore +++ b/.prettierignore @@ -18,4 +18,5 @@ Gemfile.lock .gitkeep *.csv *.html -*.min.js \ No newline at end of file +*.min.js +vendor/bundle/ \ No newline at end of file