From 2e6b7aea85c3d8d0c4df74879c8c325c65f699c3 Mon Sep 17 00:00:00 2001
From: Rhys Arkins <rhys@arkins.net>
Date: Sat, 23 Mar 2019 08:50:48 +0100
Subject: [PATCH] fix(schema): more allowedValues

---
 lib/config/definitions.js | 20 +++++++++++++++-----
 renovate-schema.json      | 21 +++++++++++++++++----
 2 files changed, 32 insertions(+), 9 deletions(-)

diff --git a/lib/config/definitions.js b/lib/config/definitions.js
index 4f8044f475..70d90a9510 100644
--- a/lib/config/definitions.js
+++ b/lib/config/definitions.js
@@ -559,8 +559,17 @@ const options = [
     description:
       'Update types to match against (major, minor, pin, etc). Valid only within `packageRules` object.',
     type: 'list',
-    // TODO: add allowedValues
     subType: 'string',
+    allowedValues: [
+      'major',
+      'minor',
+      'patch',
+      'pin',
+      'digest',
+      'lockFileMaintenance',
+      'rollback',
+      'bump',
+    ],
     allowString: true,
     stage: 'package',
     parent: 'packageRules',
@@ -681,6 +690,7 @@ const options = [
     name: 'bumpVersion',
     description: 'Bump the version in the package.json being updated',
     type: 'string',
+    allowedValues: ['major', 'minor', 'patch'],
   },
   // Major/Minor/Patch
   {
@@ -807,9 +817,9 @@ const options = [
   },
   {
     name: 'prCreation',
-    description:
-      'When to create the PR for a branch. Values: immediate, not-pending, status-success.',
+    description: 'When to create the PR for a branch.',
     type: 'string',
+    allowedValues: ['immediate', 'not-pending', 'status-success'],
     default: 'immediate',
   },
   {
@@ -843,9 +853,9 @@ const options = [
   },
   {
     name: 'automergeType',
-    description:
-      'How to automerge - "branch", "pr", or "pr-comment". Branch support is GitHub-only',
+    description: 'How to automerge, if enabled.',
     type: 'string',
+    allowedValues: ['branch', 'pr', 'pr-comment'],
     default: 'pr',
   },
   {
diff --git a/renovate-schema.json b/renovate-schema.json
index c7f0f89806..ee3491c95d 100644
--- a/renovate-schema.json
+++ b/renovate-schema.json
@@ -351,7 +351,17 @@
                 "description": "Update types to match against (major, minor, pin, etc). Valid only within `packageRules` object.",
                 "type": "array",
                 "items": {
-                  "type": "string"
+                  "type": "string",
+                  "enum": [
+                    "major",
+                    "minor",
+                    "patch",
+                    "pin",
+                    "digest",
+                    "lockFileMaintenance",
+                    "rollback",
+                    "bump"
+                  ]
                 }
               },
               "paths": {
@@ -424,7 +434,8 @@
     },
     "bumpVersion": {
       "description": "Bump the version in the package.json being updated",
-      "type": "string"
+      "type": "string",
+      "enum": ["major", "minor", "patch"]
     },
     "major": {
       "description": "Configuration to apply when an update type is major",
@@ -519,8 +530,9 @@
       "default": false
     },
     "prCreation": {
-      "description": "When to create the PR for a branch. Values: immediate, not-pending, status-success.",
+      "description": "When to create the PR for a branch.",
       "type": "string",
+      "enum": ["immediate", "not-pending", "status-success"],
       "default": "immediate"
     },
     "prNotPendingHours": {
@@ -544,8 +556,9 @@
       "default": false
     },
     "automergeType": {
-      "description": "How to automerge - \"branch\", \"pr\", or \"pr-comment\". Branch support is GitHub-only",
+      "description": "How to automerge, if enabled.",
       "type": "string",
+      "enum": ["branch", "pr", "pr-comment"],
       "default": "pr"
     },
     "automergeComment": {
-- 
GitLab