Skip to content

Commit fa55261

Browse files
committed
fixup: add contributing section
Signed-off-by: Simon Schrottner <simon.schrottner@dynatrace.com>
1 parent 363602e commit fa55261

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

CONTRIBUTING.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,38 @@ If you think we might be out of date with the spec, you can check that by invoki
2121

2222
If you're adding tests to cover something in the spec, use the `@Specification` annotation like you see throughout the test suites.
2323

24+
## Code Styles
25+
26+
### Overview
27+
Our project follows strict code formatting standards to maintain consistency and readability across the codebase. We use [Spotless](https://github.com/diffplug/spotless) integrated with the [Palantir Java Format](https://github.com/palantir/palantir-java-format) for code formatting.
28+
29+
**Spotless** ensures that all code complies with the formatting rules automatically, reducing style-related issues during code reviews.
30+
31+
### How to Format Your Code
32+
1. **Before Committing Changes:**
33+
Run the Spotless plugin to format your code. This will apply the Palantir Java Format style:
34+
```bash
35+
mvn spotless:apply
36+
```
37+
38+
2. **Verify Formatting:**
39+
To check if your code adheres to the style guidelines without making changes:
40+
```bash
41+
mvn spotless:check
42+
```
43+
44+
- If this command fails, your code does not follow the required formatting. Use `mvn spotless:apply` to fix it.
45+
46+
### CI/CD Integration
47+
Our Continuous Integration (CI) pipeline automatically checks code formatting using the Spotless plugin. Any code that does not pass the `spotless:check` step will cause the build to fail.
48+
49+
### Best Practices
50+
- Regularly run `mvn spotless:apply` during your work to ensure your code remains aligned with the standards.
51+
- Configure your IDE (e.g., IntelliJ IDEA or Eclipse) to follow the Palantir Java format guidelines to reduce discrepancies during development.
52+
53+
### Support
54+
If you encounter issues with code formatting, please raise a GitHub issue or contact the maintainers.
55+
2456
## End-to-End Tests
2557

2658
The continuous integration runs a set of [gherkin e2e tests](https://github.com/open-feature/spec/blob/main/specification/assets/gherkin/evaluation.feature) using `InMemoryProvider`.

0 commit comments

Comments
 (0)