Skip to content

Add reference link comment for Prettier filename matching patterns #600

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .github/workflows/check-prettier-formatting-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,13 @@ on:
- "**.mkdn?"
- "**.ronn"
- "**.workbook"
# TOML
- "**/Cargo.lock"
- "**/Cargo.toml.orig"
- "**/Gopkg.lock"
- "**/Pipfile"
- "**/pdm.lock"
- "**.toml"
# YAML
- "**/.clang-format"
- "**/.clang-tidy"
Expand Down Expand Up @@ -189,6 +196,13 @@ on:
- "**.mkdn?"
- "**.ronn"
- "**.workbook"
# TOML
- "**/Cargo.lock"
- "**/Cargo.toml.orig"
- "**/Gopkg.lock"
- "**/Pipfile"
- "**/pdm.lock"
- "**.toml"
# YAML
- "**/.clang-format"
- "**/.clang-tidy"
Expand Down
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ node_modules/
/other/clang-format-configuration/testdata/golden/samples/
/other/clang-format-configuration/testdata/input/samples/
/other/clang-format-configuration/.clang-format
poetry.lock
3 changes: 3 additions & 0 deletions .prettierrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-prettier-formatting/toml/.prettierrc.yml
plugins:
- prettier-plugin-toml
1 change: 1 addition & 0 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,7 @@ tasks:
- |
cp \
"{{.WORKFLOW_TEMPLATE_ASSETS_PATH}}/check-javascript/.eslintrc.yml" \
"{{.WORKFLOW_TEMPLATE_ASSETS_PATH}}/check-prettier-formatting/toml/.prettierrc.yml" \
"{{.WORKFLOW_TEMPLATE_ASSETS_PATH}}/general/.editorconfig" \
"{{.WORKFLOW_TEMPLATE_ASSETS_PATH}}/check-python/.flake8" \
"{{.WORKFLOW_TEMPLATE_ASSETS_PATH}}/check-markdown/.markdownlint.yml" \
Expand Down
63 changes: 62 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"github-label-sync": "3.0.0",
"markdown-link-check": "^3.13.7",
"markdownlint-cli": "^0.45.0",
"prettier": "^3.5.3"
"prettier": "^3.5.3",
"prettier-plugin-toml": "^2.0.5"
},
"dependencies": {
"js-yaml": "^4.1.0"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.licenses/
__pycache__/
node_modules/
poetry.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-prettier-formatting/toml/.prettierrc.yml
plugins:
- prettier-plugin-toml
20 changes: 20 additions & 0 deletions workflow-templates/check-prettier-formatting-task.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Use [Prettier](https://prettier.io/docs/en/index.html) to check formatting. Supp
- HTML
- JSON
- Markdown
- TOML ([via plugin](#toml-support-optional))
- YAML

This is the version of the workflow for projects using the [Task](https://taskfile.dev/#/) task runner tool.
Expand Down Expand Up @@ -72,6 +73,25 @@ Add the following to [`/.gitignore`](https://git-scm.com/docs/gitignore):
/node_modules/
```

### TOML Support (Optional)

If the project contains manually maintained [TOML](https://toml.io/) language files, some additional configuration is needed to add support to Prettier for this language.

#### Assets

- [`.prettierrc.yml`](assets/check-prettier-formatting/toml/.prettierrc.yml) - Prettier configuration file
- Install to: repository root.

#### Dependencies

Add the TOML support dependencies by running this command:

```text
npm install --save-dev prettier-plugin-toml@^2.0.2
```

Commit the resulting changes to the `package.json` and `package-lock.json` files.

### Readme badge

Markdown badge:
Expand Down
14 changes: 14 additions & 0 deletions workflow-templates/check-prettier-formatting-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,13 @@ on:
- "**.mkdn?"
- "**.ronn"
- "**.workbook"
# TOML
- "**/Cargo.lock"
- "**/Cargo.toml.orig"
- "**/Gopkg.lock"
- "**/Pipfile"
- "**/pdm.lock"
- "**.toml"
# YAML
- "**/.clang-format"
- "**/.clang-tidy"
Expand Down Expand Up @@ -189,6 +196,13 @@ on:
- "**.mkdn?"
- "**.ronn"
- "**.workbook"
# TOML
- "**/Cargo.lock"
- "**/Cargo.toml.orig"
- "**/Gopkg.lock"
- "**/Pipfile"
- "**/pdm.lock"
- "**.toml"
# YAML
- "**/.clang-format"
- "**/.clang-tidy"
Expand Down
Loading