SmallSense__SmalltalkChecker.st
author Claus Gittinger <cg@exept.de>
Fri, 25 Mar 2016 16:41:21 +0100
branchcvs_MAIN
changeset 931 9198e15fb1e8
parent 898 05d5c416c3c9
child 967 e39915970657
permissions -rw-r--r--
cvs version
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
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
     3
Copyright (C) 2013-2014 Jan Vrany
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
     4
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
     5
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
     6
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
     7
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
     8
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
     9
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    10
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
    11
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
    12
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
    13
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
    14
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    15
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
    16
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
    17
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
    18
"
249
8bc64027b189 Package renamed to stx:goodies/smallsense
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 174
diff changeset
    19
"{ Package: 'stx:goodies/smallsense' }"
64
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    20
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    21
"{ NameSpace: SmallSense }"
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    22
67
020b7461b15e Package structure reorganization.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 64
diff changeset
    23
SmalllintChecker subclass:#SmalltalkChecker
64
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    24
	instanceVariableNames:''
462
aa8c08f70405 initial checkin
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
    25
	classVariableNames:'Errors UserDisabledRules'
64
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    26
	poolDictionaries:''
67
020b7461b15e Package structure reorganization.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 64
diff changeset
    27
	category:'SmallSense-Smalltalk-Lint'
64
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    28
!
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    29
67
020b7461b15e Package structure reorganization.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 64
diff changeset
    30
!SmalltalkChecker class methodsFor:'documentation'!
64
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    31
252
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    32
copyright
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    33
"
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    34
stx:goodies/smallsense - A productivity plugin for Smalltalk/X IDE
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    35
Copyright (C) 2013-2014 Jan Vrany
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    36
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    37
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
    38
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
    39
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
    40
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
    41
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    42
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
    43
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
    44
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
    45
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
    46
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    47
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
    48
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
    49
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
    50
"
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    51
!
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    52
64
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    53
documentation
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    54
"
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    55
    SmallSenseChecker is customized SmalllintChecker used
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    56
    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
    57
    code, use SmalllintChecker instead.
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
    [author:]
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    60
        Jan Vrany <jan.vrany@fit.cvut.cz>
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    61
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    62
    [instance variables:]
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    63
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    64
    [class variables:]
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
    [see also:]
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    67
        SmalllintChecker
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    68
        SmallSenseService
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
"
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    71
! !
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    72
67
020b7461b15e Package structure reorganization.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 64
diff changeset
    73
!SmalltalkChecker class methodsFor:'initialization'!
64
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
initialize
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    76
    "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
    77
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    78
    "/ 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
    79
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    80
    Errors := Dictionary new.
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
    "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
    83
! !
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    84
67
020b7461b15e Package structure reorganization.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 64
diff changeset
    85
!SmalltalkChecker class methodsFor:'accessing'!
64
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    86
462
aa8c08f70405 initial checkin
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
    87
disableRule:aRuleClass
aa8c08f70405 initial checkin
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
    88
    "add a rule to the user-disabled rule set;
aa8c08f70405 initial checkin
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
    89
     These will also be skipped."
aa8c08f70405 initial checkin
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
    90
aa8c08f70405 initial checkin
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
    91
    UserDisabledRules isNil ifTrue:[
aa8c08f70405 initial checkin
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
    92
        UserDisabledRules := Set new.
aa8c08f70405 initial checkin
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
    93
    ].
aa8c08f70405 initial checkin
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
    94
    UserDisabledRules add:aRuleClass.
aa8c08f70405 initial checkin
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
    95
!
aa8c08f70405 initial checkin
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
    96
64
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    97
forceDisabledRules
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    98
    "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
    99
     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
   100
     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
   101
     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
   102
     Add with care!!!!!!
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   103
    "
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   104
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   105
    ^ #(
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   106
        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
   107
        RBImplementedNotSentRule    "/ Uses Context>>#computeLiterals whichs toooo slow.
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   108
        RBSentNotImplementedRule    "/ Uses Context>>#computeLiterals whichs toooo slow.
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   109
        RBUndeclaredReferenceRule   "/
