Skip to content

[dmt] fix unknown license file#346

Merged
ldmonster merged 2 commits intomainfrom
fix/unknown-license-file
Feb 11, 2026
Merged

[dmt] fix unknown license file#346
ldmonster merged 2 commits intomainfrom
fix/unknown-license-file

Conversation

@ldmonster
Copy link
Contributor

@ldmonster ldmonster commented Feb 10, 2026

When unknown file without license - skip

Signed-off-by: Pavel Okhlopkov <pavel.okhlopkov@flant.com>
@ldmonster ldmonster self-assigned this Feb 10, 2026
@ldmonster ldmonster added the enhancement New feature or request label Feb 10, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the module license linter to skip files with unsupported/unknown types (instead of reporting them as license violations), and simplifies LicenseInfo by moving invalid-license conditions to errors.

Changes:

  • Change LicenseParser.ParseFile to return ErrUnsupportedFileType for unknown file types and return errors for invalid/missing licenses (instead of LicenseInfo.Valid/Error fields).
  • Update LicenseRule.CheckFiles to skip unsupported file types and report other parse errors as lint errors.
  • Update license parser tests to use wantErr and pointer *LicenseInfo; mark logger wrappers deprecated and disable SA1019 in golangci-lint.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
pkg/linters/module/rules/license_parser.go Changes parser API: sentinel error for unsupported types; errors for missing/unknown licenses; trims LicenseInfo fields.
pkg/linters/module/rules/license.go Skips unsupported file types based on ErrUnsupportedFileType; reports other parse errors.
pkg/linters/module/rules/license_parser_test.go Adapts tests to new error-based API and pointer LicenseInfo expectations.
internal/logger/logger.go Marks logger.*F wrapper functions as deprecated in favor of slog.
.golangci.yml Disables SA1019 globally to avoid deprecation warnings from logger wrapper usage.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Pavel Okhlopkov <36456348+ldmonster@users.noreply.github.com>
@ldmonster ldmonster merged commit f8d3721 into main Feb 11, 2026
3 checks passed
@ldmonster ldmonster deleted the fix/unknown-license-file branch February 11, 2026 07:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments