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 | |
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')
-rw-r--r-- | src/Makefile.am | 3 | ||||
-rw-r--r-- | src/rules/license.cpp | 47 |
2 files changed, 49 insertions, 1 deletions
diff --git a/src/Makefile.am b/src/Makefile.am index 7b6a355..642485d 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -18,7 +18,8 @@ mplint_SOURCES = \ stringvector.h \ template.hpp \ rules/debug.cpp \ - rules/dump.cpp + rules/dump.cpp \ + rules/license.cpp # set the include path found by configure AM_CPPFLAGS = $(all_includes) 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; + } +} |