feat(formatting): add prettier-plugin-sh

This commit is contained in:
Julien Neuhart
2025-03-02 18:04:21 +01:00
parent 536d3ee70d
commit 820b914291
10 changed files with 144 additions and 88 deletions

View File

@@ -16,7 +16,7 @@ dry_run=""
while [[ $# -gt 0 ]]; do while [[ $# -gt 0 ]]; do
case $1 in case $1 in
--version) --version)
version="${2//v}" version="${2//v/}"
shift 2 shift 2
;; ;;
--platform) --platform)

View File

@@ -19,7 +19,7 @@ while [[ $# -gt 0 ]]; do
shift 2 shift 2
;; ;;
--snapshot-version) --snapshot-version)
snapshot_version="${2//v}" snapshot_version="${2//v/}"
shift 2 shift 2
;; ;;
--dry-run) --dry-run)

View File

@@ -104,6 +104,5 @@ run_cmd() {
fi fi
done done
echo "✅ Done!" echo "✅ Done!"
exit 0 exit 0

View File

@@ -0,0 +1 @@
build

View File

@@ -1,3 +1,3 @@
{ {
"plugins": ["prettier-plugin-gherkin"] "plugins": ["prettier-plugin-gherkin", "prettier-plugin-sh"]
} }

View File

@@ -188,19 +188,23 @@ tests-integration: ## Run integration tests
go test -tags=integration -v github.com/gotenberg/gotenberg/v8/test/integration go test -tags=integration -v github.com/gotenberg/gotenberg/v8/test/integration
.PHONY: lint .PHONY: lint
lint: ## Lint the code. lint: ## Lint codebase.
#golangci-lint run #golangci-lint run
npx prettier --check . npx prettier --check .
# go install mvdan.cc/gofumpt@latest # go install mvdan.cc/gofumpt@latest
# go install github.com/daixiang0/gci@latest # go install github.com/daixiang0/gci@latest
.PHONY: fmt .PHONY: fmt
fmt: ## Format the code and "optimize" the dependencies fmt: ## Format codebase and "optimize" the dependencies
gofumpt -l -w . gofumpt -l -w .
gci write -s standard -s default -s "prefix(github.com/gotenberg/gotenberg/v8)" --skip-generated --skip-vendor --custom-order . gci write -s standard -s default -s "prefix(github.com/gotenberg/gotenberg/v8)" --skip-generated --skip-vendor --custom-order .
npx prettier --write . npx prettier --write .
go mod tidy go mod tidy
.PHONY: todo
todo: ## Find TODOs in codebase.
golangci-lint run --no-config --disable-all --enable godox
# go install golang.org/x/tools/cmd/godoc@latest # go install golang.org/x/tools/cmd/godoc@latest
.PHONY: godoc .PHONY: godoc
godoc: ## Run a webserver with Gotenberg godoc godoc: ## Run a webserver with Gotenberg godoc

53
package-lock.json generated
View File

@@ -6,7 +6,8 @@
"": { "": {
"devDependencies": { "devDependencies": {
"prettier": "3.5.2", "prettier": "3.5.2",
"prettier-plugin-gherkin": "^3.1.1" "prettier-plugin-gherkin": "^3.1.1",
"prettier-plugin-sh": "^0.15.0"
} }
}, },
"node_modules/@cucumber/gherkin": { "node_modules/@cucumber/gherkin": {
@@ -76,6 +77,13 @@
"dev": true, "dev": true,
"license": "MIT" "license": "MIT"
}, },
"node_modules/mvdan-sh": {
"version": "0.10.1",
"resolved": "https://registry.npmjs.org/mvdan-sh/-/mvdan-sh-0.10.1.tgz",
"integrity": "sha512-kMbrH0EObaKmK3nVRKUIIya1dpASHIEusM13S4V1ViHFuxuNxCo+arxoa6j/dbV22YBGjl7UKJm9QQKJ2Crzhg==",
"dev": true,
"license": "BSD-3-Clause"
},
"node_modules/prettier": { "node_modules/prettier": {
"version": "3.5.2", "version": "3.5.2",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.5.2.tgz", "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.5.2.tgz",
@@ -104,6 +112,26 @@
"prettier": "^3.0.0" "prettier": "^3.0.0"
} }
}, },
"node_modules/prettier-plugin-sh": {
"version": "0.15.0",
"resolved": "https://registry.npmjs.org/prettier-plugin-sh/-/prettier-plugin-sh-0.15.0.tgz",
"integrity": "sha512-U0PikJr/yr2bzzARl43qI0mApBj0C1xdAfA04AZa6LnvIKawXHhuy2fFo6LNA7weRzGlAiNbaEFfKMFo0nZr/A==",
"dev": true,
"license": "MIT",
"dependencies": {
"mvdan-sh": "^0.10.1",
"sh-syntax": "^0.4.2"
},
"engines": {
"node": ">=16.0.0"
},
"funding": {
"url": "https://opencollective.com/unts"
},
"peerDependencies": {
"prettier": "^3.0.3"
}
},
"node_modules/reflect-metadata": { "node_modules/reflect-metadata": {
"version": "0.1.13", "version": "0.1.13",
"resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.1.13.tgz", "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.1.13.tgz",
@@ -111,6 +139,29 @@
"dev": true, "dev": true,
"license": "Apache-2.0" "license": "Apache-2.0"
}, },
"node_modules/sh-syntax": {
"version": "0.4.2",
"resolved": "https://registry.npmjs.org/sh-syntax/-/sh-syntax-0.4.2.tgz",
"integrity": "sha512-/l2UZ5fhGZLVZa16XQM9/Vq/hezGGbdHeVEA01uWjOL1+7Ek/gt6FquW0iKKws4a9AYPYvlz6RyVvjh3JxOteg==",
"dev": true,
"license": "MIT",
"dependencies": {
"tslib": "^2.6.2"
},
"engines": {
"node": ">=16.0.0"
},
"funding": {
"url": "https://opencollective.com/unts"
}
},
"node_modules/tslib": {
"version": "2.8.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz",
"integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==",
"dev": true,
"license": "0BSD"
},
"node_modules/uuid": { "node_modules/uuid": {
"version": "9.0.1", "version": "9.0.1",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz",

View File

@@ -1,6 +1,7 @@
{ {
"devDependencies": { "devDependencies": {
"prettier": "3.5.2", "prettier": "3.5.2",
"prettier-plugin-gherkin": "^3.1.1" "prettier-plugin-gherkin": "^3.1.1",
"prettier-plugin-sh": "^0.15.0"
} }
} }