mirror of
https://github.com/AgentSeal/codeburn.git
synced 2026-04-28 06:59:37 +00:00
Merge pull request #68 from lfl1337/fix/remove-claudeignore-references
docs(optimize): remove references to .claudeignore (#61)
This commit is contained in:
commit
77257bcb89
4 changed files with 11 additions and 106 deletions
|
|
@ -15,7 +15,6 @@ vi.mock('os', async () => {
|
|||
const FAKE_HOME_FOR_MOCK = process.env['CODEBURN_TEST_FAKE_HOME']!
|
||||
|
||||
import {
|
||||
detectMissingClaudeignore,
|
||||
detectBloatedClaudeMd,
|
||||
detectUnusedMcp,
|
||||
detectBashBloat,
|
||||
|
|
@ -60,48 +59,6 @@ afterAll(() => {
|
|||
}
|
||||
})
|
||||
|
||||
// ============================================================================
|
||||
// detectMissingClaudeignore
|
||||
// ============================================================================
|
||||
|
||||
describe('detectMissingClaudeignore', () => {
|
||||
it('flags a project with node_modules but no .claudeignore', () => {
|
||||
const root = makeFixtureRoot()
|
||||
const projectDir = join(root, 'myapp')
|
||||
mkdirSync(join(projectDir, 'node_modules'), { recursive: true })
|
||||
const finding = detectMissingClaudeignore(new Set([projectDir]))
|
||||
expect(finding).not.toBeNull()
|
||||
expect(finding!.impact).toBe('medium')
|
||||
})
|
||||
|
||||
it('does not flag when .claudeignore exists', () => {
|
||||
const root = makeFixtureRoot()
|
||||
const projectDir = join(root, 'myapp')
|
||||
mkdirSync(join(projectDir, 'node_modules'), { recursive: true })
|
||||
writeFile(join(projectDir, '.claudeignore'), 'node_modules\n')
|
||||
expect(detectMissingClaudeignore(new Set([projectDir]))).toBeNull()
|
||||
})
|
||||
|
||||
it('does not flag project without junk dirs', () => {
|
||||
const root = makeFixtureRoot()
|
||||
const projectDir = join(root, 'myapp')
|
||||
mkdirSync(join(projectDir, 'src'), { recursive: true })
|
||||
expect(detectMissingClaudeignore(new Set([projectDir]))).toBeNull()
|
||||
})
|
||||
|
||||
it('escalates to high when three or more projects need it', () => {
|
||||
const root = makeFixtureRoot()
|
||||
const cwds = new Set<string>()
|
||||
for (let i = 0; i < 3; i++) {
|
||||
const p = join(root, `proj-${i}`)
|
||||
mkdirSync(join(p, 'node_modules'), { recursive: true })
|
||||
cwds.add(p)
|
||||
}
|
||||
const finding = detectMissingClaudeignore(cwds)
|
||||
expect(finding!.impact).toBe('high')
|
||||
})
|
||||
})
|
||||
|
||||
// ============================================================================
|
||||
// detectBloatedClaudeMd (including @-import expansion)
|
||||
// ============================================================================
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ import {
|
|||
detectLowReadEditRatio,
|
||||
detectCacheBloat,
|
||||
detectBloatedClaudeMd,
|
||||
detectMissingClaudeignore,
|
||||
computeHealth,
|
||||
computeTrend,
|
||||
type ToolCall,
|
||||
|
|
@ -77,13 +76,14 @@ describe('detectJunkReads', () => {
|
|||
expect(detectJunkReads(calls)).toBeNull()
|
||||
})
|
||||
|
||||
it('builds .claudeignore content from detected + common extras', () => {
|
||||
it('suggests CLAUDE.md advice listing detected and common junk dirs', () => {
|
||||
const calls = Array.from({ length: 5 }, () => call('Read', { file_path: '/x/node_modules/a.js' }))
|
||||
const finding = detectJunkReads(calls)!
|
||||
expect(finding.fix.type).toBe('file-content')
|
||||
if (finding.fix.type === 'file-content') {
|
||||
expect(finding.fix.content).toContain('node_modules')
|
||||
expect(finding.fix.type).toBe('paste')
|
||||
if (finding.fix.type === 'paste') {
|
||||
expect(finding.fix.text).toContain('node_modules')
|
||||
}
|
||||
expect(finding.fix.label).toContain('CLAUDE.md')
|
||||
})
|
||||
})
|
||||
|
||||
|
|
@ -207,16 +207,6 @@ describe('detectBloatedClaudeMd', () => {
|
|||
})
|
||||
})
|
||||
|
||||
describe('detectMissingClaudeignore', () => {
|
||||
it('returns null for empty set', () => {
|
||||
expect(detectMissingClaudeignore(new Set())).toBeNull()
|
||||
})
|
||||
|
||||
it('returns null for non-existent cwds', () => {
|
||||
expect(detectMissingClaudeignore(new Set(['/does/not/exist']))).toBeNull()
|
||||
})
|
||||
})
|
||||
|
||||
describe('computeHealth', () => {
|
||||
it('returns A with 100 for no findings', () => {
|
||||
const { score, grade } = computeHealth([])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue