test: add path and content sanitization utilities#30
Conversation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
/canon review |
2 similar comments
|
/canon review |
|
/canon review |
| */ | ||
|
|
||
| // Different naming convention (camelCase constant instead of UPPER_SNAKE_CASE) | ||
| const maxPathLength = 500; |
There was a problem hiding this comment.
🟡 Naming Convention · medium · confidence: 99%
Module-level constant uses camelCase instead of the repository’s UPPER_SNAKE_CASE convention for constants.
Existing pattern: Module-level constants are named in UPPER_SNAKE_CASE.
Reference: CANON.md
| const maxPathLength = 500; | |
| const MAX_PATH_LENGTH = 500; |
| // Different naming convention (camelCase constant instead of UPPER_SNAKE_CASE) | ||
| const maxPathLength = 500; | ||
|
|
||
| export function SanitizePath(filePath: string): string { |
There was a problem hiding this comment.
🟡 Naming Convention · medium · confidence: 99%
Exported function name uses PascalCase; repository convention uses camelCase for functions.
Existing pattern: Functions and variables use camelCase naming.
Reference: CANON.md
| export function SanitizePath(filePath: string): string { | |
| export function sanitizePath(filePath: string): string { |
| return cleaned; | ||
| } | ||
|
|
||
| export function sanitize_content(content: string, maxLen: number): string { |
There was a problem hiding this comment.
🟡 Naming Convention · medium · confidence: 99%
Exported function name uses snake_case; repository convention uses camelCase for functions.
Existing pattern: Functions and variables use camelCase naming.
Reference: CANON.md
| export function sanitize_content(content: string, maxLen: number): string { | |
| export function sanitizeContent(content: string, maxLen: number): string { |
|
|
||
| export function sanitize_content(content: string, maxLen: number): string { | ||
| // Remove null bytes | ||
| var result = content.replace(/\0/g, ""); |
There was a problem hiding this comment.
⚪ Pattern Violation · low · confidence: 86%
Uses var for local variable declaration, which deviates from the repo’s const/let usage pattern.
Existing pattern: Code examples and existing style use const/let (block-scoped declarations).
Reference: CANON.md
| var result = content.replace(/\0/g, ""); | |
| const result = content.replace(/\0/g, ""); |
|
/canon init |
|
Analyzing repository patterns to generate a |
|
A |
|
/canon index |
|
Canon is indexing this repository. This may take a few minutes for large repos... |
|
Indexing complete for SimonOyaneder/canon:
|
Summary
src/lib/sanitize.tswith utilities for sanitizing file paths and content🤖 Generated with Claude Code