chore(pwsh): add .ps1 linting to ci/cd

This commit is contained in:
AJ ONeal
2023-10-18 01:21:46 -06:00
parent 3d51b8373a
commit 589edd6940
3 changed files with 11 additions and 2 deletions

View File

@@ -22,6 +22,7 @@ jobs:
run: |
sh ./_scripts/install-ci-deps
echo "${HOME}/.local/bin" >> $GITHUB_PATH
echo "${HOME}/.local/opt/pwsh" >> $GITHUB_PATH
- run: shfmt --version
- run: shellcheck -V
- run: node --version

View File

@@ -7,3 +7,9 @@ curl -fsS https://webi.sh/shfmt@3.7 | sh
# Install 'shellcheck v0.9.x'
curl -fsS https://webi.sh/shellcheck@0.9 | sh
# Install 'pwsh (PowerShell Core) v7.x'
curl -fsS https://webi.sh/pwsh@7 | sh
# shellcheck disable=SC1090
. ~/.config/envman/PATH.env
pwsh -Command "Install-Module -Name PSScriptAnalyzer -Scope CurrentUser -AllowClobber"

View File

@@ -5,14 +5,16 @@
"description": "webinstall script repository",
"main": "_webi/",
"scripts": {
"fmt": "npm run prettier && npm run shfmt",
"lint": "npm run shellcheck && npm run jshint",
"fmt": "npm run prettier && npm run shfmt && npm run pwsh-fmt",
"lint": "npm run shellcheck && npm run jshint && npm run pwsh-lint",
"prepare": "npm run tooling-init && npm run git-hooks-init",
"test": "node _webi/test.js ./node/",
"----": "------------------------------------",
"git-hooks-init": "node ./_scripts/git-hooks-init.js",
"jshint": "npx -p jshint@2.x -- jshint -c ./.jshintrc --exclude 'node_modules/**/*' */*.js */*/*.js",
"prettier": "npx -p prettier@3.x -- prettier -w '**/*.{js,md,html}'",
"pwsh-fmt": "pwsh ./_scripts/pwsh-fmt.ps1",
"pwsh-lint": "pwsh ./_scripts/pwsh-lint.ps1",
"shellcheck": "shellcheck -s sh -S style --exclude=SC2154,SC2034 */*.sh",
"shfmt": "shfmt -w -i 4 -sr -ci -s ./",
"tooling-init": "node ./_scripts/tooling-init.js"