From f497135bc410209d5527deeeff0e934c524b85f0 Mon Sep 17 00:00:00 2001
From: Jaeden Amero <jaeden.amero@arm.com>
Date: Fri, 5 Feb 2021 11:47:58 +0000
Subject: [PATCH] licenseheaders: Use single # for comments

The default style for licenseheaders for CMake is to use ## and to have
some extra start and end comments around the license. Mbed style is to
use single # and no extra start and end comments. Add a settings file
for licenseheaders to override the default style with Mbed style.
---
 .pre-commit-config.yaml        |  3 ++-
 ci_scripts/licenseheaders.json | 15 +++++++++++++++
 2 files changed, 17 insertions(+), 1 deletion(-)
 create mode 100644 ci_scripts/licenseheaders.json

diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 95dc64f5..691b1ede 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -4,7 +4,8 @@ repos:
     hooks:
       - id: licenseheaders
         exclude: \.yaml$|\.yml$
-        args: ["-t", "ci_scripts/templates/.copyright.tmpl", "-cy", "-f"]
+        args: ["-s", "ci_scripts/licenseheaders.json", "-t",
+        "ci_scripts/templates/.copyright.tmpl", "-cy", "-f"]
 
   - repo: https://github.com/psf/black
     rev: 19.10b0
diff --git a/ci_scripts/licenseheaders.json b/ci_scripts/licenseheaders.json
new file mode 100644
index 00000000..542f6883
--- /dev/null
+++ b/ci_scripts/licenseheaders.json
@@ -0,0 +1,15 @@
+{
+    "cmake": {
+        "extensions": [],
+        "filenames": ["CMakeLists.txt"],
+        "keepFirst": "",
+        "blockCommentStartPattern": "",
+        "blockCommentEndPattern": "",
+        "lineCommentStartPattern": "^\\s*#",
+        "lineCommentEndPattern": "",
+        "headerStartLine": "",
+        "headerEndLine": "",
+        "headerLinePrefix": "# ",
+        "headerLineSuffix": ""
+    }
+}