Skip to content

Latest commit

 

History

History
68 lines (44 loc) · 2.78 KB

check-prettier-formatting-task.md

File metadata and controls

68 lines (44 loc) · 2.78 KB

"Check Prettier Formatting" workflow (Task)

Workflow file: check-prettier-formatting-task.yml

Use Prettier to check formatting. Supported languages include:

  • JavaScript
  • TypeScript
  • CSS
  • HTML
  • JSON
  • Markdown
  • YAML

This is the version of the workflow for projects using the Task task runner tool.

Assets

  • [Taskfile.yml](assets/check-prettier-formatting-task/Taskfile.yml] - Formatting task.
    • Install to: repository root (or add the general:format-prettier task into the existing Taskfile.yml)

Configuration

Prettier should be configured via a .prettierignore file to ignore any externally maintained files contained in the repository: https://prettier.io/docs/en/ignore.html

Support for additional languages can be added to Prettier via plugins: https://prettier.io/docs/en/plugins.html

Prettier automatically determines the language based on file name. In cases where it is not able to recognize a file, the parser can be specified in a .prettierrc.yml configuration file: https://prettier.io/docs/en/configuration.html#setting-the-parserdocsenoptionshtmlparser-option

The default Prettier code style is the official standardized style to be used in all Arduino tooling projects and should not be modified.

Readme badge

Markdown badge:

[![Check Prettier Formatting status](https://github.com/REPO_OWNER/REPO_NAME/actions/workflows/check-prettier-formatting-task.yml/badge.svg)](https://github.com/REPO_OWNER/REPO_NAME/actions/workflows/check-prettier-formatting-task.yml)

Replace the REPO_OWNER and REPO_NAME placeholders in the URLs with the final repository owner and name (example).


Asciidoc badge:

image:https://github.com/{repository-owner}/{repository-name}/actions/workflows/check-prettier-formatting-task.yml/badge.svg["Check Prettier Formatting status", link="https://github.com/{repository-owner}/{repository-name}/actions/workflows/check-prettier-formatting-task.yml"]

Define the {repository-owner} and {repository-name} attributes and use them throughout the readme (example).

Commit message

Add CI workflow to check for Prettier formatting compliance

On every push and pull request that affects relevant files, and periodically, check whether the formatting of supported
files is compliant with the Prettier style.

PR message

On every push and pull request that affects relevant files, and periodically, check whether the formatting of supported files is compliant with the [Prettier](https://prettier.io/docs/en/index.html) style.