Skip to content

Commit

Permalink
Linter rule
Browse files Browse the repository at this point in the history
  • Loading branch information
ivojawer committed Jul 31, 2023
1 parent 1c3a3ca commit 23c31f2
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
7 changes: 7 additions & 0 deletions smalltalksrc/VMMaker/RBPragmaNode.extension.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Extension { #name : #RBPragmaNode }

{ #category : #'*VMMaker' }
RBPragmaNode >> isTypeDefinition [

^ self selector = #var:type:
]
26 changes: 26 additions & 0 deletions smalltalksrc/VMMaker/ReSlangRedundantTypeDeclarationRule.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Class {
#name : #ReSlangRedundantTypeDeclarationRule,
#superclass : #ReAbstractRule,
#category : #'VMMaker-Slang'
}

{ #category : #'testing - interest' }
ReSlangRedundantTypeDeclarationRule class >> checksNode [

^ true
]

{ #category : #running }
ReSlangRedundantTypeDeclarationRule >> basicCheck: aNode [

^ aNode isPragma and: [
aNode isTypeDefinition and: [
(aNode methodNode allDefinedVariables includes:
(aNode argumentAt: #var:) value) not ] ]
]

{ #category : #accessing }
ReSlangRedundantTypeDeclarationRule >> name [

^ 'Type declaration for missing local'
]

0 comments on commit 23c31f2

Please sign in to comment.