File: clazyweb2tasks.pl

package info (click to toggle)
qtcreator 18.0.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 261,164 kB
  • sloc: cpp: 1,581,559; ansic: 528,781; python: 48,245; xml: 34,678; javascript: 15,495; sh: 2,670; asm: 2,049; perl: 1,039; lex: 737; java: 695; objc: 409; makefile: 111; yacc: 86; cs: 41; ruby: 33; sed: 22
file content (39 lines) | stat: -rwxr-xr-x 948 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/perl -w

# Copyright (C) 2017 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0

=head1 NAME

clazyweb2tasks.pl - Convert Clazy logs as displayed by the Web frontend into
Qt Creator task files.

Expected format:

Explanation for clazy-strict-iterators
./qtbase/src/tools/moc/preprocessor.cpp
line 995: for (Symbols::const_iterator j = mergeSymbol + 1; j != i; ++j)
=> Mixing iterators with const_iterators

=head1 SYNOPSIS

    clazyweb2tasks.pl < logfile > taskfile

=cut

use strict;

my $message = '';
my $fileName = '';

while (my $line = <STDIN> ) {
    chomp($line);
    if ($line =~ /\s*Explanation for (.*)$/) {
         $message = $1;
    } elsif (index($line, './') == 0) {
        $fileName = substr($line, 2);
    } elsif ($line =~ /\s*line (\d+):/) {
        my $lineNumber = $1;
        print $fileName, "\t", $lineNumber, "\tclazy\t", $message,"\n";
    }
}