reports/Builder__LintReportFormat.st
author Claus Gittinger <cg@exept.de>
Thu, 28 Mar 2019 13:54:38 +0100
changeset 542 aa25a71be62a
parent 266 2ca2606e89e8
permissions -rw-r--r--
#DOCUMENTATION by cg class: stx_goodies_builder_quickSelfTest class definition class: stx_goodies_builder_quickSelfTest class added:18 methods
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
66
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     1
"{ Package: 'stx:goodies/builder/reports' }"
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     2
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     3
"{ NameSpace: Builder }"
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     4
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     5
ReportFormat subclass:#LintReportFormat
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     6
	instanceVariableNames:''
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     7
	classVariableNames:''
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     8
	poolDictionaries:''
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     9
	category:'Builder-Reports-Formats'
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    10
!
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    11
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    12
LintReportFormat subclass:#CheckStyle
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    13
	instanceVariableNames:''
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    14
	classVariableNames:''
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    15
	poolDictionaries:''
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    16
	privateIn:LintReportFormat
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    17
!
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    18
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    19
LintReportFormat subclass:#PMD
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    20
	instanceVariableNames:''
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    21
	classVariableNames:''
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    22
	poolDictionaries:''
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    23
	privateIn:LintReportFormat
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    24
!
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    25
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    26
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    27
!LintReportFormat class methodsFor:'testing'!
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    28
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    29
isAbstract
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    30
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    31
    ^self == LintReportFormat
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    32
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    33
    "Created: / 04-08-2011 / 11:44:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    34
! !
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    35
253
0b7dd037aeb2 Fixes for Lint report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 66
diff changeset
    36
!LintReportFormat methodsFor:'writing'!
0b7dd037aeb2 Fixes for Lint report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 66
diff changeset
    37
266
2ca2606e89e8 Fixes for Lint report - generate absolute filenames pointing to existing files
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 253
diff changeset
    38
writeFile: filename with: block
2ca2606e89e8 Fixes for Lint report - generate absolute filenames pointing to existing files
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 253
diff changeset
    39
2ca2606e89e8 Fixes for Lint report - generate absolute filenames pointing to existing files
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 253
diff changeset
    40
    "Writes a section for given file"
253
0b7dd037aeb2 Fixes for Lint report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 66
diff changeset
    41
266
2ca2606e89e8 Fixes for Lint report - generate absolute filenames pointing to existing files
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 253
diff changeset
    42
    stream tab; nextPutAll:'<file name="'; nextPutAll:filename; nextPutAll: '">'; cr.
2ca2606e89e8 Fixes for Lint report - generate absolute filenames pointing to existing files
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 253
diff changeset
    43
    block valueWithOptionalArgument: self.
2ca2606e89e8 Fixes for Lint report - generate absolute filenames pointing to existing files
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 253
diff changeset
    44
    stream tab; nextPutAll:'</file>'; cr.
2ca2606e89e8 Fixes for Lint report - generate absolute filenames pointing to existing files
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 253
diff changeset
    45
2ca2606e89e8 Fixes for Lint report - generate absolute filenames pointing to existing files
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 253
diff changeset
    46
    "Created: / 07-10-2011 / 10:40:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
253
0b7dd037aeb2 Fixes for Lint report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 66
diff changeset
    47
! !
0b7dd037aeb2 Fixes for Lint report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 66
diff changeset
    48
66
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    49
!LintReportFormat::CheckStyle class methodsFor:'accessing'!
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    50
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    51
symbolicNames
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    52
    "Returns a collection of symbolic names for this format"
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    53
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    54
    ^#(checkstyle)
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    55
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    56
    "Modified: / 04-08-2011 / 14:23:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    57
! !
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    58
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    59
!LintReportFormat::CheckStyle methodsFor:'accessing - defaults'!
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    60
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    61
defaultFileSuffix
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    62
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    63
    ^ 'xml'
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    64
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    65
    "Modified: / 08-10-2011 / 10:47:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    66
! !
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    67
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    68
!LintReportFormat::CheckStyle methodsFor:'writing'!
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    69
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    70
writeFile: filename with: block
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    71
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    72
    "Writes a section for given file"
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    73
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    74
    stream tab; nextPutAll:'<file name="'; nextPutAll:filename; nextPutAll: '">'; cr.
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    75
    block valueWithOptionalArgument: self.
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    76
    stream tab; nextPutAll:'</file>'; cr.
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    77
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    78
    "Created: / 07-10-2011 / 10:40:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    79
!
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    80
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    81
writeFooter
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    82
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    83
    stream nextPutAll: '</checkstyle>'
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    84
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    85
    "Modified: / 04-08-2011 / 14:42:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    86
!
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    87
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    88
writeHeader
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    89
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    90
    stream nextPutAll: '<?xml version="1.0" encoding="UTF-8"?>'; nextPut: Character lf.
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    91
    stream nextPutAll: '<checkstyle version="5.4">'; nextPut: Character lf.
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    92
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    93
    "Modified: / 06-10-2011 / 23:50:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    94
