Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[Rule request] Internal as private #2503

Open
2 tasks done
kimdv opened this issue Dec 5, 2018 · 2 comments
Open
2 tasks done

[Rule request] Internal as private #2503

kimdv opened this issue Dec 5, 2018 · 2 comments
Labels
rule-request Requests for a new rules.

Comments

@kimdv
Copy link
Contributor

kimdv commented Dec 5, 2018

New Issue Checklist

New rule request

Please describe the rule idea, format
this issue's title as Rule Request: [Rule Name] and describe:
When a method is internal but not used outside of class the rule should warn to make it private.

Provide several examples of what would and wouldn't trigger violations.

Nontrigger

 """
class Foo {
    func bar() { }
}

let foo = Foo()
foo.bar()
"""

Trigger

 """
class Foo {
    func bar() { }
    private func baz() {
        bar()
    }
}

"""

Should the rule be opt-in or enabled by default? Why?
Because it is analyzer rule it should be opt-in.

@jpsim
Copy link
Collaborator

jpsim commented Dec 6, 2018

I think this will require multifile support.

@marcelofabri marcelofabri added the rule-request Requests for a new rules. label Dec 25, 2018
@jorgealegre
Copy link

I would love to have this.

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

No branches or pull requests

4 participants