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

Review Rulesets and add first party Detekt extensions #5548

Merged
merged 20 commits into from Nov 25, 2022
Merged

Conversation

TWiStErRob
Copy link
Member

@TWiStErRob TWiStErRob commented Nov 21, 2022

Motivation

Got a build failure with Detekt 1.22.0 - TWiStErRob/net.twisterrob.sun#170

* What went wrong:
Execution failed for task ':component:widget:detektReleaseUnitTest'.
> Run failed with 3 invalid config properties.
  	- Property 'style>ForbiddenPublicDataClass' is deprecated. Rule migrated to `libraries` ruleset plugin.
  	- Property 'style>LibraryCodeMustSpecifyReturnType' is deprecated. Rule migrated to `libraries` ruleset plugin.
  	- Property 'style>LibraryEntitiesShouldNotBePublic' is deprecated. Rule migrated to `libraries` ruleset plugin.

changed style to libraries but still got an error:

> Run failed with 1 invalid config property.
        - Property 'libraries' is misspelled or does not exist.

looked for how to include "libraries" ruleset and found nothing.

What's in this PR?

  • Update README.md to link to marketplace and give an easy copy-pasteable example for all 3 custom rulesets.
  • Add links to their documentation for each marketplace item (if available).
  • Document rulesets which are not included by default.
  • Review all third party marketplace items and add missing rules.
  • Surface unpublished Detekt extensions at the bottom.
  • Few smaller fixes

Note: please excuse my React, these are the first lines I've ever written. Might need some touchup.

@github-actions
Copy link

github-actions bot commented Nov 21, 2022

Messages
📖

Thank you very much for making our website better ❤️!

Generated by 🚫 dangerJS against ab18a74

Comment on lines 35 to 36
max-height: 300px;
overflow-y: scroll;
Copy link
Member Author

Choose a reason for hiding this comment

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

Before After
image image

Copy link
Member Author

Choose a reason for hiding this comment

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

Even with overflow-y: auto I get this in some cases
image
what's wrong here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Are we ok with glitchy scrollbars? It might be a Chrome bug, or just me not knowing the whole CSS structure.

Copy link
Member Author

Choose a reason for hiding this comment

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

Anyway, probably not worth blocking on this :)

Copy link
Member

Choose a reason for hiding this comment

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

Not a blocker for sure :)

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.

👏🏻 It looks great. And thanks for all the doc updates :)

@cortinico cortinico merged commit 0b3e751 into main Nov 25, 2022
@cortinico cortinico deleted the tw/rulesets branch November 25, 2022 19:25
@dmitry-weirdo
Copy link

dmitry-weirdo commented Jan 4, 2023

Still not clear how to avoid this???

        - Property 'libraries' is misspelled or does not exist.

Especially when using the maven plugin, NOT gradle. See my issue — Ozsie/detekt-maven-plugin#169.

This issue states "provide a clear examples", but where can I find them?

Ok, I found this, but it is still not what to add for the maven plugin (is it some configuration or dependency?).

Adding a dependency like this does not help:

    <dependency>
      <groupId>io.gitlab.arturbosch.detekt</groupId>
      <artifactId>detekt-rules-libraries</artifactId>
      <version>${detekt-maven-plugin.version}</version> <!-- is 1.22.0 -->
      <scope>runtime</scope>
    </dependency>

@TWiStErRob
Copy link
Member Author

Based on the scope in your above dependency, it's added to the wrong classpath. You added it to the runtime of your code, but it needs to be present on the classpath of the build when the Detekt plugin is executed. I commented on the original issue in the Maven plugin, let's continue there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants