Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply binary compatibility plugin to Detekt #3320

Merged
merged 5 commits into from
Dec 30, 2020
Merged

Conversation

chao2zhang
Copy link
Member

This will help catch API changes like discussed in #3310 (comment)
There is also a temporary workaround to exclude rootProject from compability check. See Kotlin/binary-compatibility-validator#32

When running ./gradlew build, if there is any change in :detekt-api, the task will fail with the following message

~/detekt(api*) » ./gradlew build  
> Task :detekt-api:apiCheck FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':detekt-api:apiCheck'.
> API check failed for project detekt-api.
  --- /Users/cazhang/detekt/detekt-api/api/detekt-api.api
  +++ /Users/cazhang/detekt/detekt-api/build/api/detekt-api.api
  @@ -315,17 +315,20 @@
   
   public final class io/gitlab/arturbosch/detekt/api/Location : io/gitlab/arturbosch/detekt/api/Compactable {
        public static final field Companion Lio/gitlab/arturbosch/detekt/api/Location$Companion;
  -     public fun <init> (Lio/gitlab/arturbosch/detekt/api/SourceLocation;Lio/gitlab/arturbosch/detekt/api/TextLocation;Ljava/lang/String;)V
  +     public fun <init> (Lio/gitlab/arturbosch/detekt/api/SourceLocation;Lio/gitlab/arturbosch/detekt/api/TextLocation;Ljava/lang/String;Ljava/io/File;)V
  +     public synthetic fun <init> (Lio/gitlab/arturbosch/detekt/api/SourceLocation;Lio/gitlab/arturbosch/detekt/api/TextLocation;Ljava/lang/String;Ljava/io/File;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
        public fun <init> (Lio/gitlab/arturbosch/detekt/api/SourceLocation;Lio/gitlab/arturbosch/detekt/api/TextLocation;Ljava/lang/String;Ljava/lang/String;)V
        public fun compact ()Ljava/lang/String;
        public fun compactWithSignature ()Ljava/lang/String;
        public final fun component1 ()Lio/gitlab/arturbosch/detekt/api/SourceLocation;
        public final fun component2 ()Lio/gitlab/arturbosch/detekt/api/TextLocation;
        public final fun component3 ()Ljava/lang/String;
  -     public final fun copy (Lio/gitlab/arturbosch/detekt/api/SourceLocation;Lio/gitlab/arturbosch/detekt/api/TextLocation;Ljava/lang/String;)Lio/gitlab/arturbosch/detekt/api/Location;
  -     public static synthetic fun copy$default (Lio/gitlab/arturbosch/detekt/api/Location;Lio/gitlab/arturbosch/detekt/api/SourceLocation;Lio/gitlab/arturbosch/detekt/api/TextLocation;Ljava/lang/String;ILjava/lang/Object;)Lio/gitlab/arturbosch/detekt/api/Location;
  +     public final fun component4 ()Ljava/io/File;
  +     public final fun copy (Lio/gitlab/arturbosch/detekt/api/SourceLocation;Lio/gitlab/arturbosch/detekt/api/TextLocation;Ljava/lang/String;Ljava/io/File;)Lio/gitlab/arturbosch/detekt/api/Location;
  +     public static synthetic fun copy$default (Lio/gitlab/arturbosch/detekt/api/Location;Lio/gitlab/arturbosch/detekt/api/SourceLocation;Lio/gitlab/arturbosch/detekt/api/TextLocation;Ljava/lang/String;Ljava/io/File;ILjava/lang/Object;)Lio/gitlab/arturbosch/detekt/api/Location;
        public fun equals (Ljava/lang/Object;)Z
        public final fun getFile ()Ljava/lang/String;
  +     public final fun getFile2 ()Ljava/io/File;
        public final fun getSource ()Lio/gitlab/arturbosch/detekt/api/SourceLocation;
        public final fun getText ()Lio/gitlab/arturbosch/detekt/api/TextLocation;
        public fun hashCode ()I
  
   You can run :detekt-api:apiDump task to overwrite API declarations

@codecov
Copy link

codecov bot commented Dec 25, 2020

Codecov Report

Merging #3320 (e31c46d) into master (0d6ac64) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #3320   +/-   ##
=========================================
  Coverage     80.33%   80.33%           
  Complexity     2719     2719           
=========================================
  Files           445      445           
  Lines          8165     8165           
  Branches       1552     1552           
=========================================
  Hits           6559     6559           
  Misses          774      774           
  Partials        832      832           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0d6ac64...e31c46d. Read the comment docs.

Copy link
Member

@BraisGabin BraisGabin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏🏻👏🏻👏🏻👏🏻

@chao2zhang
Copy link
Member Author

Is it possible to merge this PR already? The benefit of this PR overwhelms its temporary hack.

@BraisGabin BraisGabin merged commit ff655d2 into detekt:master Dec 30, 2020
@chao2zhang chao2zhang deleted the api branch December 30, 2020 21:21
chao2zhang pushed a commit to chao2zhang/detekt that referenced this pull request Dec 30, 2020
* Apply binary compatibility plugin to Detekt

* Exclude internal api

* Add an additional new line

* Fix comment to point out the problem in gradle setup

* Remove TODO as forbidden comment
@BraisGabin
Copy link
Member

BraisGabin commented Jan 4, 2021

I can't remove the workaround after I merge #3322 🤔. The issue is still there.

@chao2zhang
Copy link
Member Author

Let me open a new issue to further investigate.

arturbosch pushed a commit that referenced this pull request Jan 16, 2021
* Apply binary compatibility plugin to Detekt

* Exclude internal api

* Add an additional new line

* Fix comment to point out the problem in gradle setup

* Remove TODO as forbidden comment
@arturbosch arturbosch added this to the 1.16.0 milestone Jan 18, 2021
@arturbosch arturbosch added the housekeeping Marker for housekeeping tasks and refactorings label Jan 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
housekeeping Marker for housekeeping tasks and refactorings
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants