bu da işine yarayabilir (:
### Documentation Comment Standards
When writing or editing code, always add documentation comments using
the native DocBlock standard of the language in question. Do not invent
custom formats. Use the following per language:
- **Java** → Javadoc (`/** ... */` with `
@param`, `
@return`, `
@throws`)
- **JavaScript** → JSDoc (`/** ... */` with `
@param {type}`, `@returns`)
- **TypeScript** → TSDoc (JSDoc-compatible; omit redundant type annotations already expressed in the type system)
- **PHP** → PHPDoc / PSR-5 draft conventions (`
@param`, `
@return`, `
@throws`)
- **Python** → PEP 257 docstrings; prefer Google style (or match the project's existing style: NumPy / reStructuredText for Sphinx)
- **C / C ** → Doxygen (`/** ... */` or `///` with `
@brief`, `
@param`)
- **C#** → XML documentation comments (`///` with `<summary>`, `<param>`, `<returns>`) — consumed by IntelliSense and DocFX
- **Go** → godoc conventions: plain comment immediately above the declaration, starting with the identifier's name; no tags
- **Rust** → rustdoc (`///` for items, `//!` for modules); Markdown body with `# Examples`, `# Panics`, `# Errors` sections
- **Kotlin** → KDoc (`/** ... */` with `
@param`, `
@return`; Markdown body)
- **Swift** → Swift-flavored Markdown / DocC (`///` with `- Parameter:`, `- Returns:`, `- Throws:`)
- **Dart** → dartdoc (`///` with Markdown; reference members with `[name]`)
- **Scala** → Scaladoc (`/** ... */`)
- **Ruby** → YARD (`
@param`, `
@return`) or RDoc, matching the project
- **Elixir** → `@moduledoc` / `
@doc` attributes (ExDoc, Markdown)
- **Haskell** → Haddock (`-- |` and `-- ^`)
- **Perl** → POD (`=head1`, `=cut`)
- **R** → roxygen2 (`#'` with `
@param`, `
@return`, `
@export`)
- **Lua** → LDoc / LuaDoc (`---` with `
@param`, `
@return`)
- **Julia** → docstrings (Markdown string placed directly above the definition)
Documentation Comment rules:
- Match the documentation style already present in the project before defaulting to the standards above.
- Document all public/exported APIs; private helpers only when non-obvious.
- Keep descriptions concise: one summary line, then details only if needed.
- Document parameters, return values, thrown errors/exceptions, and side effects.
- Do not restate types in prose when the language's type system already declares them (TypeScript, Rust, Go, Kotlin, etc.).