287
f65e37b6bd77 Temporary workaround: force disable more rules when running background lint
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   110
f65e37b6bd77 Temporary workaround: force disable more rules when running background lint
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   111
        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
   112
        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
   113
    )
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
    "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
   116
    "Modified: / 30-09-2014 / 11:59:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
462
aa8c08f70405 initial checkin
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   117
!
aa8c08f70405 initial checkin
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   118
aa8c08f70405 initial checkin
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   119
isRuleDisabled:aRuleClass
aa8c08f70405 initial checkin
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   120
    ^ UserDisabledRules notNil and:[ UserDisabledRules includes: aRuleClass ]
aa8c08f70405 initial checkin
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   121
!
aa8c08f70405 initial checkin
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   122
aa8c08f70405 initial checkin
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   123
reEnableAllDisabledRules
aa8c08f70405 initial checkin
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   124
    UserDisabledRules := nil
64
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   125
! !
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   126
67
020b7461b15e Package structure reorganization.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 64
diff changeset
   127
!SmalltalkChecker methodsFor:'private'!
64
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   128
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   129
checkClass: aClass 
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   130
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   131
    "Nothing to do, SmallSense checker checks only methods"
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   132
    context selectedClass: aClass.
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   133
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   134
    "Created: / 16-02-2012 / 16:12:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   135
!
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   136
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   137
checkMethodsForClass: aClass
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   138
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   139
    environment selectorsForClass: aClass do: [:sel|
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   140
        context selector: sel.
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   141
        context parseTree notNil ifTrue:[
462
aa8c08f70405 initial checkin
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   142
            rule flattened do:[:eachRule|
aa8c08f70405 initial checkin
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   143
                (SmalltalkChecker isRuleDisabled:eachRule class) ifTrue:[
aa8c08f70405 initial checkin
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   144
                    Transcript show:'rule '; show:eachRule class name; showCR:' disabled'.
aa8c08f70405 initial checkin
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   145
                ] ifFalse:[
aa8c08f70405 initial checkin
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   146
                    [
aa8c08f70405 initial checkin
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   147
                        eachRule checkMethod: context.
aa8c08f70405 initial checkin
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   148
                    ] on: Error do:[:ex|
aa8c08f70405 initial checkin
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   149
                        SmalltalkLintService debugging ifTrue:[
aa8c08f70405 initial checkin
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   150
                            SmalltalkLintService debugging: false.
aa8c08f70405 initial checkin
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   151
                            ex pass.
aa8c08f70405 initial checkin
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   152
                        ] ifFalse:[
aa8c08f70405 initial checkin
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   153
                            Errors at: eachRule class ifAbsentPut:[  (context selectedClass compiledMethodAt: context selector) source ].
aa8c08f70405 initial checkin
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   154
                        ]
64
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   155
                    ]
462
aa8c08f70405 initial checkin
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   156
                ].
64
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   157
            ].
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>"
294
b9f4fc5828e3 Oops, fix in SmalltalkChecker.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 287
diff changeset
   163
    "Modified (format): / 16-10-2014 / 01:08:59 / 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
   164
! !
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   165
67
020b7461b15e Package structure reorganization.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 64
diff changeset
   166
!SmalltalkChecker class methodsFor:'documentation'!
64
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   167
462
aa8c08f70405 initial checkin
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   168
version
898
05d5c416c3c9 Fix version_CVS
Stefan Vogel <sv@exept.de>
parents: 462
diff changeset
   169
    ^ '$Header$'
462
aa8c08f70405 initial checkin
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   170
!
aa8c08f70405 initial checkin
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   171
aa8c08f70405 initial checkin
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   172
version_CVS
898
05d5c416c3c9 Fix version_CVS
Stefan Vogel <sv@exept.de>
parents: 462
diff changeset
   173
    ^ '$Header$'
462
aa8c08f70405 initial checkin
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   174
!
aa8c08f70405 initial checkin
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   175
64
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   176
version_HG
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
    ^ '$Changeset: <not expanded> $'
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   179
!
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   180
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   181
version_SVN
898
05d5c416c3c9 Fix version_CVS
Stefan Vogel <sv@exept.de>
parents: 462
diff changeset
   182
    ^ '$Id$'
64
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   183
! !
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   184
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   185
67
020b7461b15e Package structure reorganization.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 64
diff changeset
   186
SmalltalkChecker initialize!