You've already forked library-registry
mirror of
https://github.com/arduino/library-registry.git
synced 2025-07-04 10:22:30 +03:00
Add CI workflow to check for Prettier formatting compliance
On every push and pull request that affects relevant files, check whether the formatting of supported files is compliant with the Prettier style.
This commit is contained in:
219
.github/workflows/check-prettier-formatting-task.yml
vendored
Normal file
219
.github/workflows/check-prettier-formatting-task.yml
vendored
Normal file
@ -0,0 +1,219 @@
|
|||||||
|
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/check-prettier-formatting-task.md
|
||||||
|
name: Check Prettier Formatting
|
||||||
|
|
||||||
|
# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
paths:
|
||||||
|
- ".github/workflows/check-prettier-formatting-task.ya?ml"
|
||||||
|
- "Taskfile.ya?ml"
|
||||||
|
- "**/.prettierignore"
|
||||||
|
- "**/.prettierrc*"
|
||||||
|
# CSS
|
||||||
|
- "**.css"
|
||||||
|
- "**.wxss"
|
||||||
|
# PostCSS
|
||||||
|
- "**.pcss"
|
||||||
|
- "**.postcss"
|
||||||
|
# Less
|
||||||
|
- "**.less"
|
||||||
|
# SCSS
|
||||||
|
- "**.scss"
|
||||||
|
# GraphQL
|
||||||
|
- "**.graphqls?"
|
||||||
|
- "**.gql"
|
||||||
|
# handlebars
|
||||||
|
- "**.handlebars"
|
||||||
|
- "**.hbs"
|
||||||
|
# HTML
|
||||||
|
- "**.mjml"
|
||||||
|
- "**.html?"
|
||||||
|
- "**.html.hl"
|
||||||
|
- "**.st"
|
||||||
|
- "**.xht"
|
||||||
|
- "**.xhtml"
|
||||||
|
# Vue
|
||||||
|
- "**.vue"
|
||||||
|
# JavaScript
|
||||||
|
- "**.flow"
|
||||||
|
- "**._?jsb?"
|
||||||
|
- "**.bones"
|
||||||
|
- "**.cjs"
|
||||||
|
- "**.es6?"
|
||||||
|
- "**.frag"
|
||||||
|
- "**.gs"
|
||||||
|
- "**.jake"
|
||||||
|
- "**.jscad"
|
||||||
|
- "**.jsfl"
|
||||||
|
- "**.js[ms]"
|
||||||
|
- "**.[mn]js"
|
||||||
|
- "**.pac"
|
||||||
|
- "**.wxs"
|
||||||
|
- "**.[xs]s?js"
|
||||||
|
- "**.xsjslib"
|
||||||
|
# JSX
|
||||||
|
- "**.jsx"
|
||||||
|
# TypeScript
|
||||||
|
- "**.ts"
|
||||||
|
# TSX
|
||||||
|
- "**.tsx"
|
||||||
|
# JSON
|
||||||
|
- "**/.eslintrc"
|
||||||
|
- "**.json"
|
||||||
|
- "**.avsc"
|
||||||
|
- "**.geojson"
|
||||||
|
- "**.gltf"
|
||||||
|
- "**.har"
|
||||||
|
- "**.ice"
|
||||||
|
- "**.JSON-tmLanguage"
|
||||||
|
- "**.mcmeta"
|
||||||
|
- "**.tfstate"
|
||||||
|
- "**.topojson"
|
||||||
|
- "**.webapp"
|
||||||
|
- "**.webmanifest"
|
||||||
|
- "**.yyp?"
|
||||||
|
# JSONC
|
||||||
|
- "**/.babelrc"
|
||||||
|
- "**/.jscsrc"
|
||||||
|
- "**/.js[hl]intrc"
|
||||||
|
- "**.jsonc"
|
||||||
|
- "**.sublime-*"
|
||||||
|
# JSON5
|
||||||
|
- "**.json5"
|
||||||
|
# Markdown
|
||||||
|
- "**.mdx?"
|
||||||
|
- "**.markdown"
|
||||||
|
- "**.mk?down"
|
||||||
|
- "**.mdwn"
|
||||||
|
- "**.mkdn?"
|
||||||
|
- "**.ronn"
|
||||||
|
- "**.workbook"
|
||||||
|
# YAML
|
||||||
|
- "**/.clang-format"
|
||||||
|
- "**/.clang-tidy"
|
||||||
|
- "**/.gemrc"
|
||||||
|
- "**/glide.lock"
|
||||||
|
- "**.ya?ml*"
|
||||||
|
- "**.mir"
|
||||||
|
- "**.reek"
|
||||||
|
- "**.rviz"
|
||||||
|
- "**.sublime-syntax"
|
||||||
|
- "**.syntax"
|
||||||
|
pull_request:
|
||||||
|
paths:
|
||||||
|
- ".github/workflows/check-prettier-formatting-task.ya?ml"
|
||||||
|
- "Taskfile.ya?ml"
|
||||||
|
- "**/.prettierignore"
|
||||||
|
- "**/.prettierrc*"
|
||||||
|
# CSS
|
||||||
|
- "**.css"
|
||||||
|
- "**.wxss"
|
||||||
|
# PostCSS
|
||||||
|
- "**.pcss"
|
||||||
|
- "**.postcss"
|
||||||
|
# Less
|
||||||
|
- "**.less"
|
||||||
|
# SCSS
|
||||||
|
- "**.scss"
|
||||||
|
# GraphQL
|
||||||
|
- "**.graphqls?"
|
||||||
|
- "**.gql"
|
||||||
|
# handlebars
|
||||||
|
- "**.handlebars"
|
||||||
|
- "**.hbs"
|
||||||
|
# HTML
|
||||||
|
- "**.mjml"
|
||||||
|
- "**.html?"
|
||||||
|
- "**.html.hl"
|
||||||
|
- "**.st"
|
||||||
|
- "**.xht"
|
||||||
|
- "**.xhtml"
|
||||||
|
# Vue
|
||||||
|
- "**.vue"
|
||||||
|
# JavaScript
|
||||||
|
- "**.flow"
|
||||||
|
- "**._?jsb?"
|
||||||
|
- "**.bones"
|
||||||
|
- "**.cjs"
|
||||||
|
- "**.es6?"
|
||||||
|
- "**.frag"
|
||||||
|
- "**.gs"
|
||||||
|
- "**.jake"
|
||||||
|
- "**.jscad"
|
||||||
|
- "**.jsfl"
|
||||||
|
- "**.js[ms]"
|
||||||
|
- "**.[mn]js"
|
||||||
|
- "**.pac"
|
||||||
|
- "**.wxs"
|
||||||
|
- "**.[xs]s?js"
|
||||||
|
- "**.xsjslib"
|
||||||
|
# JSX
|
||||||
|
- "**.jsx"
|
||||||
|
# TypeScript
|
||||||
|
- "**.ts"
|
||||||
|
# TSX
|
||||||
|
- "**.tsx"
|
||||||
|
# JSON
|
||||||
|
- "**/.eslintrc"
|
||||||
|
- "**.json"
|
||||||
|
- "**.avsc"
|
||||||
|
- "**.geojson"
|
||||||
|
- "**.gltf"
|
||||||
|
- "**.har"
|
||||||
|
- "**.ice"
|
||||||
|
- "**.JSON-tmLanguage"
|
||||||
|
- "**.mcmeta"
|
||||||
|
- "**.tfstate"
|
||||||
|
- "**.topojson"
|
||||||
|
- "**.webapp"
|
||||||
|
- "**.webmanifest"
|
||||||
|
- "**.yyp?"
|
||||||
|
# JSONC
|
||||||
|
- "**/.babelrc"
|
||||||
|
- "**/.jscsrc"
|
||||||
|
- "**/.js[hl]intrc"
|
||||||
|
- "**.jsonc"
|
||||||
|
- "**.sublime-*"
|
||||||
|
# JSON5
|
||||||
|
- "**.json5"
|
||||||
|
# Markdown
|
||||||
|
- "**.mdx?"
|
||||||
|
- "**.markdown"
|
||||||
|
- "**.mk?down"
|
||||||
|
- "**.mdwn"
|
||||||
|
- "**.mkdn?"
|
||||||
|
- "**.ronn"
|
||||||
|
- "**.workbook"
|
||||||
|
# YAML
|
||||||
|
- "**/.clang-format"
|
||||||
|
- "**/.clang-tidy"
|
||||||
|
- "**/.gemrc"
|
||||||
|
- "**/glide.lock"
|
||||||
|
- "**.ya?ml*"
|
||||||
|
- "**.mir"
|
||||||
|
- "**.reek"
|
||||||
|
- "**.rviz"
|
||||||
|
- "**.sublime-syntax"
|
||||||
|
- "**.syntax"
|
||||||
|
workflow_dispatch:
|
||||||
|
repository_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
check:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Install Task
|
||||||
|
uses: arduino/setup-task@v1
|
||||||
|
with:
|
||||||
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
version: 3.x
|
||||||
|
|
||||||
|
- name: Format with Prettier
|
||||||
|
run: task general:format-prettier
|
||||||
|
|
||||||
|
- name: Check formatting
|
||||||
|
run: git diff --color --exit-code
|
@ -5,6 +5,7 @@
|
|||||||
[](https://github.com/arduino/library-registry/actions/workflows/check-go-task.yml)
|
[](https://github.com/arduino/library-registry/actions/workflows/check-go-task.yml)
|
||||||
[](https://github.com/arduino/library-registry/actions/workflows/check-python-task.yml)
|
[](https://github.com/arduino/library-registry/actions/workflows/check-python-task.yml)
|
||||||
[](https://github.com/arduino/library-registry/actions/workflows/check-general-formatting-task.yml)
|
[](https://github.com/arduino/library-registry/actions/workflows/check-general-formatting-task.yml)
|
||||||
|
[](https://github.com/arduino/library-registry/actions/workflows/check-prettier-formatting-task.yml)
|
||||||
|
|
||||||
This branch contains the generated source file for the Arduino Library Manager index. If you want to add a library to
|
This branch contains the generated source file for the Arduino Library Manager index. If you want to add a library to
|
||||||
the Arduino Library Manager index, please follow these instructions:
|
the Arduino Library Manager index, please follow these instructions:
|
||||||
|
@ -19,6 +19,12 @@ tasks:
|
|||||||
fi
|
fi
|
||||||
- ec
|
- ec
|
||||||
|
|
||||||
|
# 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/go-task/Taskfile.yml
|
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/go-task/Taskfile.yml
|
||||||
go:build:
|
go:build:
|
||||||
desc: Build the Go code
|
desc: Build the Go code
|
||||||
|
Reference in New Issue
Block a user