Kotlin / binary-compatibility-validator

Public API management tool
Apache License 2.0
800 stars 59 forks source link

Group dumped declaration by declaration kind (class, function, property, etc.) #224

Closed fzhinkin closed 3 months ago

fzhinkin commented 5 months ago

Currently, all dumped declarations are sorted lexicographically, potentially by mixing different kinds of declarations. That approach differs from what we do for JVM dumps, where declarations are grouped by a declaration kind.

With this change, declarations will be ordered as follows:

This PR introduces the following order:

Closes #197

ilya-g commented 3 months ago

I have a feeling that the sorting test doesn't specifically test sorting inside groups. For example, try replacing lhs.text.compareTo(rhs.text) with 0 and see if there will be failures to sort declarations inside groups.

fzhinkin commented 3 months ago

@ilya-g using a fixed value instead of lhs.text.compareTo(rhs.text) leads to test failures (both unit- and functional-tests).

But I agree that a test explicitly covering ordering is missing, I'll add it.