-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #70 from easy-up/main
fix: crash bug when adding a bundle file with no tag
- Loading branch information
Showing
16 changed files
with
306 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -69,7 +69,7 @@ var validateCmd = &cobra.Command{ | |
return nil | ||
} | ||
|
||
return nil | ||
return err | ||
}, | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package artifacts | ||
|
||
import ( | ||
"errors" | ||
"github.com/easy-up/go-coverage" | ||
"log/slog" | ||
"strings" | ||
) | ||
|
||
func example() (coverage.Report, error) { | ||
lcovParser := coverage.New(coverage.LCOV) | ||
report, err := lcovParser.Parse("./path/to/lcov.info") | ||
if err != nil { | ||
// Handle error | ||
return coverage.Report{}, err | ||
} | ||
// Use the parsed report | ||
return report, nil | ||
} | ||
|
||
func IsCoverageReport(inputFilename string) bool { | ||
return strings.Contains(inputFilename, "lcov") || | ||
strings.HasSuffix(inputFilename, ".info") || | ||
strings.Contains(inputFilename, "clover") || | ||
strings.Contains(inputFilename, "cobertura") || | ||
strings.Contains(inputFilename, "coverage") | ||
} | ||
|
||
func GetCoverageMode(inputFilename string) (coverage.CoverageMode, error) { | ||
var coverageFormat coverage.CoverageMode | ||
if strings.Contains(inputFilename, "lcov") || strings.HasSuffix(inputFilename, ".info") { | ||
coverageFormat = coverage.LCOV | ||
} else if strings.Contains(inputFilename, "clover") { | ||
coverageFormat = coverage.CLOVER | ||
} else if strings.HasSuffix(inputFilename, ".xml") { | ||
coverageFormat = coverage.COBERTURA | ||
} else { | ||
slog.Error("unsupported coverage file type, cannot be determined from filename", "filename", inputFilename) | ||
return "", errors.New("failed to list coverage content") | ||
} | ||
return coverageFormat, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.