!
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    95
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    96
writeViolation:rule class: aClass selector: aSelector startLine:line column:column stopLine:lineStop column:columnStop
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    97
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    98
    | severity |
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    99
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   100
    rule severity = #information ifTrue:[
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   101
        severity := 'info'
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   102
    ] ifFalse:[
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   103
        rule severity = #warning ifTrue:[
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   104
            severity := 'warning'
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   105
        ] ifFalse:[
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   106
            severity := 'error'
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   107
        ]
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   108
    ].
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   109
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   110
    stream tab; tab; nextPutAll:'<error'.
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   111
    stream nextPutAll:' source="'; nextPutAll:(self encode:rule class name); nextPut:$".
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   112
    stream nextPutAll:' message="'; nextPutAll:(self encode:rule name ); nextPut:$".
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   113
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   114
    stream nextPutAll:' severity="'; nextPutAll: severity; nextPut:$".
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   115
    stream nextPutAll:' line="'; nextPutAll:line printString; nextPut:$".
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   116
    column <= 1 ifFalse:[
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   117
        stream nextPutAll:' column="'; nextPutAll:column printString; nextPut:$"
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   118
    ].
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   119
    stream nextPutAll:'/>'; cr.
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   120
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   121
    "Created: / 25-11-2011 / 22:23:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   122
! !
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   123
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   124
!LintReportFormat::PMD methodsFor:'accessing - defaults'!
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   125
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   126
defaultFileSuffix
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   127
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   128
    ^ 'xml'
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   129
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   130
    "Modified: / 08-10-2011 / 10:47:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   131
! !
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   132
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   133
!LintReportFormat::PMD methodsFor:'writing'!
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   134
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   135
writeFooter
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   136
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   137
    stream nextPutAll: '</pmd>'
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   138
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   139
    "Modified: / 25-11-2011 / 19:38:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   140
!
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   141
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   142
writeHeader
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   143
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   144
    stream nextPutAll: '<?xml version="1.0" encoding="UTF-8"?>'; nextPut: Character lf.
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   145
    stream 
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   146
        nextPutAll: '<pmd version="4.3" timestamp="'; 
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   147
        nextPutAll: Timestamp now printString;
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   148
        nextPutAll:'">';
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   149
        nextPut: Character lf.
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   150
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   151
    "Modified: / 25-11-2011 / 19:39:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   152
!
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   153
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   154
writeViolation:rule class: aClass selector: aSelector startLine:beginLine column:beginColumn stopLine:endLine column:endColumn
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   155
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   156
    | priority |
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   157
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   158
    rule severity = #information ifTrue:[
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   159
        priority := '1'
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   160
    ] ifFalse:[
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   161
        rule severity = #warning ifTrue:[
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   162
            priority := '2'
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   163
        ] ifFalse:[
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   164
            priority := '3'
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   165
        ]
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   166
    ].
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   167
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   168
    stream nextPutAll:'<violation '.
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   169
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   170
    stream nextPutAll:'beginline="';nextPutAll: beginLine printString; nextPut:$"; cr.
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   171
    stream nextPutAll:'begincolumn="';nextPutAll: beginColumn printString; nextPut:$"; cr.
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   172
    stream nextPutAll:'endline="';nextPutAll: endLine printString; nextPut:$"; cr.
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   173
    stream nextPutAll:'endcolumn="';nextPutAll: endColumn printString; nextPut:$"; cr.
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   174
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   175
    stream nextPutAll:'rule="';nextPutAll: (self encode:rule class name); nextPut:$"; cr.
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   176
    stream nextPutAll:'ruleset="';nextPutAll: (self encode:rule group); nextPut:$"; cr.
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   177
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   178
    stream nextPutAll:'package="';nextPutAll: aClass package; nextPut:$"; cr.
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   179
    stream nextPutAll:'class="';nextPutAll: aClass name; nextPut:$"; cr.
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   180
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   181
    aSelector notNil ifTrue:[
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   182
        stream nextPutAll:'method="';nextPutAll: aSelector; nextPut:$"; cr.
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   183
    ].
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   184
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   185
    stream nextPutAll:'><!![CDATA['; cr.
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   186
    stream nextPutAll: (self encode: rule rationale); cr.
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   187
    stream nextPutAll:']]></violation>'; cr; cr.
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   188
    stream flush.
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   189
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   190
    "Created: / 25-11-2011 / 22:28:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   191
! !
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   192
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   193
!LintReportFormat class methodsFor:'documentation'!
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   194
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   195
version
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   196
    ^ '$Header$'
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   197
!
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   198
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   199
version_CVS
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   200
    ^ '$Header$'
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   201
!
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   202
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   203
version_SVN
253
0b7dd037aeb2 Fixes for Lint report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 66
diff changeset
   204
    ^ '$Id$'
66
7d2a9fc67612 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   205
! !
253
0b7dd037aeb2 Fixes for Lint report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 66
diff changeset
   206