You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+32Lines changed: 32 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,6 +21,38 @@ If you think we might be out of date with the spec, you can check that by invoki
21
21
22
22
If you're adding tests to cover something in the spec, use the `@Specification` annotation like you see throughout the test suites.
23
23
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
+
24
56
## End-to-End Tests
25
57
26
58
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