diff options
-rw-r--r-- | src/rules/license.cpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/rules/license.cpp b/src/rules/license.cpp index 06eda18..cc0fa8c 100644 --- a/src/rules/license.cpp +++ b/src/rules/license.cpp @@ -20,6 +20,9 @@ #include "template.hpp" +bool afterCopyrights(false); +bool foundManaPlus(false); + registerRuleExt(license, "005", "(.+)[.](h|cpp)") startRule(license) @@ -29,6 +32,8 @@ startRule(license) { terminateRule(); } + afterCopyrights = false; + foundManaPlus = false; } endRule(license) @@ -49,4 +54,32 @@ parseLineRule(license) terminateRule(); return; } + else if (line > 1) + { + if (!afterCopyrights) + { + if (data == " *") + { + if (!foundManaPlus) + print("Missing ManaPlus developers copyrights"); + afterCopyrights = true; + } + else if (strStartWith(data, " * Copyright (C) ")) + { + if (data.find("The ManaPlus Developers") != std::string::npos) + foundManaPlus = true; + } + else + { + print("Missing copyrights section"); + terminateRule(); + } + } + else + { + if (data != " * This file is part of The ManaPlus Client.") + print("Missing \"This file is part of The ManaPlus Client.\""); + terminateRule(); + } + } } |