File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -498,6 +498,20 @@ func noExecInAgent(m dsl.Matcher) {
498
498
`exec.Command($*_)` ,
499
499
`exec.CommandContext($*_)` ,
500
500
).
501
- Where (m .File ().PkgPath .Matches ("^github.com/coder/coder/ agent" )).
501
+ Where (m .File ().PkgPath .Matches ("/ agent/ " )).
502
502
Report ("The agent and its subpackages should not use exec.Command or exec.CommandContext directly. Consider using agentexec.CommandContext instead." )
503
503
}
504
+
505
+ // noPTYInAgent ensures that packages under agent/ don't use pty.Command or
506
+ // pty.CommandContext directly.
507
+ //
508
+ //nolint:unused,deadcode,varnamelen
509
+ func noPTYInAgent (m dsl.Matcher ) {
510
+ m .Import ("github.com/coder/coder/v2/pty" )
511
+ m .Match (
512
+ `pty.Command($*_)` ,
513
+ `pty.CommandContext($*_)` ,
514
+ ).
515
+ Where (m .File ().PkgPath .Matches (`/agent/` )).
516
+ Report ("The agent and its subpackages should not use pty.Command or pty.CommandContext directly. Consider using agentexec.PTYCommandContext instead." )
517
+ }
You can’t perform that action at this time.
0 commit comments