Skip to content

Commit 474a248

Browse files
authored
Merge pull request #162 from rabbitmq/testonly-directive
Add erlang_app_testonly directive
2 parents 7be1d8c + 3f239fb commit 474a248

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

gazelle/configure.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ const (
2020
generateTestBeamUnconditionally = "erlang_always_generate_test_beam_files"
2121
generateSkipRules = "erlang_skip_rules"
2222
localAppsDirsDirective = "erlang_apps_dirs"
23+
erlangAppTestonlyDirective = "erlang_app_testonly"
2324
erlangAppDepDirective = "erlang_app_dep"
2425
erlangAppDepIgnoreDirective = "erlang_app_dep_ignore"
2526
erlangAppDepBuildOnlyDirective = "erlang_app_dep_exclude"
@@ -216,6 +217,7 @@ func (erlang *Configurer) KnownDirectives() []string {
216217
generateTestBeamUnconditionally,
217218
generateSkipRules,
218219
localAppsDirsDirective,
220+
erlangAppTestonlyDirective,
219221
erlangAppDepDirective,
220222
erlangAppDepIgnoreDirective,
221223
erlangAppDepBuildOnlyDirective,
@@ -264,6 +266,8 @@ func (erlang *Configurer) Configure(c *config.Config, rel string, f *rule.File)
264266
return filepath.Join(rel, d)
265267
}, filepath.SplitList(d.Value))
266268
erlangConfig.AppsDirs.Add(dirs...)
269+
case erlangAppTestonlyDirective:
270+
erlangConfig.Testonly = boolValue(d)
267271
case erlangAppDepDirective:
268272
erlangConfig.Deps.Add(d.Value)
269273
case erlangAppDepIgnoreDirective:

gazelle/kinds.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ func erlangAppKindInfo(l *erlangLang) rule.KindInfo {
4242
"hdrs": true,
4343
"srcs": true,
4444
"extra_apps": true,
45+
"testonly": true,
4546
},
4647
ResolveAttrs: map[string]bool{
4748
"deps": true,

0 commit comments

Comments
 (0)