Skip to content
Snippets Groups Projects
Commit 8c031695 authored by Tobias Hunger's avatar Tobias Hunger
Browse files

Update mytasks to new coding style


Fix some false positives while at it.

Change-Id: I253a2931f866ba192cbc398b784ef851f35ccfb1
Reviewed-by: default avatarTobias Hunger <tobias.hunger@nokia.com>
parent 979d8f4d
No related branches found
No related tags found
No related merge requests found
......@@ -41,20 +41,28 @@ sub checkLine {
if ($file =~ /(.cpp|.c|.cxx|.h)$/ && $line =~ /^ *\t */) {
print "$file\t$row\tWARNING\tTabs used to indent.\n";
}
if ($file =~ /(.cpp|.c|.cxx|.h)$/ && $line =~ /^\s*{$/) {
if ($file =~ /(.cpp|.c|.cxx|.h)$/ && $line =~ /^\s+{$/) {
print "$file\t$row\tWARNING\tOpening bracket found all alone on a line.\n";
}
if ($file =~ /(.cpp|.c|.cxx|.h)$/ && $line =~ /{.*[^\s].*$/) {
if ($line !~ /{\s+\/\*/)
if ($line !~ /\{\s+\/\*/ && $line !~ /^\s*\{ \}$/ && $line !~ /^namespace .* \}$/)
{ print "$file\t$row\tWARNING\tText found after opening bracket.\n"; }
}
if ($file =~ /(.cpp|.c|.cxx|.h)$/ && $line =~ /[a-zA-Z0-9_]([*&])[^\/]/) {
print "$file\t$row\tWARNING\tUse \"TYPE ${1}NAME\" (currently the space between TYPE and $1 is missing).\n";
if ($file =~ /(.cpp|.c|.cxx|.h)$/ && $line =~ /[a-zA-Z0-9_]\*[^\/]/) {
next if $line =~ /SIGNAL\(/;
next if $line =~ /SLOT\(/;
print "$file\t$row\tWARNING\tUse \"TYPE *NAME\" (currently the space between TYPE and * is missing).\n";
}
if ($file =~ /(.cpp|.c|.cxx|.h)$/ && $line =~ /[*&]\s+/) {
next if ($line =~ /^\s*\*\s+/);
if ($file =~ /(.cpp|.c|.cxx|.h)$/ && $line =~ /[a-zA-Z0-9_]&[^&]/) {
print "$file\t$row\tWARNING\tUse \"TYPE &NAME\" (currently the space between TYPE and & is missing).\n";
}
if ($file =~ /(.cpp|.c|.cxx|.h)$/ && $line =~ /\*\s+/) {
next if ($line =~ /^\s*\*\*?\s+/);
next if ($line =~ /\/\*/);
print "$file\t$row\tWARNING\tUse \"TYPE ${1}NAME\" (currently there is a space between $1 and NAME).\n";
print "$file\t$row\tWARNING\tUse \"TYPE *NAME\" (currently there is a space between * and NAME).\n";
}
if ($file =~ /(.cpp|.c|.cxx|.h)$/ && $line =~ /[^&]&\s+/) {
print "$file\t$row\tWARNING\tUse \"TYPE &NAME\" (currently there is a space between & and NAME).\n";
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment