MCPcopy Index your code
hub / github.com/codeaashu/claude-code / ruleIdToLabel

Function ruleIdToLabel

src/services/teamMemorySync/secretScanner.ts:243–268  ·  view source on GitHub ↗

* Convert a gitleaks rule ID (kebab-case) to a human-readable label. * e.g., "github-pat" → "GitHub PAT", "aws-access-token" → "AWS Access Token"

(ruleId: string)

Source from the content-addressed store, hash-verified

241 * e.g., "github-pat""GitHub PAT", "aws-access-token""AWS Access Token"
242 */
243function ruleIdToLabel(ruleId: string): string {
244 // Words where the canonical capitalization differs from title case
245 const specialCase: Record<string, string> = {
246 aws: 'AWS',
247 gcp: 'GCP',
248 api: 'API',
249 pat: 'PAT',
250 ad: 'AD',
251 tf: 'TF',
252 oauth: 'OAuth',
253 npm: 'NPM',
254 pypi: 'PyPI',
255 jwt: 'JWT',
256 github: 'GitHub',
257 gitlab: 'GitLab',
258 openai: 'OpenAI',
259 digitalocean: 'DigitalOcean',
260 huggingface: 'HuggingFace',
261 hashicorp: 'HashiCorp',
262 sendgrid: 'SendGrid',
263 }
264 return ruleId
265 .split('-')
266 .map(part => specialCase[part] ?? capitalize(part))
267 .join(' ')
268}
269
270/**
271 * Scan a string for potential secrets.

Callers 2

scanForSecretsFunction · 0.85
getSecretLabelFunction · 0.85

Calls 1

capitalizeFunction · 0.85

Tested by

no test coverage detected