diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000000..adea73b73b7 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,21 @@ +# pre-commit is a tool to perform a predefined set of tasks manually and/or +# automatically before git commits are made. pre-commit can also be run in CI +# on Pull Requests and will auto-commit corrections to the PR for consistency. +# +# Config reference: https://pre-commit.com/#pre-commit-configyaml---top-level +# +# How to install locally +# +# - pip install pre-commit +# +# Common tasks +# +# - Run on all files: pre-commit run --all-files +# - Register git hooks: pre-commit install --install-hooks +# +repos: + # Autoformat: yaml + - repo: https://github.com/pre-commit/mirrors-prettier + rev: v3.0.0-alpha.1 + hooks: + - id: prettier diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 00000000000..6dc620199a5 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,13 @@ +# To create a minimal change suggestion, prettier was introduced to auto-format +# the YAML files only. It is absolutely reasonable to auto-format markdown files +# and json files as well, but for now, let's make prettier only auto-format +# YAML. +# NOTE: .cff files are a type of YAML +# +**/*.md +**/*.json + +# Other file types we should always ignore as they are likely auto-generated +# +**/*.css +**/*.js \ No newline at end of file