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

[rule request] enforce the order of final along with ACL of classes #1472

Closed
masters3d opened this issue Apr 28, 2017 · 2 comments · Fixed by #1501
Closed

[rule request] enforce the order of final along with ACL of classes #1472

masters3d opened this issue Apr 28, 2017 · 2 comments · Fixed by #1501
Labels
rule-request Requests for a new rules.

Comments

@masters3d
Copy link
Contributor

optional rule to enforce order of final of classes in a code base

internal final class MyClass {}
or
final public class MyClass {}

This could probably be done by using a regex to check both possibilities and suggest one or the other depending on preferences. A regex could also catch multiline declarations

import Foundation

public
final class MyClass{}

<ws*>public|internal<ws*>final<ws*>class<ws*>
<ws*>final<ws*>public|internal<ws*>class<ws*>

This rule doesn't seek to introduce final, only to make the declaration consistent for readability
This is different than #228

@marcelofabri
Copy link
Collaborator

Subset of #387?

@marcelofabri marcelofabri added the rule-request Requests for a new rules. label Apr 30, 2017
@masters3d
Copy link
Contributor Author

Yes. Subset. I guess we could also include weak but not attributes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rule-request Requests for a new rules.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants