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
ReactiveUI enforces strict code style and formatting guidelines:
334
-
335
-
### EditorConfig & StyleCop Compliance
336
-
-**EditorConfig**: The repository has a comprehensive `.editorconfig` file with detailed formatting rules
337
-
-**StyleCop Analyzers**: Extensive StyleCop analyzer rules are configured with error-level enforcement
338
-
-**Code Analysis**: Over 200 analyzer rules are configured for code quality and consistency
331
+
## Validation and Quality Assurance
332
+
333
+
### Code Style and Analysis Enforcement
334
+
-**EditorConfig Compliance**: Repository uses comprehensive `.editorconfig` with detailed rules for C# formatting, naming conventions, and code analysis
335
+
-**StyleCop Analyzers**: Enforces consistent C# code style with `stylecop.analyzers`
336
+
-**Roslynator Analyzers**: Additional code quality rules with `Roslynator.Analyzers`
337
+
-**Analysis Level**: Set to `latest` with enhanced .NET analyzers enabled
338
+
-**CRITICAL**: All code must comply with **ReactiveUI contribution guidelines**: https://www.reactiveui.net/contribute/index.html
339
+
340
+
### C# Style Guide
341
+
**General Rule**: Follow "Visual Studio defaults" with the following specific requirements:
342
+
343
+
#### **Brace Style**
344
+
-**Allman style braces**: Each brace begins on a new line
345
+
-**Single line statement blocks**: Can go without braces but must be properly indented on its own line
346
+
-**Exception**: A `using` statement is permitted to be nested within another `using` statement by starting on the following line at the same indentation level
347
+
348
+
#### **Indentation and Spacing**
349
+
-**Four spaces** of indentation (no tabs)
350
+
-**Avoid spurious free spaces**: For example, avoid `if (someVar == 0)...` where dots mark spurious spaces
351
+
-**Avoid more than one empty line** at any time between members of a type
352
+
-**Labels**: Indent one less than the current indentation (for `goto` statements)
353
+
354
+
#### **Field and Property Naming**
355
+
-**Internal and private fields**: Use `_camelCase` prefix with `readonly` where possible
356
+
-**Static fields**: `readonly` should come after `static` (e.g., `static readonly` not `readonly static`)
357
+
-**Public fields**: Use PascalCasing with no prefix (use sparingly)
358
+
-**Constants**: Use PascalCasing for all constant local variables and fields (except interop code)
359
+
-**Fields placement**: Specify fields at the top within type declarations
360
+
361
+
#### **Visibility and Modifiers**
362
+
-**Always specify visibility**: Even if it's the default (e.g., `private string _foo` not `string _foo`)
363
+
-**Visibility first**: Should be the first modifier (e.g., `public abstract` not `abstract public`)
Remember: ReactiveUI emphasizes functional reactive programming patterns, immutability where possible, and clean separation of concerns through the MVVM pattern. When in doubt, prefer reactive streams over imperative code, and always consider the AOT implications of your changes.
518
+
Remember: ReactiveUI emphasizes functional reactive programming patterns, immutability where possible, and clean separation of concerns through the MVVM pattern. When in doubt, prefer reactive streams over imperative code, and always consider the AOT implications of your changes.
0 commit comments