English is the primary language. A brief Chinese hint: 若需中文协助可在 Issue 中说明。
Thank you for investing time in contributing! This document describes how to propose changes and how we maintain quality and consistency across the project.
- Code of Conduct: ./CODE_OF_CONDUCT.md
- Security Policy: ./SECURITY.md
- Issues: https://github.com/CarmJos/configured/issues
- Discussions / Q&A: (open an Issue if Discussions are disabled)
- Principles
- Scope of Contributions
- Getting Started (Environment & Build)
- Project Structure
- Branching & Workflow
- Issue Workflow
- Pull Request Guidelines
- Commit Message Convention
- Coding Standards
- Testing Guidelines
- Documentation & JavaDoc
- Dependency Policy
- Versioning & Releases
- Performance Expectations
- Internationalization / Language
- FAQ for Contributors
- Attribution
We value: correctness, clarity, minimalism, maintainability, security-by-default, and performance without premature complexity. Every contribution should move at least one of these forward while not regressing the others.
Acceptable contributions include (but are not limited to):
- Bug fixes & test coverage improvements
- Performance optimizations with measurable benefit
- New configuration providers (storage backends) with generic value
- Validation or serialization helpers
- Documentation, examples, or tutorials
- Tooling that improves developer productivity or release robustness
Out-of-scope (likely to be declined):
- Vendor lock‑in features narrowly targeting one proprietary platform (unless optional & isolated)
- Large feature branches without prior design discussion
- Unbounded abstraction that increases complexity with unclear user value
Requirements:
- JDK 8 (minimum). Later JDKs may work but target bytecode is 1.8.
- Maven 3.8+ (Wrapper optional; project assumes standard mvn).
Build all modules:
mvn -q clean verifySkip tests (NOT recommended for PR validation):
mvn -q clean install -DskipTestsRun a single module:
mvn -q -pl core -am testGenerate JavaDoc (already bound in build):
mvn -q javadoc:javadoc- core/ : Fundamental abstractions (Configuration, Value types, factories)
- features/ : Optional, orthogonal enhancements (validators, section, text, etc.)
- providers/ : Concrete persistence / parsing backends (yaml, gson, hocon, sql, mongodb, temp)
- demo/ : Usage demonstrations & sample scenarios
Rules:
- Core must not depend on feature or provider modules.
- Features must not form cycles; prefer depending only on core.
- Providers should keep external dependencies minimal and shaded/isolated only if necessary.
- main (or master): Stable; only fast‑forward / squash from reviewed PRs.
- feature/: New feature work. Open draft PR early for feedback.
- fix/-: Bug fix referencing an Issue.
- chore/: Build, infra, docs improvements.
Never force push to main. Force pushes allowed only to your own feature branches.
- Search existing issues first to avoid duplication.
- Provide reproduction steps (minimal code or config) for bugs.
- Label suggestions as enhancement; performance items as perf.
- For larger features, open a design issue summarizing: Problem, Motivation, Proposed API, Alternatives.
Checklist before opening a PR:
- Linked to at least one Issue (unless trivial doc fix)
- Passes
mvn verify - Adds or updates tests covering new behavior / bug
- Includes JavaDoc / README / CHANGELOG fragment if user-facing
- No unrelated refactors or formatting churn
- Minimal diff: avoid reordering imports unless enforced by style
Review expectations:
- Maintainers strive to respond within 5 business days.
- Use constructive, action‑oriented comments.
- Resolve conversations or explain why not.
- Squash commits if they are noisy; retain meaningful logical grouping.
Use Conventional Commits (https://www.conventionalcommits.org/) with optional scope:
<type>(<scope>): <short imperative summary>
<body>(optional)
<footer>(breaking changes, issue references)
Types used:
- feat: New feature (user visible)
- fix: Bug fix
- perf: Performance improvement
- refactor: Internal restructuring without behavior change
- docs: Documentation only
- test: Add or fix tests
- build: Build system or dependency changes
- ci: Continuous integration changes
- chore: Maintenance tasks
- style: Formatting (rare; avoid large style‑only changes)
Breaking changes: add ! after type/scope or include BREAKING CHANGE: footer.
- Java: Follow effective Java principles; prefer explicit types over inference for public APIs.
- Nullability: Use JetBrains annotations (
@NotNull,@Nullable) where helpful. - Immutability: Favor immutable value objects; avoid exposing mutable internal state.
- Exceptions: Use specific exception types; no swallowing silently. Validate inputs early.
- Logging: Keep core logging minimal; let consumers decide verbosity. Avoid println.
- APIs: Minimize surface; avoid exposing prematurely general interfaces.
- Annotations: Provide meaningful config path / comments metadata clearly.
- Indentation: 4 spaces.
- Line length guideline: ≤ 140 chars (soft limit).
- Avoid wildcard imports.
- Use JUnit (current: JUnit 4). Prefer deterministic, isolated tests.
- Each bug fix must include a regression test failing before the fix.
- Avoid time‑sensitive sleeps; prefer deterministic constructs.
- Keep provider-specific integration tests under provider module.
- Use random data cautiously; if used, log seed for reproduction.
Command:
mvn -q test- Public classes & methods: brief JavaDoc describing contract, thread-safety, nullability.
- Add code examples when clarifying complex usage.
- Update README or module README for new feature flags or environment variables.
- Keep demo module aligned with latest recommended usage.
- Keep transitive dependency footprint lean.
- No large frameworks for simple utilities.
- Justify each new dependency in PR description (purpose, size, maintenance risk).
- Prefer stable, well-adopted libraries with permissive licenses compatible with LGPL.
- Security-sensitive libs (parsers, DB drivers) should be periodically updated.
- Follows Semantic Versioning (MAJOR.MINOR.PATCH).
- Public API additions => MINOR bump.
- Backwards-compatible bug fix => PATCH.
- Backwards-incompatible change => MAJOR (document rationale & migration).
- Release steps (maintainers):
- Ensure main is green (CI all passing)
- Update CHANGELOG (if present) or Release Notes draft
- Bump versions via maven-release-plugin (ensure GPG & staging configured)
- Tag + push; verify publication (Central / GitHub Packages)
- Publish GitHub Release with highlights + migration notes
- Avoid unnecessary object churn in hot paths.
- Profile before large rewrites. Provide benchmark or allocation stats if claiming improvement.
- Defer I/O and heavy parsing until needed (lazy loading pattern).
- Primary language: English for code, comments, issues, PRs.
- Chinese clarifications acceptable if accompanied by English.
Q: Can I add a new provider? A: Yes—open a design Issue first summarizing data model, external dependencies, and test strategy.
Q: How do I mark experimental APIs?
A: Add JavaDoc: @apiNote Experimental: subject to change without notice. and avoid wide promotion.
Q: Why Java 8 target? A: Maximizes compatibility across server & embedded environments.
Portions inspired by widely adopted open-source guidelines (Kotlin, Spring, Apache projects) and Conventional Commits.
Thank you for helping build a robust configuration ecosystem!