Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

USWDS-Site - Prettier should run on .md files. #3037

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: This check formatting works, but the build job doesn't seem like the most appropriate place because:

  • The build doesn't rely on formatting being correct
  • If there are formatting errors, we won't know until it's deep into the job
  • We don't know what exactly is being checked

You can see in the workflow that it takes over 2 minutes to check for formatting.

Consider separating it and running before build.

- run:
name: Build static site
command: |
Expand Down
4 changes: 2 additions & 2 deletions .prettierignore
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: Please make sure to insert an empty line at the end of files. You can enable this setting by default in VS Code.

capture -Code-2025-02-04@2x

Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ Gemfile.lock
.gitkeep
*.csv
*.html
*.md
*.min.js
*.min.js
vendor/bundle/
13 changes: 8 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -55,10 +55,13 @@
"test:stop": "pkill -f jekyll",
"start-detached": "bundle exec jekyll serve --detach --host=localhost",
"startup": "npm install && bundle install && npm run build:uswds && npm run build:all-assets",
"pa11y-ci:sitemap": "pa11y-ci --sitemap http://localhost:4000/sitemap.xml --sitemap-exclude '/*.pdf|next/'",
"pa11y-ci:sitemap-mobile": "pa11y-ci --config .pa11yci--mobile --sitemap http://localhost:4000/sitemap.xml --sitemap-exclude '/*.pdf|next/'",
"pa11y-ci:sitemap-json": "pa11y-ci --json > pa11y-results.json --sitemap http://localhost:4000/sitemap.xml --sitemap-exclude '/*.pdf|next/'",
"prettier:scss": "npx prettier --write './css/**/*.scss'"
"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:md": "npx prettier --write './**/*.md'",
"prettier": "npm run prettier:md && npm run prettier:scss",
"prettier:check": "npx prettier -c ./**/*.{scss,md}"
},
"devDependencies": {
"@18f/identity-stylelint-config": "^2.0.0",
Expand Down