From 59ec7c776bce42302a313a3d87e6008a80d51f6c Mon Sep 17 00:00:00 2001 From: Anthony Galassi <28850131+bendhouseart@users.noreply.github.com> Date: Thu, 18 Aug 2022 16:49:21 -0400 Subject: [PATCH] Squashed commit of the following: commit faa39413f33651dc6c2eb246663e3d26411a6f69 Author: Christopher J. Markiewicz commit 280f0838cb6264a679f153efaf3d26717b9e3e26 Author: Anthony Galassi <28850131+bendhouseart@users.noreply.github.com> commit 2f25ff222f33ed5d253b791b53d53ff2c4d8f56e Author: Anthony Galassi <28850131+bendhouseart@users.noreply.github.com> commit db08e58b25cb1030bb736080c361c831728c31df Author: Anthony Galassi <28850131+bendhouseart@users.noreply.github.com> commit 01ead2eae22f6ee6bd654d05330ebb508cf76891 Author: Anthony Galassi <28850131+bendhouseart@users.noreply.github.com> commit a9177e3dc01ba2d77fdb59a64dbb1cedb7255301 Author: Anthony Galassi <28850131+bendhouseart@users.noreply.github.com> commit 816d4155a2a09f7785e9a0d674245b568759b7ea Author: Anthony Galassi <28850131+bendhouseart@users.noreply.github.com> commit b80e5020f5cb96d327334e00b4903d39178a6dab Author: Anthony Galassi <28850131+bendhouseart@users.noreply.github.com> commit c0d082a162ddffa00f0cb6b3e78b59db9839da70 Author: Anthony Galassi <28850131+bendhouseart@users.noreply.github.com> commit 437cab43726124e6da5cf8fcb5540eff2cb605f8 Author: Anthony Galassi <28850131+bendhouseart@users.noreply.github.com> --- .editorconfig | 6 ++++++ .pre-commit-config.yaml | 16 ++++++++-------- .yamllint.yml | 4 +++- Makefile | 19 +++++++++++++++++++ 4 files changed, 36 insertions(+), 9 deletions(-) create mode 100644 .editorconfig create mode 100644 Makefile diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000000..404e79163d --- /dev/null +++ b/.editorconfig @@ -0,0 +1,6 @@ +[*.yaml] +max_line_length = 120 +indent_style = space +indent_size = 2 +insert_final_newline = true +quote_type = single diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5fe2080d52..0cfb3c4e3b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,13 +1,13 @@ # See https://pre-commit.com for more information # See https://pre-commit.com/hooks.html for more hooks repos: -- repo: https://github.com/pre-commit/pre-commit-hooks + - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.0.1 hooks: - - id: trailing-whitespace - - id: end-of-file-fixer - - id: check-yaml - - id: check-json - - id: check-ast - - id: check-added-large-files - - id: check-case-conflict + - id: trailing-whitespace + - id: end-of-file-fixer + - id: check-yaml + - id: check-json + - id: check-ast + - id: check-added-large-files + - id: check-case-conflict diff --git a/.yamllint.yml b/.yamllint.yml index 19ff3fb868..9f0ef3ceab 100644 --- a/.yamllint.yml +++ b/.yamllint.yml @@ -5,6 +5,8 @@ rules: max: 120 indentation: # See https://github.com/yaml/pyyaml/issues/545 for why - indent-sequences: false + spaces: 2 + indent-sequences: true comments: level: error + min-spaces-from-content: 1 diff --git a/Makefile b/Makefile new file mode 100644 index 0000000000..2662661f38 --- /dev/null +++ b/Makefile @@ -0,0 +1,19 @@ + +runprettier: + prettier --write "src/schema/**/*.yaml" + python3 -m yamllint -f standard src/schema/ -c .yamllint.yml + +SCHEMA_CHANGES := $(shell git diff --name-only | grep src/schema/*.yaml) + +commitschema: + @echo SCHEMA_CHANGES $(SCHEMA_CHANGES) + git add src/schema/*.yaml && \ + git commit -m "[git-blame-ignore-rev] prettified schema files." && \ + git log --grep "\[git-blame-ignore-rev\]" --pretty=format:"# %ai - %ae - %s%n%H" >> .git-blame-ignore-revs \ + || true + +formatschema: runprettier commitschema + +all: + +.PHONY: runprettier commitschema