diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-05-24 22:12:17 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-05-24 22:12:17 +0300 |
commit | 32e3bb6e72b8dd84d6f711a8b2c6db879d169279 (patch) | |
tree | 5a13dfb7c874e062ddd743e09796ff9ad5b6a2a6 /src/rules | |
parent | 8d36964bd12e94898d4a4e25c124b72a8926f424 (diff) | |
download | mplint-32e3bb6e72b8dd84d6f711a8b2c6db879d169279.tar.gz mplint-32e3bb6e72b8dd84d6f711a8b2c6db879d169279.tar.bz2 mplint-32e3bb6e72b8dd84d6f711a8b2c6db879d169279.tar.xz mplint-32e3bb6e72b8dd84d6f711a8b2c6db879d169279.zip |
Add basic license checking.
Diffstat (limited to 'src/rules')
-rw-r--r-- | src/rules/license.cpp | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/src/rules/license.cpp b/src/rules/license.cpp new file mode 100644 index 0000000..d70a051 --- /dev/null +++ b/src/rules/license.cpp @@ -0,0 +1,47 @@ +/* + * The ManaPlus Client + * Copyright (C) 2014 The ManaPlus Developers + * + * This file is part of The ManaPlus Client. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#include "template.hpp" + +registerRuleExt(license, "005", "(.+)[.](h|cpp)") + +startRule(license) +{ +} + +endRule(license) +{ +} + +parseLineRule(license) +{ + if (line == 0 && data != "/*") + { + print("Should be license header"); + terminateRule(); + return; + } + else if (line == 1 && data != " * The ManaPlus Client") + { + print("Should be 'The ManaPlus Client' in header"); + terminateRule(); + return; + } +} |