Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
wildum committed Feb 16, 2024
1 parent 1221f5d commit 11bb9fd
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pkg/flow/internal/controller/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ func (l *Loader) populateDeclareNodes(g *dag.Graph, declareBlocks []*ast.BlockSt
var diags diag.Diagnostics
l.declareNodes = map[string]*DeclareNode{}
for _, declareBlock := range declareBlocks {
if declareBlock.Label == "declare" {
if declareBlock.Label == declareType {
diags.Add(diag.Diagnostic{
Severity: diag.SeverityLevelError,
Message: "'declare' is not a valid label for a declare block",
Expand Down Expand Up @@ -857,7 +857,7 @@ func (l *Loader) collectCustomComponentReferences(stmts ast.Body, uniqueReferenc
)

switch {
case componentName == "declare":
case componentName == declareType:
l.collectCustomComponentReferences(blockStmt.Body, uniqueReferences)
case foundDeclare:
uniqueReferences[declareNode] = struct{}{}
Expand Down
4 changes: 2 additions & 2 deletions pkg/flow/internal/controller/node_config_import.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ func (cn *ImportConfigNode) processImportedContent(content *ast.File) error {

componentName := strings.Join(blockStmt.Name, ".")
switch componentName {
case "declare":
case declareType:
cn.processDeclareBlock(blockStmt)
case importsource.BlockImportFile, importsource.BlockImportString: // TODO: add other import sources
err := cn.processImportBlock(blockStmt, componentName)
Expand Down Expand Up @@ -332,7 +332,7 @@ func (cn *ImportConfigNode) Run(ctx context.Context) error {
return runner.ApplyTasks(newCtx, tasks)
}

updateTasks()
errChan <- updateTasks()

go func() {
errChan <- cn.source.Run(newCtx)
Expand Down
2 changes: 2 additions & 0 deletions pkg/flow/internal/controller/node_declare.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ type DeclareNode struct {

var _ BlockNode = (*DeclareNode)(nil)

const declareType = "declare"

// NewDeclareNode creates a new declare node with a content which will be loaded by custom components.
func NewDeclareNode(block *ast.BlockStmt) *DeclareNode {
return &DeclareNode{
Expand Down

0 comments on commit 11bb9fd

Please sign in to comment.