mirror of
https://github.com/Sea-Haven-Industries/engineering-handbook.git
synced 2026-09-30 05:43:15 +00:00
40 lines
1.2 KiB
Markdown
40 lines
1.2 KiB
Markdown
|
|
# Naming Conventions
|
||
|
|
|
||
|
|
## The Rule
|
||
|
|
|
||
|
|
kebab-case for everything. No exceptions.
|
||
|
|
|
||
|
|
No `snake_case`, `PascalCase`, or mixed styles anywhere.
|
||
|
|
|
||
|
|
## Where It Applies
|
||
|
|
|
||
|
|
| Resource | Example |
|
||
|
|
|---|---|
|
||
|
|
| Repository names | `expense-approval-bot`, `door-unlock-api` |
|
||
|
|
| CloudFormation stack names | `expense-approval-bot` (must match repo name) |
|
||
|
|
| Lambda function names | `expense-approval-bot-process-receipt` |
|
||
|
|
| DynamoDB table names | `expense-approval-bot-receipts` |
|
||
|
|
| S3 bucket names | `expense-approval-bot-uploads` |
|
||
|
|
| Secrets Manager secrets | `expense-approval-bot/slack-signing` |
|
||
|
|
| Feature branches | `feature/add-receipt-parser` |
|
||
|
|
|
||
|
|
## CDK Gotcha
|
||
|
|
|
||
|
|
CDK generates PascalCase stack names by default. Always set an explicit `stackName` (TypeScript) or `stack_name` (Python) in your stack definition to enforce kebab-case.
|
||
|
|
|
||
|
|
```typescript
|
||
|
|
new MyStack(app, 'MyStack', {
|
||
|
|
stackName: 'my-stack',
|
||
|
|
});
|
||
|
|
```
|
||
|
|
|
||
|
|
## Examples
|
||
|
|
|
||
|
|
| Bad | Good | Why |
|
||
|
|
|---|---|---|
|
||
|
|
| `ExpenseApprovalBot` | `expense-approval-bot` | PascalCase |
|
||
|
|
| `expense_approval_bot` | `expense-approval-bot` | snake_case |
|
||
|
|
| `expenseApprovalBot` | `expense-approval-bot` | camelCase |
|
||
|
|
| `Expense-Approval-Bot` | `expense-approval-bot` | Mixed case |
|
||
|
|
| `feature/AddParser` | `feature/add-parser` | PascalCase in branch |
|