rspec/rules/S2950/swift/rule.adoc

31 lines
610 B
Plaintext
Raw Normal View History

2021-04-28 16:49:39 +02:00
The access level defaults to ``++internal++`` if left unspecified. Since that doesn't make sense for most top-level declarations, access levels should always be specified explicitly, even when ``++internal++`` is what's intended.
This rule raises an issue when the access level is not specified on any top-level declaration.
2021-04-28 16:49:39 +02:00
== Noncompliant Code Example
----
class Foo { // Noncompliant
// ...
}
----
2021-04-28 16:49:39 +02:00
== Compliant Solution
----
public class Foo {
// ...
}
----
ifdef::rspecator-view[]
== Comments And Links
(visible only on this page)
include::comments-and-links.adoc[]
endif::rspecator-view[]