Skip to content

Commit 5d06c00

Browse files
committed
docs: add HELP and CONTRIBUTING guides
- Add HELP.md with template usage instructions - Add CONTRIBUTING.md with contribution guidelines
1 parent 9606ecc commit 5d06c00

2 files changed

Lines changed: 180 additions & 0 deletions

File tree

CONTRIBUTING.md

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# Contributing
2+
3+
Thank you for considering contributing to this project!
4+
5+
## Getting Started
6+
7+
1. Fork the repository
8+
2. Clone your fork
9+
3. Create a new branch for your changes
10+
11+
## Development Workflow
12+
13+
### Code Style
14+
15+
- Follow the official [Kotlin coding conventions](https://kotlinlang.org/docs/coding-conventions.html)
16+
- Use 4 spaces for indentation
17+
- Keep lines under 120 characters when possible
18+
19+
### Testing
20+
21+
All changes must include appropriate tests:
22+
23+
```bash
24+
bazel test //...
25+
```
26+
27+
Ensure all tests pass before submitting a pull request.
28+
29+
### Building
30+
31+
```bash
32+
bazel build //...
33+
```
34+
35+
## Commit Guidelines
36+
37+
We follow the [Conventional Commits](https://www.conventionalcommits.org/) specification:
38+
39+
```
40+
<type>: <subject>
41+
42+
<body>
43+
44+
<footer>
45+
```
46+
47+
### Types
48+
49+
- `feat`: A new feature
50+
- `fix`: A bug fix
51+
- `refactor`: Code change that neither fixes a bug nor adds a feature
52+
- `test`: Adding or updating tests
53+
- `docs`: Documentation changes
54+
- `chore`: Changes to build process or tooling
55+
56+
### Examples
57+
58+
```
59+
feat: add support for custom annotations in allopen plugin
60+
61+
This change allows users to specify custom annotations for the
62+
Spring allopen plugin configuration.
63+
```
64+
65+
```
66+
fix: resolve JUnit version mismatch in test dependencies
67+
68+
Updates test imports to use JUnit 4 to match the declared
69+
dependency in MODULE.bazel.
70+
```
71+
72+
## Pull Request Process
73+
74+
1. Update documentation if needed
75+
2. Ensure all tests pass
76+
3. Update the changelog if applicable
77+
4. Submit your pull request with a clear description of changes
78+
5. Wait for review and address any feedback
79+
80+
## Code Review
81+
82+
All submissions require review. We use GitHub pull requests for this purpose.
83+
84+
## Questions?
85+
86+
Feel free to open an issue for any questions or concerns.

HELP.md

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
# Help
2+
3+
## Prerequisites
4+
5+
- [Bazelisk](https://github.com/bazelbuild/bazelisk) (recommended) or Bazel 7.0+
6+
- JDK 17 or higher
7+
8+
## Creating a New Module
9+
10+
1. Create the module directory structure:
11+
```bash
12+
mkdir -p module-name/src/main/kotlin
13+
mkdir -p module-name/src/test/kotlin
14+
```
15+
16+
2. Create `module-name/deps.bzl`:
17+
```bzl
18+
MODULE_DEPS = [
19+
"@maven//:org_springframework_boot_spring_boot_starter_web",
20+
]
21+
22+
TEST_DEPS = [
23+
"@maven//:junit_junit",
24+
]
25+
```
26+
27+
3. Create `module-name/BUILD.bazel`:
28+
```bzl
29+
load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_binary", "kt_jvm_test")
30+
load("//:kotlin.bzl", "setup_kotlin_compiler", "setup_spring_allopen_plugin")
31+
load("//module-name:deps.bzl", "MODULE_DEPS", "TEST_DEPS")
32+
33+
package(default_visibility = ["//visibility:public"])
34+
35+
setup_kotlin_compiler()
36+
setup_spring_allopen_plugin()
37+
38+
kt_jvm_binary(
39+
name = "main",
40+
srcs = glob(["src/main/kotlin/**/*.kt"]),
41+
main_class = "hs.kr.entrydsm.example.MainKt",
42+
plugins = ["//:spring_allopen"],
43+
deps = MODULE_DEPS,
44+
javac_opts = "//:javac_options",
45+
kotlinc_opts = "//:kotlinc_options",
46+
)
47+
48+
kt_jvm_test(
49+
name = "test",
50+
srcs = glob(["src/test/kotlin/**/*.kt"]),
51+
test_class = "hs.kr.entrydsm.example.TestClass",
52+
plugins = ["//:spring_allopen"],
53+
deps = MODULE_DEPS + TEST_DEPS,
54+
javac_opts = "//:javac_options",
55+
kotlinc_opts = "//:kotlinc_options",
56+
)
57+
```
58+
59+
## Adding Dependencies
60+
61+
1. Add the Maven artifact to `MODULE.bazel`:
62+
```bzl
63+
maven.artifact(
64+
artifact = "artifact-name",
65+
group = "group.id",
66+
version = VERSION_CONSTANT,
67+
)
68+
```
69+
70+
2. Add the dependency to your module's `deps.bzl`:
71+
```bzl
72+
MODULE_DEPS = [
73+
"@maven//:group_id_artifact_name",
74+
]
75+
```
76+
77+
## Building and Testing
78+
79+
```bash
80+
# Build all targets
81+
bazel build //...
82+
83+
# Run all tests
84+
bazel test //...
85+
86+
# Run a specific module
87+
bazel run //module-name:main
88+
```
89+
90+
## Getting Help
91+
92+
- [Bazel Documentation](https://bazel.build/docs)
93+
- [rules_kotlin Documentation](https://github.com/bazelbuild/rules_kotlin)
94+
- [Issue Tracker](../../issues)

0 commit comments

Comments
 (0)