SmallSense__SmalltalkChecker.st
author Jan Vrany <jan.vrany@labware.com>
Tue, 16 Aug 2022 15:23:21 +0100
changeset 1142 cb1477d8404d
parent 1072 a44c741ee5ef
permissions -rw-r--r--
Keep environment (being checked) in `SmalllintContext`
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
252
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
     1
"
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
     2
stx:goodies/smallsense - A productivity plugin for Smalltalk/X IDE
374
e65bd2bf892a Updated copyright notice.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 294
diff changeset
     3
Copyright (C) 2013-2015 Jan Vrany
1072
a44c741ee5ef Copyright updates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 936
diff changeset
     4
Copyright (C) 2016 Jan Vrany
1142
cb1477d8404d Keep environment (being checked) in `SmalllintContext`
Jan Vrany <jan.vrany@labware.com>
parents: 1072
diff changeset
     5
Copyright (C) 2022 LabWare
252
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
     6
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
     7
This library is free software; you can redistribute it and/or
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
     8
modify it under the terms of the GNU Lesser General Public
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
     9
License as published by the Free Software Foundation; either
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    10
version 2.1 of the License. 
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    11
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    12
This library is distributed in the hope that it will be useful,
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    13
but WITHOUT ANY WARRANTY; without even the implied warranty of
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    14
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    15
Lesser General Public License for more details.
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    16
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    17
You should have received a copy of the GNU Lesser General Public
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    18
License along with this library; if not, write to the Free Software
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    19
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    20
"
249
8bc64027b189 Package renamed to stx:goodies/smallsense
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 174
diff changeset
    21
"{ Package: 'stx:goodies/smallsense' }"
64
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    22
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    23
"{ NameSpace: SmallSense }"
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    24
67
020b7461b15e Package structure reorganization.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 64
diff changeset
    25
SmalllintChecker subclass:#SmalltalkChecker
64
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    26
	instanceVariableNames:''
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    27
	classVariableNames:'Errors'
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    28
	poolDictionaries:''
67
020b7461b15e Package structure reorganization.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 64
diff changeset
    29
	category:'SmallSense-Smalltalk-Lint'
64
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    30
!
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    31
67
020b7461b15e Package structure reorganization.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 64
diff changeset
    32
!SmalltalkChecker class methodsFor:'documentation'!
64
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    33
252
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    34
copyright
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    35
"
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    36
stx:goodies/smallsense - A productivity plugin for Smalltalk/X IDE
374
e65bd2bf892a Updated copyright notice.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 294
diff changeset
    37
Copyright (C) 2013-2015 Jan Vrany
1072
a44c741ee5ef Copyright updates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 936
diff changeset
    38
Copyright (C) 2016 Jan Vrany
1142
cb1477d8404d Keep environment (being checked) in `SmalllintContext`
Jan Vrany <jan.vrany@labware.com>
parents: 1072
diff changeset
    39
Copyright (C) 2022 LabWare
252
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    40
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    41
This library is free software; you can redistribute it and/or
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    42
modify it under the terms of the GNU Lesser General Public
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    43
License as published by the Free Software Foundation; either
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    44
version 2.1 of the License. 
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    45
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    46
This library is distributed in the hope that it will be useful,
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    47
but WITHOUT ANY WARRANTY; without even the implied warranty of
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    48
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    49
Lesser General Public License for more details.
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    50
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    51
You should have received a copy of the GNU Lesser General Public
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    52
License along with this library; if not, write to the Free Software
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    53
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    54
"
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    55
!
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    56
64
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    57
documentation
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    58
"
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    59
    SmallSenseChecker is customized SmalllintChecker used
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    60
    by SmallSense's checking services. Do not use it in your
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    61
    code, use SmalllintChecker instead.
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    62
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    63
    [author:]
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    64
        Jan Vrany <jan.vrany@fit.cvut.cz>
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    65
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    66
    [instance variables:]
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    67
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    68
    [class variables:]
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    69
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    70
    [see also:]
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    71
        SmalllintChecker
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    72
        SmallSenseService
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    73
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    74
"
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    75
! !
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    76
67
020b7461b15e Package structure reorganization.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 64
diff changeset
    77
!SmalltalkChecker class methodsFor:'initialization'!
64
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    78
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    79
initialize
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    80
    "Invoked at system start or when the class is dynamically loaded."
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    81
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    82
    "/ please change as required (and remove this comment)
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    83
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    84
    Errors := Dictionary new.
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    85
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    86
    "Modified: / 06-09-2012 / 14:18:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    87
! !
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    88
67
020b7461b15e Package structure reorganization.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 64
diff changeset
    89
