Skip to content

test: add path and content sanitization utilities#30

Closed
SimonOyaneder wants to merge 1 commit into
mainfrom
test/validate-bot
Closed

test: add path and content sanitization utilities#30
SimonOyaneder wants to merge 1 commit into
mainfrom
test/validate-bot

Conversation

@SimonOyaneder

Copy link
Copy Markdown
Owner

Summary

  • Adds src/lib/sanitize.ts with utilities for sanitizing file paths and content
  • Testing Canon bot review on Railway deployment

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@SimonOyaneder

Copy link
Copy Markdown
Owner Author

/canon review

2 similar comments
@SimonOyaneder

Copy link
Copy Markdown
Owner Author

/canon review

@SimonOyaneder

Copy link
Copy Markdown
Owner Author

/canon review

@canon-review canon-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found 4 pattern deviations: 🟡 3 medium · ⚪ 1 low

Comment thread src/lib/sanitize.ts
*/

// Different naming convention (camelCase constant instead of UPPER_SNAKE_CASE)
const maxPathLength = 500;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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

Suggested change
const maxPathLength = 500;
const MAX_PATH_LENGTH = 500;

Comment thread src/lib/sanitize.ts
// Different naming convention (camelCase constant instead of UPPER_SNAKE_CASE)
const maxPathLength = 500;

export function SanitizePath(filePath: string): string {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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

Suggested change
export function SanitizePath(filePath: string): string {
export function sanitizePath(filePath: string): string {

Comment thread src/lib/sanitize.ts
return cleaned;
}

export function sanitize_content(content: string, maxLen: number): string {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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

Suggested change
export function sanitize_content(content: string, maxLen: number): string {
export function sanitizeContent(content: string, maxLen: number): string {

Comment thread src/lib/sanitize.ts

export function sanitize_content(content: string, maxLen: number): string {
// Remove null bytes
var result = content.replace(/\0/g, "");

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Suggested change
var result = content.replace(/\0/g, "");
const result = content.replace(/\0/g, "");

@SimonOyaneder

Copy link
Copy Markdown
Owner Author

/canon init

@canon-review

canon-review Bot commented Feb 26, 2026

Copy link
Copy Markdown

Analyzing repository patterns to generate a CANON.md...

@canon-review

canon-review Bot commented Feb 26, 2026

Copy link
Copy Markdown

A CANON.md already exists in this repository. Edit it directly to update conventions.

@SimonOyaneder

Copy link
Copy Markdown
Owner Author

/canon index

@canon-review

canon-review Bot commented Feb 26, 2026

Copy link
Copy Markdown

Canon is indexing this repository. This may take a few minutes for large repos...

@canon-review

canon-review Bot commented Feb 26, 2026

Copy link
Copy Markdown

Indexing complete for SimonOyaneder/canon:

Metric Count
Source files found 67
New/updated embeddings 46
Already cached 20
Skipped (too large/binary) 1
Pruned (deleted files) 0

@SimonOyaneder SimonOyaneder deleted the test/validate-bot branch February 26, 2026 19:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant