rspec/rules/S2950/swift/rule.adoc
Fred Tingaud 16f6c0aecf
Inline adoc when include has no additional value (#1940)
Inline adoc files when they are included exactly once.

Also fix language tags because this inlining gives us better information
on what language the code is written in.
2023-05-25 14:18:12 +02:00

47 lines
825 B
Plaintext

== Why is this an issue?
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.
=== Noncompliant code example
[source,swift]
----
class Foo { // Noncompliant
// ...
}
----
=== Compliant solution
[source,swift]
----
public class Foo {
// ...
}
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
=== Message
Add an access control specifier to this [xxx] declaration.
'''
== Comments And Links
(visible only on this page)
=== is related to: S2039
endif::env-github,rspecator-view[]