!SmalltalkChecker class methodsFor:'accessing'!
64
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    90
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    91
forceDisabledRules
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    92
    "Return a list of rule class names that
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    93
     are never run by SmallSense's checker - they
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    94
     are either buggy (i.e.. not ready to be run
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    95
     incrementally) or it does not make sense to run them
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    96
     Add with care!!!!!!
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    97
    "
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    98
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    99
    ^ #(
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   100
        RBLawOfDemeterRule          "/ Too many false positives, hard to fix
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   101
        RBImplementedNotSentRule    "/ Uses Context>>#computeLiterals whichs toooo slow.
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   102
        RBSentNotImplementedRule    "/ Uses Context>>#computeLiterals whichs toooo slow.
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   103
        RBUndeclaredReferenceRule   "/
287
f65e37b6bd77 Temporary workaround: force disable more rules when running background lint
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   104
f65e37b6bd77 Temporary workaround: force disable more rules when running background lint
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   105
        RBNilOrEmptyCollectionReplaceRule   "/ only for Squeak - I don't want people to rewrite ST/X code
f65e37b6bd77 Temporary workaround: force disable more rules when running background lint
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   106
        RBSTXSpecialCommentsRule            "/ a rewriter to be used only for porting
64
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   107
    )
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   108
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   109
    "Created: / 17-02-2012 / 13:10:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
287
f65e37b6bd77 Temporary workaround: force disable more rules when running background lint
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   110
    "Modified: / 30-09-2014 / 11:59:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
64
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   111
! !
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   112
67
020b7461b15e Package structure reorganization.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 64
diff changeset
   113
!SmalltalkChecker methodsFor:'private'!
64
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   114
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   115
checkClass: aClass 
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   116
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   117
    "Nothing to do, SmallSense checker checks only methods"
1142
cb1477d8404d Keep environment (being checked) in `SmalllintContext`
Jan Vrany <jan.vrany@labware.com>
parents: 1072
diff changeset
   118
    context environment: environment.
64
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   119
    context selectedClass: aClass.
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   120
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   121
    "Created: / 16-02-2012 / 16:12:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1142
cb1477d8404d Keep environment (being checked) in `SmalllintContext`
Jan Vrany <jan.vrany@labware.com>
parents: 1072
diff changeset
   122
    "Modified: / 16-08-2022 / 15:19:05 / Jan Vrany <jan.vrany@labware.com>"
64
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   123
!
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   124
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   125
checkMethodsForClass: aClass
1142
cb1477d8404d Keep environment (being checked) in `SmalllintContext`
Jan Vrany <jan.vrany@labware.com>
parents: 1072
diff changeset
   126
    context environment: environment.
