Skip to content

Commit

Permalink
fix lint issue
Browse files Browse the repository at this point in the history
  • Loading branch information
shivasurya committed Feb 24, 2025
1 parent e320d74 commit 17d989f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion sourcecode-parser/.golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ linters:
- tagliatelle

# Test-related checks. All of them are good.
- tenv
- usetesting
- testableexamples
- thelper
- tparallel
Expand Down
7 changes: 3 additions & 4 deletions sourcecode-parser/model/member.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ func (m *Method) SameParamTypes(other *Method) bool {
return true

Check warning on line 200 in sourcecode-parser/model/member.go

View check run for this annotation

Codecov / codecov/patch

sourcecode-parser/model/member.go#L200

Added line #L200 was not covered by tests
}

// Add these methods to the existing Method struct
// Add these methods to the existing Method struct.
func (m *Method) Insert(db *sql.DB) error {
query := `INSERT INTO method_decl (
name, qualified_name, return_type, parameters, parameter_names,
Expand All @@ -215,14 +215,14 @@ func (m *Method) Insert(db *sql.DB) error {
m.Visibility, m.IsAbstract, m.IsStrictfp,
m.IsStatic, m.IsFinal, m.IsConstructor,
m.SourceDeclaration)

if err != nil {
log.Printf("Failed to insert method: %v", err)
return err
}

Check warning on line 221 in sourcecode-parser/model/member.go

View check run for this annotation

Codecov / codecov/patch

sourcecode-parser/model/member.go#L204-L221

Added lines #L204 - L221 were not covered by tests

return nil

Check warning on line 223 in sourcecode-parser/model/member.go

View check run for this annotation

Codecov / codecov/patch

sourcecode-parser/model/member.go#L223

Added line #L223 was not covered by tests
}

func (m *Method) Update(db *sql.DB) error {
query := `UPDATE methods SET
qualified_name = ?, return_type = ?, parameters = ?,
Expand All @@ -247,7 +247,7 @@ func (m *Method) Delete(db *sql.DB) error {
return err

Check warning on line 247 in sourcecode-parser/model/member.go

View check run for this annotation

Codecov / codecov/patch

sourcecode-parser/model/member.go#L244-L247

Added lines #L244 - L247 were not covered by tests
}

// Query helper methods
// Query helper methods.
func FindMethodByName(db *sql.DB, name string) (*Method, error) {
query := `SELECT * FROM methods WHERE name = ?`
row := db.QueryRow(query, name)
Expand All @@ -261,7 +261,6 @@ func FindMethodByName(db *sql.DB, name string) (*Method, error) {
&method.IsStrictfp, &method.IsStatic,
&method.IsFinal, &method.IsConstructor,
&method.SourceDeclaration)

if err != nil {
return nil, err
}

Check warning on line 266 in sourcecode-parser/model/member.go

View check run for this annotation

Codecov / codecov/patch

sourcecode-parser/model/member.go#L251-L266

Added lines #L251 - L266 were not covered by tests
Expand Down
4 changes: 2 additions & 2 deletions sourcecode-parser/tree/java/parse_statement.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func ParseYieldStatement(node *sitter.Node, sourceCode []byte, file string) *mod
yieldStmt := &model.YieldStmt{}
yieldStmtExpr := &model.Expr{NodeString: node.Child(1).Content(sourceCode)}
yieldStmt.Value = yieldStmtExpr
//uniqueyieldID := fmt.Sprintf("yield_%d_%d_%s", node.StartPoint().Row+1, node.StartPoint().Column+1, file)
// uniqueyieldID := fmt.Sprintf("yield_%d_%d_%s", node.StartPoint().Row+1, node.StartPoint().Column+1, file)
return yieldStmt

Check warning on line 37 in sourcecode-parser/tree/java/parse_statement.go

View check run for this annotation

Codecov / codecov/patch

sourcecode-parser/tree/java/parse_statement.go#L32-L37

Added lines #L32 - L37 were not covered by tests
}

Expand All @@ -44,7 +44,7 @@ func ParseAssertStatement(node *sitter.Node, sourceCode []byte, file string) *mo
assertStmt.Message = &model.Expr{NodeString: node.Child(3).Content(sourceCode)}
}

Check warning on line 45 in sourcecode-parser/tree/java/parse_statement.go

View check run for this annotation

Codecov / codecov/patch

sourcecode-parser/tree/java/parse_statement.go#L40-L45

Added lines #L40 - L45 were not covered by tests

//niqueAssertID := fmt.Sprintf("assert_%d_%d_%s", node.StartPoint().Row+1, node.StartPoint().Column+1, file)
// niqueAssertID := fmt.Sprintf("assert_%d_%d_%s", node.StartPoint().Row+1, node.StartPoint().Column+1, file)
return assertStmt

Check warning on line 48 in sourcecode-parser/tree/java/parse_statement.go

View check run for this annotation

Codecov / codecov/patch

sourcecode-parser/tree/java/parse_statement.go#L48

Added line #L48 was not covered by tests
}

Expand Down

0 comments on commit 17d989f

Please sign in to comment.