From 123bba939fda7561efe0c8ead2f75787e088eaee Mon Sep 17 00:00:00 2001 From: obabichevjb <166523824+obabichevjb@users.noreply.github.com> Date: Fri, 19 Apr 2024 08:56:46 +0200 Subject: [PATCH] docs: Update Contributing documentation with code style details (#2051) * docs: Update Contributing documentation with code style details * docs: Review issues --- README.md | 1 + .../Writerside/topics/Contributing.md | 16 +++++++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 0b8df0ead3..5725170896 100644 --- a/README.md +++ b/README.md @@ -194,6 +194,7 @@ Currently, Exposed is available for **maven/gradle builds**. Check the [Maven Ce For more information visit the links below: - [Documentation](https://jetbrains.github.io/Exposed/home.html) with examples and docs +- [Contributing to Exposed](#contributing) - [Migration Guide](https://jetbrains.github.io/Exposed/migration-guide.html) - [Breaking changes](https://jetbrains.github.io/Exposed/breaking-changes.html) and any migration details - [Slack Channel](https://kotlinlang.slack.com/messages/exposed/) diff --git a/documentation-website/Writerside/topics/Contributing.md b/documentation-website/Writerside/topics/Contributing.md index 0f61a2466e..515e4528a5 100644 --- a/documentation-website/Writerside/topics/Contributing.md +++ b/documentation-website/Writerside/topics/Contributing.md @@ -54,7 +54,8 @@ Contributions are made using Github [pull requests](https://help.github.com/en/a 7. If the contribution requires updates to documentation (be it updating existing contents or creating new one), please file a new ticket on [YouTrack](https://youtrack.jetbrains.com/issues/EXPOSED). 8. Make sure any code contributed is covered by tests and no existing tests are broken. We use Docker containers to run tests. -9. Finally, make sure to run the `apiCheck` Gradle task. If it's not successful, run the `apiDump` Gradle task. Further information can be +9. Execute the `detekt` task in Gradle to perform code style validation. +10. Finally, make sure to run the `apiCheck` Gradle task. If it's not successful, run the `apiDump` Gradle task. Further information can be found [here](https://github.com/Kotlin/binary-compatibility-validator). #### Style Guides @@ -68,6 +69,14 @@ A few things to remember: * Every public API (including functions, classes, objects and so on) should be documented, every parameter, property, return types, and exceptions should be described properly. +Test functions: + +* Begin each test function name with the word `test`. +* Employ camelCase for test function names, such as `testInsertEmojisWithInvalidLength`. +* Refrain from using names enclosed in backticks for test functions, because `KDocs` cannot reference function names that contain spaces. +* In the definition of test functions, use a block body instead of an assignment operator. + For example, do write `fun testMyTest() { withDb{} }`, and avoid writing `fun testMyTest() = withDb{}`. + #### Commit messages * Commit messages should be written in English. @@ -82,7 +91,8 @@ A few things to remember: There are multiple ways in which you can contribute to Exposed docs: - Create an issue in [YouTrack](https://youtrack.jetbrains.com/issues/EXPOSED). -- Submit a pull request with proposed changes. +- Submit a pull request containing your proposed changes. +Ensure that these modifications are applied directly within the `documentation-website` directory. ### Community Support @@ -99,4 +109,4 @@ Before submitting an issue or feature request, please search YouTrack's existing When submitting an issue or feature request, please provide as much detail as possible, including a clear and concise description of the problem or desired functionality, steps to reproduce the issue, and any relevant code snippets or error messages. -Thank you for your cooperation and for helping to improve Exposed. \ No newline at end of file +Thank you for your cooperation and for helping to improve Exposed.