rspec/rules/S1986/rule.adoc
Arseniy Zaostrovnykh 7ca29f686f Force linebreaks
2021-02-02 15:02:10 +01:00

30 lines
634 B
Plaintext

Shared coding conventions allow teams to collaborate efficiently. This rule checks that curly braces are omitted from interfaces with no instance variables.
Using curly braces in such a situation means that the reader of the code must pause to find the close curly brace before understanding that there are no variables. On the other hand, omitting the curly braces is a quick, clear indicator that there are no variables.
== Noncompliant Code Example
----
@interface Foo : NSObject { // Noncompliant
}
-(void) doSomething;
@end
----
== Compliant Solution
----
@interface Foo : NSObject
-(void) doSomething;
@end
----