Add prettier for auto formatting 58/91958/7
authorThanh Ha <zxiiro@gmail.com>
Fri, 7 Aug 2020 15:21:48 +0000 (11:21 -0400)
committerThanh Ha <zxiiro@gmail.com>
Mon, 10 Aug 2020 14:17:39 +0000 (10:17 -0400)
It appears that we inconsistently use 2 and 4 space indents for YAML
however 2 space indents appear to be the dominant one in practice so
set config to that so that the least amount of changes happen when
prettier is applied.

This patch is also a preparation patch for RELENG-152 as the automation
we want to add for managing JJB updates when branch cutting requires
a consistent formatting of the YAML files so that auto-generated output
can match appropriately with minimal formatting changes.

Issue: RELENG-152
Change-Id: Ie35521de0378b7892f06ff7f36d470847c78989f
Signed-off-by: Thanh Ha <zxiiro@gmail.com>
.editorconfig
.pre-commit-config.yaml
.yamllint

index 5eb4e678eb8aae62a6d3abb02a2db110165e2870..f042ae5fcedfc11c909b3267be5f9b151ca0b08c 100644 (file)
@@ -21,5 +21,5 @@ indent_size = 4
 max_line_length = 80
 
 [*.yaml]
-indent_size = 4
+indent_size = 2
 
index 13f206b2d62c1c744cea4b17acb6217eb631a171..9f5aa4ad1fcaf6f7f3ac474b9010d44d9e8112b8 100644 (file)
@@ -6,6 +6,11 @@ repos:
       - id: check-json
       - id: trailing-whitespace
 
+  - repo: https://github.com/prettier/prettier
+    rev: 2.0.5
+    hooks:
+      - id: prettier
+
   - repo: https://github.com/jorisroovers/gitlint
     rev: v0.13.1
     hooks:
@@ -16,10 +21,10 @@ repos:
     hooks:
       - id: shellcheck
         exclude: >
-            (?x)^(
-                jjb/global-jjb/.*|
-                jenkins-config/.*
-            )$
+          (?x)^(
+              jjb/global-jjb/.*|
+              jenkins-config/.*
+          )$
 
   - repo: https://github.com/ambv/black
     rev: stable
index 74bbf1a303d0bdaddfa9a68b0154a1431547fd2f..93ca0092ed1a15c7fd1c2ee4a87332b265a3a7c0 100644 (file)
--- a/.yamllint
+++ b/.yamllint
@@ -10,4 +10,3 @@ rules:
     max: 120
     ignore: |
       packer
-