Use editorconfig-checker to check if the formatting of the repository's files matches the .editorconfig
.
Install the check-general-formatting-task.yml
GitHub Actions workflow to .github/workflows/
.editorconfig
- Install to: repository root
Taskfile.yml
- formatting check task.- Install to: repository root (or merge into the existing
Taskfile.yml
).
- Install to: repository root (or merge into the existing
.ecrc
- editorconfig-checker configuration file.- Install to: repository root
The formatting style defined in .editorconfig
is the official standardized style to be used in all Arduino tooling projects and should not be modified.
If the repository contains generated or vendored files, they can be excluded from the check by adding them to the Exclude
array in the .ecrc
configuration file.
Reference: https://github.com/editorconfig-checker/editorconfig-checker#configuration
Markdown badge:
[![Check General Formatting status](https://github.com/TODO_REPO_OWNER/TODO_REPO_NAME/actions/workflows/check-general-formatting-task.yml/badge.svg)](https://github.com/TODO_REPO_OWNER/TODO_REPO_NAME/actions/workflows/check-general-formatting-task.yml)
Replace the TODO_REPO_OWNER
and TODO_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-general-formatting-task.yml/badge.svg["Check General Formatting status", link="https://github.com/{repository-owner}/{repository-name}/actions/workflows/check-general-formatting-task.yml"]
Define the {repository-owner}
and {repository-name}
attributes and use them throughout the readme (example).
Add CI workflow to check general file formatting
On every push, pull request, and periodically, check whether the repository's files are formatted according to
.editorconfig.
On every push, pull request, and periodically, use [editorconfig-checker](https://github.com/editorconfig-checker/editorconfig-checker) check whether the repository's files are formatted according to [`.editorconfig`](https://editorconfig.org/).