diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index c887621a..fc143675 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -444,6 +444,7 @@ namespace MyNamespace // Not Allowed ``` #### Formatting: +- Write comments as sentences: capitalize the first word and end with a period. `TODO`, `FIXME`, `HACK`, `XXX` and `NOTE` bodies stay lowercase after the colon, and commented-out code is left exactly as written. - Use a single space after keywords in control flow statements. For example: ```csharp if (condition) // Correct diff --git a/docs/technical/templates/CSharpConventions.md b/docs/technical/templates/CSharpConventions.md index 9a82301d..0786b944 100644 --- a/docs/technical/templates/CSharpConventions.md +++ b/docs/technical/templates/CSharpConventions.md @@ -29,7 +29,7 @@ This project enforces many style rules via `.editorconfig` as build errors, so t - **Naming quality**: names must be explicit, even if long. Domain names must match the project's Ubiquitous Language exactly. Lambda parameters must be named descriptively, never single letters or shortened anti-pattern names (no `x`, `e`, `s`, etc). - **Domain nullability**: domain code must never use nullable value types or reference nulls directly, it must use the `Optional` and `Result` types instead. Flag any raw `null`/`?` usage in domain code. -- **Comments**: should explain *why*, not *what* (the code already shows what). Wrap only when substantially exceeding a 1920px monitor's width. Flag comments that just restate the code. +- **Comments**: should explain *why*, not *what* (the code already shows what). Wrap only when substantially exceeding a 1920px monitor's width. Flag comments that just restate the code. Comment text is written as a sentence: the first word is capitalized and the sentence ends with a period, in every code file the repository contains (C#, JavaScript, CSS, Razor, HTML, MSBuild/XML, SVG, YAML, Dockerfiles, and the bundled theme archives). Generated files (`*.Designer.cs`, `*ModelSnapshot.cs`, `AssemblyInfo.cs`) and tool configuration files (`.editorconfig`, `.gitignore`) are excluded. Section labels and marker comments follow the same rule, except the `// Arrange`, `// Act` and `// Assert` markers, which are always written bare, without a period. `TODO`, `FIXME`, `HACK`, `XXX` and `NOTE` already provide the capitalized first word, so the body after the colon is written in lowercase, unless it starts with a proper noun or a code identifier. Commented-out code is not prose and is left exactly as written. - **XML documentation**: required on every public construct, and also on private properties and methods. Use `` for language keywords, not `etc`. Method summaries must not expose internal implementation details, unless truly relevant, in which case put that detail in a `` block instead of the summary. - **``**: avoid on classes implementing interface members. Developers usually work in the implementing class and should see documentation there directly, without having to open the interface. - **Boolean naming**: boolean fields, properties, and methods returning booleans must start with a verb implying true/false: `is`, `are`, `should`, `has`, `was`, `can`, etc.