Skip to content
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

Strange rule: initialize used in accessing related rule #16516

Open
Ducasse opened this issue Apr 24, 2024 · 1 comment
Open

Strange rule: initialize used in accessing related rule #16516

Ducasse opened this issue Apr 24, 2024 · 1 comment

Comments

@Ducasse
Copy link
Member

Ducasse commented Apr 24, 2024

I got the following rule violation for initialize and it does not make sense.

Capture 2024-04-24 at 21 13 17
@astares
Copy link
Member

astares commented Apr 24, 2024

I guess this happens anytime you put a method with an unary selector that does not return anything into the "accessing" category.

Maybe the idea behind this critique was that "accessing" typically hosts getters (unary) and setter methods (keyword) and laments when the getter forgets a return. So it looks at the #initialize when it is in "accessing" protocol as a kind of getter method as it is also unary. So it gives the warning that you might have forgotten the return for the getter.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants