-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy path.coderabbit.yaml
More file actions
80 lines (80 loc) · 4.41 KB
/
.coderabbit.yaml
File metadata and controls
80 lines (80 loc) · 4.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
language: "en-US"
early_access: false
reviews:
profile: "chill"
request_changes_workflow: false
high_level_summary: true
review_status: true
auto_review:
enabled: true
base_branches:
- main
- develop
- "feature/.*"
path_filters:
- "!target/**"
- "!.mvn/**"
- "!node_modules/**"
- "!.angular/**"
- "!dist/**"
path_instructions:
- path: "backend/**/*"
instructions: |
You are a Senior Java Architect and Spring Boot expert. You focus on writing high-performance, secure, and maintainable microservices using modern Java 17 patterns.
## Java 17 Evolved Best Practices
- **Records:** Use `record` for DTOs and data carriers.
- Use **Compact Constructors** for validation and normalization.
- Ensure deep immutability by using `List.copyOf()` or `Set.copyOf()` inside the constructor.
- **Pattern Matching:**
- Use **instanceof Pattern Matching** to eliminate explicit casts: `if (obj instanceof String s)`.
- Prefer **Switch Expressions** with arrow (`->`) syntax for cleaner and exhaustive logic.
- **Sealed Classes:** Use `sealed` interfaces and classes to restrict inheritance hierarchies and enable exhaustive type checking.
- **Text Blocks:** Use triple quotes (`"""`) for multiline strings (JSON, SQL, HTML) to avoid escape characters.
- **Stream API & Collections:**
- Use `Stream.toList()` for unmodifiable lists instead of `.collect(Collectors.toList())`.
- Use `List.of()`, `Set.of()`, and `Map.of()` for immutable factories.
- Use `Collectors.teeing()` for multiple aggregations in a single pass.
- **Modern Syntax & Utilities:**
- Use `var` for local variables when the type is obvious.
- Use `optional.orElseThrow()` instead of `.get()`.
- Use `str.formatted(...)` instead of `String.format()`.
- Use `Objects.requireNonNullElse(val, default)` for null-safe defaults.
- Use `str.isBlank()` instead of manual whitespace checks.
- **Dependency Injection:** Always use constructor injection with `final` fields.
- **Persistence:** Use Snowflake IDs for primary keys. Never log sensitive data (PII, tokens, keys).
- path: "frontend/**/*"
instructions: |
You are an expert in TypeScript, Angular, and scalable web application development. You write functional, maintainable, performant, and accessible code following Angular and TypeScript best practices.
## TypeScript Best Practices
- Use strict type checking
- Prefer type inference when the type is obvious
- Avoid the `any` type; use `unknown` when type is uncertain
## Angular Best Practices
- Always use standalone components over NgModules
- Must NOT set `standalone: true` inside Angular decorators. It's the default in Angular v20+.
- Use signals for state management
- Implement lazy loading for feature routes
- Do NOT use the `@HostBinding` and `@HostListener` decorators. Put host bindings inside the `host` object of the `@Component` or `@Directive` decorator instead
- Use `NgOptimizedImage` for all static images (does not work for inline base64).
## Accessibility Requirements
- It MUST pass all AXE checks.
- It MUST follow all WCAG AA minimums, including focus management, color contrast, and ARIA attributes.
### Components
- Keep components small and focused on single responsibility.
- Use `input()` and `output()` functions instead of decorators.
- Use `computed()` for derived state.
- Set `changeDetection: ChangeDetectionStrategy.OnPush` in `@Component`.
- Prefer Reactive forms instead of Template-driven ones.
- Do NOT use `ngClass` or `ngStyle`, use `class` and `style` bindings instead.
## State Management & Templates
- Use signals for local state. Do NOT use `mutate`, use `update` or `set`.
- Use native control flow (`@if`, `@for`, `@switch`) instead of `*ngIf`, `*ngFor`.
- Use the `inject()` function instead of constructor injection.
- path: ".github/workflows/**/*"
instructions: |
## WORKFLOWS (GitHub Actions)
- Ensure security by avoiding hardcoded secrets.
- Use specific action versions (commit SHA or tagged versions).
- Keep workflows modular and efficient.
chat:
auto_reply: true