File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -487,3 +487,17 @@ func workspaceActivity(m dsl.Matcher) {
487
487
! m .File ().Name .Matches (`_test\.go$` ),
488
488
).Report ("Updating workspace activity should always be done in the workspacestats package." )
489
489
}
490
+
491
+ // noExecInAgent ensures that packages under agent/ don't use exec.Command or
492
+ // exec.CommandContext directly.
493
+ //
494
+ //nolint:unused,deadcode,varnamelen
495
+ func noExecInAgent (m dsl.Matcher ) {
496
+ m .Import ("os/exec" )
497
+ m .Match (
498
+ `exec.Command($*_)` ,
499
+ `exec.CommandContext($*_)` ,
500
+ ).
501
+ Where (m .File ().PkgPath .Matches ("^github.com/coder/coder/agent" )).
502
+ Report ("The agent and its subpackages should not use exec.Command or exec.CommandContext directly. Consider using agentexec.CommandContext instead." )
503
+ }
You can’t perform that action at this time.
0 commit comments