diff --git a/Taskfile.yml b/Taskfile.yml index 633a94a..00639ca 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -6,6 +6,16 @@ tasks: deps: - task: ts:build + check: + desc: Check for problems with the project + deps: + - task: action:validate + - task: general:check-spelling + - task: markdown:check-links + - task: markdown:lint + - task: ts:lint + - task: ts:test + fix: desc: Make automated corrections to the project's files deps: @@ -15,61 +25,6 @@ tasks: - task: ts:build - task: ts:fix-lint - check: - desc: Check for problems with the project - deps: - - task: ts:test - - task: action:validate - - task: markdown:lint - - task: general:check-spelling - - task: markdown:check-links - - task: ts:lint - - docs:generate: - desc: Create all generated documentation content - # This is an "umbrella" task used to call any documentation generation processes the project has. - # It can be left empty if there are none. - - # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/poetry-task/Taskfile.yml - poetry:install-deps: - desc: Install dependencies managed by Poetry - cmds: - - poetry install --no-root - - ts:install-deps: - desc: Install TypeScript dependencies - cmds: - - npm install - - ts:build: - desc: Build the action's TypeScript code. - deps: - - task: ts:install-deps - cmds: - - npx tsc - - npx ncc build - - ts:test: - desc: Test the action's TypeScript code. - deps: - - task: ts:install-deps - cmds: - - npx jest - - ts:lint: - desc: Lint TypeScript code - deps: - - task: ts:install-deps - cmds: - - npx eslint --ext .js,.jsx,.ts,.tsx . - - ts:fix-lint: - desc: Fix TypeScript code linting violations - deps: - - task: ts:install-deps - cmds: - - npx eslint --ext .js,.jsx,.ts,.tsx --fix . - action:validate: desc: Validate GitHub Actions metadata against JSON schema vars: @@ -79,17 +34,32 @@ tasks: - wget --quiet --output-document="{{.ACTION_METADATA_SCHEMA_PATH}}" https://json.schemastore.org/github-action - npx ajv-cli validate --strict=false -s "{{.ACTION_METADATA_SCHEMA_PATH}}" -d "action.yml" - # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-markdown-task/Taskfile.yml - markdown:lint: - desc: Check for problems in Markdown files - cmds: - - npx markdownlint-cli "**/*.md" + docs:generate: + desc: Create all generated documentation content + # This is an "umbrella" task used to call any documentation generation processes the project has. + # It can be left empty if there are none. - # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-markdown-task/Taskfile.yml - markdown:fix: - desc: Automatically correct linting violations in Markdown files where possible + # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/spell-check-task/Taskfile.yml + general:check-spelling: + desc: Check for commonly misspelled words + deps: + - task: poetry:install-deps cmds: - - npx markdownlint-cli --fix "**/*.md" + - poetry run codespell + + # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/spell-check-task/Taskfile.yml + general:correct-spelling: + desc: Correct commonly misspelled words where possible + deps: + - task: poetry:install-deps + cmds: + - poetry run codespell --write-changes + + # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-prettier-formatting-task/Taskfile.yml + general:format-prettier: + desc: Format all supported files with Prettier + cmds: + - npx prettier --write . # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-markdown-task/Taskfile.yml markdown:check-links: @@ -134,24 +104,54 @@ tasks: ' fi - # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-prettier-formatting-task/Taskfile.yml - general:format-prettier: - desc: Format all supported files with Prettier + # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-markdown-task/Taskfile.yml + markdown:fix: + desc: Automatically correct linting violations in Markdown files where possible cmds: - - npx prettier --write . + - npx markdownlint-cli --fix "**/*.md" - # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/spell-check-task/Taskfile.yml - general:check-spelling: - desc: Check for commonly misspelled words - deps: - - task: poetry:install-deps + # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-markdown-task/Taskfile.yml + markdown:lint: + desc: Check for problems in Markdown files cmds: - - poetry run codespell + - npx markdownlint-cli "**/*.md" - # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/spell-check-task/Taskfile.yml - general:correct-spelling: - desc: Correct commonly misspelled words where possible - deps: - - task: poetry:install-deps + # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/poetry-task/Taskfile.yml + poetry:install-deps: + desc: Install dependencies managed by Poetry cmds: - - poetry run codespell --write-changes + - poetry install --no-root + + ts:build: + desc: Build the action's TypeScript code. + deps: + - task: ts:install-deps + cmds: + - npx tsc + - npx ncc build + + ts:fix-lint: + desc: Fix TypeScript code linting violations + deps: + - task: ts:install-deps + cmds: + - npx eslint --ext .js,.jsx,.ts,.tsx --fix . + + ts:install-deps: + desc: Install TypeScript dependencies + cmds: + - npm install + + ts:lint: + desc: Lint TypeScript code + deps: + - task: ts:install-deps + cmds: + - npx eslint --ext .js,.jsx,.ts,.tsx . + + ts:test: + desc: Test the action's TypeScript code. + deps: + - task: ts:install-deps + cmds: + - npx jest