Skip to content

Commit

Permalink
chore: add formatting for .sh scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
aleclarson committed Jul 8, 2024
1 parent 5c93b87 commit b899696
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .prettierrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
"bracketSpacing": true,
"singleQuote": true,
"semi": false,
"trailingComma": "all"
"trailingComma": "all",
"plugins": ["prettier-plugin-sh"]
}
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,8 @@
"[typescript]": {
"editor.defaultFormatter": "biomejs.biome",
"rewrap.wrappingColumn": 70
},
"[shellscript]": {
"rewrap.wrappingColumn": 70
}
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"@vitest/coverage-v8": "1.6.0",
"concurrently": "^8.2.2",
"prettier": "^3.3.2",
"prettier-plugin-sh": "^0.14.0",
"tsup": "^8.1.0",
"typescript": "^5.5.2",
"vitest": "1.6.0"
Expand Down
4 changes: 2 additions & 2 deletions scripts/format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ UNCOMMITTED_CHANGES=$(git status --porcelain -uno)

# 2. Update the formatting.
pnpm biome check --fix --unsafe
pnpm prettier --write README.md docs/**/*
pnpm prettier --write README.md docs/**/* scripts/**/*

# 3. Commit if there were no uncommitted changes, but there are now.
if [ -z "$UNCOMMITTED_CHANGES" ] && [ -n "$(git status --porcelain -uno)" ]; then
git add -u
git commit -m "chore: format"
fi
fi
2 changes: 1 addition & 1 deletion scripts/test-single.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pnpm vitest $1 --coverage --coverage.include "src/*/$1*"
pnpm vitest $1 --coverage --coverage.include "src/*/$1*"

0 comments on commit b899696

Please sign in to comment.