SmallSense__SmalltalkChecker.st
author Stefan Vogel <sv@exept.de>
Mon, 04 Mar 2019 13:09:59 +0100
branchcvs_MAIN
changeset 1085 a22655fd60b5
parent 1012 ec316e0316af
permissions -rw-r--r--
#REFACTORING by stefan class: SmallSense::AbstractJavaCompletionEngineSimple changed: #guessTypeOfExpressionBefore:in: fixed shadowed var
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
967
e39915970657 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 898
diff changeset
   125
!
e39915970657 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 898
diff changeset
   126
e39915970657 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 898
diff changeset
   127
userDisabledRules
e39915970657 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 898
diff changeset
   128
    "return the list of rules which the user disabled explicitly"
e39915970657 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 898
diff changeset
   129
e39915970657 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 898
diff changeset
   130
    ^ UserDisabledRules
64
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   131
! !
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   132
67
020b7461b15e Package structure reorganization.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 64
diff changeset
   133
!SmalltalkChecker methodsFor:'private'!
64
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   134
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   135
checkClass: aClass 
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
    "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
   138
    context selectedClass: aClass.
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   139
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   140
    "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
   141
!
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   142
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   143
checkMethodsForClass: aClass
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   144
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   145
    environment selectorsForClass: aClass do: [:sel|
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   146
        context selector: sel.
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   147
        context parseTree notNil ifTrue:[
462
aa8c08f70405 initial checkin
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   148
            rule flattened do:[:eachRule|
992
325a0108a331 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 967
diff changeset
   149
                |ruleClass|
325a0108a331 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 967
diff changeset
   150
325a0108a331 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 967
diff changeset
   151
                ruleClass := eachRule class. 
325a0108a331 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 967
diff changeset
   152
                (SmalltalkChecker isRuleDisabled:ruleClass) ifTrue:[
325a0108a331 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 967
diff changeset
   153
                    Transcript show:'rule '; show:ruleClass name; showCR:' disabled'.
462
aa8c08f70405 initial checkin
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   154
                ] ifFalse:[
aa8c08f70405 initial checkin
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   155
                    [
1012
ec316e0316af #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 992
diff changeset
   156
                        (eachRule shouldIgnoreMethod:context) ifFalse:[
ec316e0316af #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 992
diff changeset
   157
                            eachRule checkMethod: context.
ec316e0316af #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 992
diff changeset
   158
                        ].    
462
aa8c08f70405 initial checkin
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   159
                    ] on: Error do:[:ex|
aa8c08f70405 initial checkin
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   160
                        SmalltalkLintService debugging ifTrue:[
aa8c08f70405 initial checkin
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   161
                            SmalltalkLintService debugging: false.
aa8c08f70405 initial checkin
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   162
                            ex pass.
aa8c08f70405 initial checkin
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   163
                        ] ifFalse:[
992
325a0108a331 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 967
diff changeset
   164
                            Errors 
325a0108a331 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 967
diff changeset
   165
                                at: ruleClass 
325a0108a331 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 967
diff changeset
   166
                                ifAbsentPut:[  
325a0108a331 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 967
diff changeset
   167
                                    (context selectedClass compiledMethodAt: context selector) source 
325a0108a331 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 967
diff changeset
   168
                                ].
462
aa8c08f70405 initial checkin
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   169
                        ]
64
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   170
                    ]
462
aa8c08f70405 initial checkin
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   171
                ].
64
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
    ]
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   175
1012
ec316e0316af #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 992
diff changeset
   176
    "Modified: / 24-08-2010 / 21:32:39 / Jan Vrany"
64
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   177
    "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
   178
    "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
   179
! !
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   180
67
020b7461b15e Package structure reorganization.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 64
diff changeset
   181
!SmalltalkChecker class methodsFor:'documentation'!
64
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   182
462
aa8c08f70405 initial checkin
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   183
version
898
05d5c416c3c9 Fix version_CVS
Stefan Vogel <sv@exept.de>
parents: 462
diff changeset
   184
    ^ '$Header$'
462
aa8c08f70405 initial checkin
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   185
!
aa8c08f70405 initial checkin
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   186
aa8c08f70405 initial checkin
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   187
version_CVS
898
05d5c416c3c9 Fix version_CVS
Stefan Vogel <sv@exept.de>
parents: 462
diff changeset
   188
    ^ '$Header$'
462
aa8c08f70405 initial checkin
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   189
!
aa8c08f70405 initial checkin
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   190
64
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   191
version_HG
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   192
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   193
    ^ '$Changeset: <not expanded> $'
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   194
!
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   195
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   196
version_SVN
898
05d5c416c3c9 Fix version_CVS
Stefan Vogel <sv@exept.de>
parents: 462
diff changeset
   197
    ^ '$Id$'
64
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   198
! !
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   199
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   200
67
020b7461b15e Package structure reorganization.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 64
diff changeset
   201
SmalltalkChecker initialize!