ide на основе vs code · VibeGit
ide на основе vs code Это ide на основе vs code(code oss), в ней будет встроенный умный апи роутинг, свой маркет с плагинами(агент харнесс, поддержка java/kotlin/мобильной разработки, командная разработка проектов, orca, оркестратор агентов
krutaya-ide-na-osnove-vs-code / src / vs / platform / agentHost / test / node / posixCommandLint.test.ts 104 строк · изменён 14 нояб., 04:52
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
import assert from 'assert' ;
import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js' ;
import { findPosixOnlyCommands, getRecordedShellCommand, type IRecordedCommand } from './e2e/harness/posixCommandLint.js' ;
function check ( commands: readonly string [ ] ) : string [ ] {
const recorded: IRecordedCommand[ ] = commands. map ( command => ( { command, toolName:
recorded finding finding command
flagged
assert flagged flagged
assert
command
cmd
command cmd
assert
assert
assert
assert
command toolName
command toolName
command toolName
command toolName reason
command toolName reason
'bash'
}
)
)
;
return
findPosixOnlyCommands
(
)
.
map
(
=>
.
)
;
}
suite
(
'posixCommandLint'
,
(
)
=>
{
ensureNoDisposablesAreLeakedInTestSuite
(
)
;
test
(
'flags the POSIX commands models actually reach for'
,
(
)
=>
{
const
=
[
` wc -l < lines.txt `
,
` printf '%s\\n' "SHELL_VALUE_73" `
,
` ls -1 `
,
` ls -la \${workdir}/ `
,
` rm \${workdir}/before.txt `
,
` mv before.txt after.txt && ls -la after.txt `
,
` cat missing.txt 2>&1 `
,
` mkdir -p output && printf 'NESTED' > output/report.txt `
,
` find / -maxdepth 6 -iname "edit.txt" 2>/dev/null `
,
` xxd \${workdir}/after.txt `
,
` test -f peer-edit.txt && echo EXISTS || echo MISSING `
,
` echo "$HOME" `
,
]
;
.
deepStrictEqual
(
check
(
)
,
)
;
}
)
;
test
(
'extracts provider shell command fields'
,
(
)
=>
{
.
deepStrictEqual
(
[
getRecordedShellCommand
(
{
:
'cat command.txt'
}
)
,
getRecordedShellCommand
(
{
:
'cat cmd.txt'
}
)
,
getRecordedShellCommand
(
{
:
1
,
:
'cat fallback.txt'
}
)
,
getRecordedShellCommand
(
undefined
)
,
]
,
[
'cat command.txt'
,
'cat cmd.txt'
,
'cat fallback.txt'
,
undefined
,
]
)
;
}
)
;
test
(
'accepts the portable forms the suite standardizes on'
,
(
)
=>
{
.
deepStrictEqual
(
check
(
[
` echo SHELL_VALUE_73 `
,
` echo "hello from test" `
,
` git status --porcelain `
,
` node -e "console.log(process.cwd())" `
,
` node -e "require('fs').renameSync('before.txt','after.txt')" `
,
` node -e "require('fs').unlinkSync('delete-me.txt')" `
,
` node -e "console.log(require('fs').readdirSync('.').join(' '))" `
,
` node -e "const fs=require('fs');fs.mkdirSync('output',{recursive:true});fs.writeFileSync('output/report.txt','X')" `
,
` node script.js `
,
` pwd `
,
]
)
,
[
]
)
;
}
)
;
test
(
'does not flag POSIX command names appearing as arguments'
,
(
)
=>
{
.
deepStrictEqual
(
check
(
[
` node -e "console.log('ls')" `
,
` echo cat `
,
` node -e "require('fs').writeFileSync('rm.txt','x')" `
,
` node -e "console.log(require('fs').readdirSync('.'))" `
,
` git status --find-renames `
,
]
)
,
[
]
)
;
}
)
;
test
(
'ignores recorder placeholders that look like variable expansions'
,
(
)
=>
{
.
deepStrictEqual
(
check
(
[
` node -e "console.log(1)" \${workdir} `
,
` echo \${homedir} `
,
` node script.js \${temp} `
,
]
)
,
[
]
)
;
}
)
;
test
(
'reports the reason and tool for each finding'
,
(
)
=>
{
.
deepStrictEqual
(
findPosixOnlyCommands
(
[
{
:
` wc -l lines.txt `
,
:
'bash'
}
,
{
:
` echo ok `
,
:
'bash'
}
,
{
:
` cat x 2>/dev/null `
,
:
'powershell'
}
,
]
)
,
[
{
:
` wc -l lines.txt `
,
:
'bash'
,
:
'uses a POSIX coreutil or shell builtin that is not portable to Windows shells'
}
,
{
:
` cat x 2>/dev/null `
,
:
'powershell'
,
:
'uses a POSIX coreutil or shell builtin that is not portable to Windows shells'
}
,
]
)
;
}
)
;
}
)
;