64
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   127
    environment selectorsForClass: aClass do: [:sel|
1142
cb1477d8404d Keep environment (being checked) in `SmalllintContext`
Jan Vrany <jan.vrany@labware.com>
parents: 1072
diff changeset
   128
        [   | tree |
936
f853d055ac7a Lint: Do not bark on explicitly suppressed rules
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 381
diff changeset
   129
1142
cb1477d8404d Keep environment (being checked) in `SmalllintContext`
Jan Vrany <jan.vrany@labware.com>
parents: 1072
diff changeset
   130
            context selectedClass: aClass.
cb1477d8404d Keep environment (being checked) in `SmalllintContext`
Jan Vrany <jan.vrany@labware.com>
parents: 1072
diff changeset
   131
            context selector: sel.
cb1477d8404d Keep environment (being checked) in `SmalllintContext`
Jan Vrany <jan.vrany@labware.com>
parents: 1072
diff changeset
   132
            (tree := context parseTree) notNil ifTrue:[
cb1477d8404d Keep environment (being checked) in `SmalllintContext`
Jan Vrany <jan.vrany@labware.com>
parents: 1072
diff changeset
   133
                | ignored |
936
f853d055ac7a Lint: Do not bark on explicitly suppressed rules
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 381
diff changeset
   134
1142
cb1477d8404d Keep environment (being checked) in `SmalllintContext`
Jan Vrany <jan.vrany@labware.com>
parents: 1072
diff changeset
   135
                ignored := tree pragmas 
cb1477d8404d Keep environment (being checked) in `SmalllintContext`
Jan Vrany <jan.vrany@labware.com>
parents: 1072
diff changeset
   136
                                select:[:e|e selector = #ignore:rationale:author:]
cb1477d8404d Keep environment (being checked) in `SmalllintContext`
Jan Vrany <jan.vrany@labware.com>
parents: 1072
diff changeset
   137
                                thenCollect: [:e | e arguments first value ].
cb1477d8404d Keep environment (being checked) in `SmalllintContext`
Jan Vrany <jan.vrany@labware.com>
parents: 1072
diff changeset
   138
                rule flattened do:[:each|
cb1477d8404d Keep environment (being checked) in `SmalllintContext`
Jan Vrany <jan.vrany@labware.com>
parents: 1072
diff changeset
   139
                    [
cb1477d8404d Keep environment (being checked) in `SmalllintContext`
Jan Vrany <jan.vrany@labware.com>
parents: 1072
diff changeset
   140
                        (ignored includes: each class name) ifFalse:[
cb1477d8404d Keep environment (being checked) in `SmalllintContext`
Jan Vrany <jan.vrany@labware.com>
parents: 1072
diff changeset
   141
                            each checkMethod: context.
cb1477d8404d Keep environment (being checked) in `SmalllintContext`
Jan Vrany <jan.vrany@labware.com>
parents: 1072
diff changeset
   142
                        ] ifTrue:[ 
cb1477d8404d Keep environment (being checked) in `SmalllintContext`
Jan Vrany <jan.vrany@labware.com>
parents: 1072
diff changeset
   143
                            "/self halt.
cb1477d8404d Keep environment (being checked) in `SmalllintContext`
Jan Vrany <jan.vrany@labware.com>
parents: 1072
diff changeset
   144
                        ].
cb1477d8404d Keep environment (being checked) in `SmalllintContext`
Jan Vrany <jan.vrany@labware.com>
parents: 1072
diff changeset
   145
                    ] on: Error do:[:ex|
cb1477d8404d Keep environment (being checked) in `SmalllintContext`
Jan Vrany <jan.vrany@labware.com>
parents: 1072
diff changeset
   146
                        SmalltalkLintService debugging ifTrue:[
cb1477d8404d Keep environment (being checked) in `SmalllintContext`
Jan Vrany <jan.vrany@labware.com>
parents: 1072
diff changeset
   147
                            SmalltalkLintService debugging: false.
cb1477d8404d Keep environment (being checked) in `SmalllintContext`
Jan Vrany <jan.vrany@labware.com>
parents: 1072
diff changeset
   148
                            ex pass.
cb1477d8404d Keep environment (being checked) in `SmalllintContext`
Jan Vrany <jan.vrany@labware.com>
parents: 1072
diff changeset
   149
                        ] ifFalse:[
cb1477d8404d Keep environment (being checked) in `SmalllintContext`
Jan Vrany <jan.vrany@labware.com>
parents: 1072
diff changeset
   150
                            Errors at: each class ifAbsentPut:[  (context selectedClass compiledMethodAt: context selector) source ].
cb1477d8404d Keep environment (being checked) in `SmalllintContext`
Jan Vrany <jan.vrany@labware.com>
parents: 1072
diff changeset
   151
                        ]
64
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   152
                    ]
1142
cb1477d8404d Keep environment (being checked) in `SmalllintContext`
Jan Vrany <jan.vrany@labware.com>
parents: 1072
diff changeset
   153
                ].
64
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   154
            ].
1142
cb1477d8404d Keep environment (being checked) in `SmalllintContext`
Jan Vrany <jan.vrany@labware.com>
parents: 1072
diff changeset
   155
        ] ensure: [ 
cb1477d8404d Keep environment (being checked) in `SmalllintContext`
Jan Vrany <jan.vrany@labware.com>
parents: 1072
diff changeset
   156
            context selectedClass: nil.
cb1477d8404d Keep environment (being checked) in `SmalllintContext`
Jan Vrany <jan.vrany@labware.com>
parents: 1072
diff changeset
   157
            context selector: nil.        
64
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   158
        ].
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   159
    ]
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   160
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   161
    "Modified: / 24-08-2010 / 21:32:39 / Jan Vrany <enter your email here>"
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   162
    "Created: / 17-02-2012 / 00:50:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
936
f853d055ac7a Lint: Do not bark on explicitly suppressed rules
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 381
diff changeset
   163
    "Modified: / 06-04-2016 / 04:47:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1142
cb1477d8404d Keep environment (being checked) in `SmalllintContext`
Jan Vrany <jan.vrany@labware.com>
parents: 1072
diff changeset
   164
    "Modified: / 16-08-2022 / 15:21:09 / Jan Vrany <jan.vrany@labware.com>"
64
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   165
! !
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   166
67
020b7461b15e Package structure reorganization.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 64
diff changeset
   167
!SmalltalkChecker class methodsFor:'documentation'!
64
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   168
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   169
version_HG
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   170
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   171
    ^ '$Changeset: <not expanded> $'
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   172
!
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   173
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   174
version_SVN
320
5242593726f0 Updated from upstream repository to revision 0a4845a0c211
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 294
diff changeset
   175
    ^ '$Id$'
64
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   176
! !
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   177
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   178
67
020b7461b15e Package structure reorganization.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 64
diff changeset
   179
SmalltalkChecker initialize!