google / EarlGrey

:tea: iOS UI Automation Test Framework
http://google.github.io/EarlGrey/
Apache License 2.0
5.62k stars 744 forks source link

Rename `GREYRemoteClassInApp(classVal:)` to `GREYRemoteClassInApp(_:)`. #1959

Closed copybara-service[bot] closed 1 year ago

copybara-service[bot] commented 1 year ago

Rename GREYRemoteClassInApp(classVal:) to GREYRemoteClassInApp(_:).

GREYRemoteClassInApp accepts a parameter named classVal that represents the target class. The current usage looks like the following:

GREYRemoteClassInApp(classVal: MyClass.self)

The classVal parameter name seems unnecessary given that the following alternative seems to convey the same amount of information:

GREYRemoteClassInApp(MyClass.self)

The Swift API Design Guidelines say the following:

Omit needless words. Every word in a name should convey salient information at the use site.

More words may be needed to clarify intent or disambiguate meaning, but those that are redundant with information the reader already possesses should be omitted. In particular, omit words that merely repeat type information.

Therefore, I propose that we rename GREYRemoteClassInApp(classVal:) to GREYRemoteClassInApp(_:). This would also make the function consistent with the EarlGrey.remoteClassInApp(_:file:line:) method.