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

Fixes for chapters 4-5 after native review. #496

Merged
merged 1 commit into from
Nov 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
[![Awesome Kotlin Badge](https://kotlin.link/awesome-kotlin.svg)](https://github.com/KotlinBy/awesome-kotlin)


DiKTat is a strict [coding standard ](info/diktat-kotlin-coding-style-guide-en.md) for Kotlin and a collection of [Kotlin](https://kotlinlang.org/) code style rules implemented
DiKTat is a strict [coding standard ](info/guide/diktat-coding-convention.md) for Kotlin and a collection of [Kotlin](https://kotlinlang.org/) code style rules implemented
as AST visitors on the top of [KTlint](https://ktlint.github.io/). It can be used for detecting and autofixing code smells in CI/CD process.
The full list of available supported rules and inspections can be found [here](info/available-rules.md).


| See first | !!! |
| ----------------- | ------------------------ |
|[diKTat codestyle](info/diktat-kotlin-coding-style-guide-en.md)|[supported rules](info/available-rules.md)| |
|[diKTat codestyle](info/guide/diktat-coding-convention.md)|[supported rules](info/available-rules.md)| |
|[examples of usage](https://github.com/akuleshov7/diktat-examples)|[online demo](https://ktlint-demo.herokuapp.com)|


Expand Down
18 changes: 18 additions & 0 deletions info/guide/FullDocGenerator.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import java.io.File
import java.lang.StringBuilder

val GUIDE_PATTERN = "guide-chapter-"

val codeGuideParts = File(".")
.listFiles()
.filter { it.name.contains(GUIDE_PATTERN) }

val allChapters = codeGuideParts
.sortedBy { it.nameWithoutExtension.replace(GUIDE_PATTERN, "").toInt() }
.map { it.readLines() }
.flatten()
.joinToString("\n")
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
.joinToString("\n")
.joinToString(System.lineSeparator)

?


File("diktat-coding-convention.md").writeText(allChapters)


Loading