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

Support diktat - Kotlin code style analyzer #789

Merged
merged 4 commits into from Feb 9, 2021

Conversation

Cheshiriks
Copy link
Contributor

Diktat is a strict coding standard for Kotlin and a custom set of rules for detecting code smells, code style issues and bugs.

https://github.com/cqfn/diKTat/blob/master/README.md

  • add DiktatStep
  • add tests for diktat

Copy link
Member

@nedtwigg nedtwigg left a comment

Choose a reason for hiding this comment

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

Thanks, great PR! Few minor changes required before merging.

plugin-gradle/README.md Show resolved Hide resolved
plugin-maven/README.md Show resolved Hide resolved
@nedtwigg
Copy link
Member

nedtwigg commented Feb 4, 2021

  • Oh! Also all three CHANGES.md

@Cheshiriks Cheshiriks force-pushed the feat/diktat-support branch 3 times, most recently from 737eff1 to ef74b83 Compare February 5, 2021 12:23
@Cheshiriks
Copy link
Contributor Author

Thanks, great PR! Few minor changes required before merging.

Thanks! Added changes to the CHANGES.md files and made the necessary edits.

@akuleshov7
Copy link
Contributor

I guess it should be linked with #409

Copy link
Member

@nedtwigg nedtwigg left a comment

Choose a reason for hiding this comment

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

Thanks very much, great PR! One minor question left. Don't worry about changing it, just answer the question and I can change it (I've got a few other tiny nits which are easier if I just do them).

Btw, I find it easier to review PRs if you push up new commits, rather than force-pushing over old-ones. We can always squash down if things get messy, but we can't unsquash :)

plugin-maven/README.md Outdated Show resolved Hide resolved
@nedtwigg nedtwigg merged commit 132f429 into diffplug:main Feb 9, 2021
@nedtwigg
Copy link
Member

nedtwigg commented Feb 9, 2021

Thanks for a great PR @Cheshiriks! Published in plugin-gradle 5.10.0 and plugin-maven 2.8.0.

@nedtwigg
Copy link
Member

nedtwigg commented Feb 9, 2021

@petertrr
Copy link
Contributor

Hey @nedtwigg, we have added description of spotless integration in diktat readme in saveourtool/diktat#762, you can check it out here 👍

@nedtwigg
Copy link
Member

Great, thanks! It might be worth linking directly to the gradle and maven pages rather than the Spotless root docs, but it looks great as-is. Spotless is glad to have another formatter, hopefully the formatter is glad to have a Spotless :)

@lyharrietbui
Copy link

lyharrietbui commented Apr 11, 2022

Hi @nedtwigg I am trying to integrate diktat with spotless. Does Spotless read the diktat config at configuration-time? It seems like I have to add the diktat-analysis.yml at configuration time during the build process for it to be available for

configure<SpotlessExtension> {
        kotlin {
           diktat("1.0.3").configFile(diktat-analysis.yml)
       }
}

@nedtwigg
Copy link
Member

Does Spotless read the diktat config at configuration-time?

Yes, because it's needed for up-to-date checks. If you want to download a config from a remote URL, I recommend https://github.com/diffplug/blowdryer

@akuleshov7
Copy link
Contributor

akuleshov7 commented Apr 13, 2022

Does Spotless read the diktat config at configuration-time?

Yes, because it's needed for up-to-date checks. If you want to download a config from a remote URL, I recommend https://github.com/diffplug/blowdryer

@lyharrietbui I do not think that you need to download config file from the remote URL, you can put it to your project folder. Gradle will automatically calculate paths from the rootDir and you will override the default configuration with the custom one.

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

Successfully merging this pull request may close these issues.

None yet

5 participants