@@ -4,13 +4,17 @@ description: This file defines the tasks for code formatting across various lang
44
55vars :
66 SPELLCHECK_ON : md,txt,html
7+ PRETTIER_CONFIG : .github/config/prettier.json
8+ PRETTIER_FILES : js,ts,jsx,tsx,css,scss,md,json
9+ MARKDOWNLINT_CONFIG : .github/config/.markdownlint.json
710
811tasks :
912 format :
1013 desc : Format all code files in the repository
1114 cmds :
12- - npx --yes prettier --write '**/*.{js,ts,jsx,tsx,css,scss,md,yml,yaml,json}' || true
13- - npx --yes markdownlint-cli2 '**/*.md' --config .github/config/.markdownlint.json --fix || true
15+ - npx --yes prettier --config {{.PRETTIER_CONFIG}} --write '**/*.{ {{.PRETTIER_FILES}} }' || true
16+ - npx --yes prettier --write '**/*.{yml,yaml}' || true
17+ - npx --yes markdownlint-cli2 '**/*.md' --config {{.MARKDOWNLINT_CONFIG}} --fix || true
1418 - " [ -d src ] && gofmt -w src || true"
1519 - ' [ -d src ] && find src -name "*.java" -exec java -jar google-java-format.jar --replace {} + || true'
1620 - ' [ -d src ] && find src -name "*.go" -exec gofmt -w {} + || true'
1923 lint :
2024 desc : Lint all code and markdown files in the repository
2125 cmds :
22- - " npx --yes prettier --check '**/*.{js,ts,jsx,tsx,css,scss,md,yml,yaml,json}' || (echo '❌ Prettier check failed! Please format your code with: task code:format' && exit 1)"
23- - npx --yes markdownlint-cli2 '**/*.md' --config .github/config/.markdownlint.json || (echo "❌ Markdownlint check failed! Please fix Markdown issues." && exit 1)
26+ - " npx --yes prettier --config {{.PRETTIER_CONFIG}} --check '**/*.{ {{.PRETTIER_FILES}} }' || (echo '❌ Prettier check failed! Please format your code with: task code:format' && exit 1)"
27+ - npx --yes prettier --check '**/*.{yml,yaml}'
28+ - npx --yes markdownlint-cli2 '**/*.md' --config {{.MARKDOWNLINT_CONFIG}} || (echo "❌ Markdownlint check failed! Please fix Markdown issues." && exit 1)
2429 silent : false
2530
2631 spellcheck :
0 commit comments