From 0b5ee0b40083644445cd5b42696d3f7eff94760a Mon Sep 17 00:00:00 2001
From: Nejc Habjan <hab.nejc@gmail.com>
Date: Fri, 28 Feb 2020 12:07:38 +0100
Subject: [PATCH] feat: allow config files in .gitlab directory (#5584)

---
 docs/development/configuration.md           | 10 +++++++++-
 docs/usage/configuration-options.md         |  2 ++
 lib/config/app-strings.ts                   |  2 ++
 test/workers/repository/init/config.spec.ts |  8 ++++++++
 4 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/docs/development/configuration.md b/docs/development/configuration.md
index 082845d7a6..ce6819f5b8 100644
--- a/docs/development/configuration.md
+++ b/docs/development/configuration.md
@@ -7,7 +7,15 @@ Configuration is supported via any or all of the below:
 - Configuration file
 - Environment
 - CLI
-- `renovate.json`, `renovate.json5`, `.github/renovate.json`, `.github/renovate.json5`, `.renovaterc.json`, or `.renovaterc` in target repository
+- Configuration file in target repository at one of the following paths:
+  - `renovate.json`
+  - `renovate.json5`
+  - `.github/renovate.json`
+  - `.github/renovate.json5`
+  - `.gitlab/renovate.json`
+  - `.gitlab/renovate.json5`
+  - `.renovaterc.json`
+  - `.renovaterc`
 - `renovate` field of `package.json` in target repository
 
 The above are listed in **_reverse order_** of preference. e.g. CLI values will override environment values if they conflict.
diff --git a/docs/usage/configuration-options.md b/docs/usage/configuration-options.md
index 3179f14145..5f9c729085 100644
--- a/docs/usage/configuration-options.md
+++ b/docs/usage/configuration-options.md
@@ -11,6 +11,8 @@ You can store your Renovate configuration file in one of the following locations
 
 - `.github/renovate.json`
 - `.github/renovate.json5`
+- `.gitlab/renovate.json`
+- `.gitlab/renovate.json5`
 - `.renovaterc.json`
 - `renovate.json`
 - `renovate.json5`
diff --git a/lib/config/app-strings.ts b/lib/config/app-strings.ts
index c74b4f53fa..6f0693b158 100644
--- a/lib/config/app-strings.ts
+++ b/lib/config/app-strings.ts
@@ -3,6 +3,8 @@ export const configFileNames = [
   'renovate.json5',
   '.github/renovate.json',
   '.github/renovate.json5',
+  '.gitlab/renovate.json',
+  '.gitlab/renovate.json5',
   '.renovaterc',
   '.renovaterc.json',
   'package.json',
diff --git a/test/workers/repository/init/config.spec.ts b/test/workers/repository/init/config.spec.ts
index e3a273b2bb..cc9b1d2f97 100644
--- a/test/workers/repository/init/config.spec.ts
+++ b/test/workers/repository/init/config.spec.ts
@@ -87,6 +87,14 @@ describe('workers/repository/init/config', () => {
       platform.getFile.mockResolvedValue('{}');
       await mergeRenovateConfig(config);
     });
+    it('finds .gitlab/renovate.json', async () => {
+      platform.getFileList.mockResolvedValue([
+        'package.json',
+        '.gitlab/renovate.json',
+      ]);
+      platform.getFile.mockResolvedValue('{}');
+      await mergeRenovateConfig(config);
+    });
     it('finds .renovaterc.json', async () => {
       platform.getFileList.mockResolvedValue([
         'package.json',
-- 
GitLab