What is the use of LibraryEntitiesShouldNotBePublic Detekt Rule in Kotlin

191 views Asked by At

I have a Kotlin Library into which I integrated the usage of Detekt static code linting. Most of the rules are clear to me and I fixed all the issues with my code except for one:

There is a rule called LibraryEntitiesShouldNotBePublic, which makes no sense in my opinion. It tells me for every public class, that it should not be public, but of what use is a library without any public classes.

I must admit I am rather new to Kotlin, coming from Java, so I might miss some language feature here.

Any hints would be greatly appreciated. Thanks.

1

There are 1 answers

0
MainS On BEST ANSWER

You can just use exclude or ignorePackages properties to specify the classes/packages that need to be public for library API.

So, no other class cannot be suggested to user.

Thus, it is easy to track which classes will be suggested to user.