chore!: prepare for v1.0.0 release

Bumps the application version to 1.0.0, signaling the first stable release. This version consolidates several new features and breaking API changes.

This commit also includes various code quality improvements:
- Modernizes tests to use t.Setenv for safer environment variable handling.
- Addresses various linter warnings (gosec, errcheck).
- Updates loop syntax to use Go 1.22's range-over-integer feature.

BREAKING CHANGE: The public API has been updated for consistency and to introduce new features like context support and structured logging.
- `GetSupportedFormat()` is renamed to `SupportedFormat()`.
- `GetSupportedFormats()` is renamed to `SupportedFormats()`.
- `FetchCourse()` now requires a `context.Context` parameter.
- `NewArticulateParser()` constructor signature has been updated.
This commit is contained in:
2025-11-06 05:59:52 +01:00
parent 37927a36b6
commit 68c6f4e408
11 changed files with 45 additions and 20 deletions

View File

@ -146,7 +146,7 @@ func createBenchmarkCourse() *models.Course {
// createLargeBenchmarkCourse creates a large course for stress testing.
func createLargeBenchmarkCourse() *models.Course {
lessons := make([]models.Lesson, 50)
for i := 0; i < 50; i++ {
for i := range 50 {
lessons[i] = models.Lesson{
ID: string(rune(i)),
Title: "Lesson " + string(rune(i)),

View File

@ -72,6 +72,7 @@ func (e *DocxExporter) Export(course *models.Course, outputPath string) error {
}
// Create the file
// #nosec G304 - Output path is provided by user via CLI argument, which is expected behavior
file, err := os.Create(outputPath)
if err != nil {
return fmt.Errorf("failed to create output file: %w", err)

View File

@ -110,6 +110,7 @@ func (e *HTMLExporter) Export(course *models.Course, outputPath string) error {
buf.WriteString("</body>\n")
buf.WriteString("</html>\n")
// #nosec G306 - 0644 is appropriate for export files that should be readable by others
return os.WriteFile(outputPath, buf.Bytes(), 0644)
}

View File

@ -80,6 +80,7 @@ func (e *MarkdownExporter) Export(course *models.Course, outputPath string) erro
buf.WriteString("\n---\n\n")
}
// #nosec G306 - 0644 is appropriate for export files that should be readable by others
return os.WriteFile(outputPath, buf.Bytes(), 0644)
}

Binary file not shown.