-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
user-customizable code critics #16
Comments
Another example is (also taken from Roassal)
with critic "Possible three element point". |
Thanks for another use-case. Maybe this rule should be removed altogether, as I doubt that it provides actual help. As a side note:
|
Well then the question is then who is the target user. I would say that people that work with the code regularly need it much more than people that occasionally look at the code and thus it should cater more to them. So if someone doesn't know Roassal API then I don't think that I want him to touch my roassal-related code. And technically speaking I am sending it to the result, I just know what the result is. |
I have another case: in PetitParser when creating delegate parsers (subclasses of In addition the critic says "[...] Instance variables not read AND written", which is false, because they are read from. |
@peteruhnak thanks for mentioning this. I've already noticed that PetitParser is a good place to work on customizability of the rules, as there are many of them that criticize PP as it uses plenty of metaprogramming. As for "Instance variables not read AND written" it's again a very bad naming of the rule that does not explain the real issue. I still have to figure out what the rule does and how to rename it :) |
I would also propose to ignore Plus the name of the rule doesn't make sense on the class-side, because |
@peteruhnak can you give me a roassal class for example? So I can get a better understanding |
Looking back through it.... most examples are actually moved to separate Look at the following methods classes := Object withAllSubclasses select: [ :each | each className beginsWith: 'RT' ] thenCollect: #theMetaClass.
((classes flatCollect: #methods) select: [ :each |
each selector beginsWith: 'example' ])
select: [ :each |
each critics detect: [ :re | re rule isMemberOf: RBRefersToClassRule ] ifFound: [ true ] ifNone: [ false ] ] For example |
In Roassal there's very common pattern
so I am in fact returning an instance of
RTElement
and not the receiver.Of course QA says missing ";yourself".
This would require to be able to specify conditions for the code critic, such as
if receiver is subclass of RTShape then don't apply this (yourself) rule
The text was updated successfully, but these errors were encountered: