Skip to content

fix(file): Add devlore:defaults to file.Provider, clean all lint issues - #246

Merged
David-Noble-at-work merged 1 commit into
developfrom
fix/file-provider-defaults
Mar 18, 2026
Merged

David-Noble-at-work merged 1 commit into
developfrom
fix/file-provider-defaults

Conversation

@David-Noble-at-work

Copy link
Copy Markdown
Contributor

Summary

  • devlore:defaults annotations — 7 methods gain optional parameters so Starlark callers can omit mode, honorGitignore, prune, and boundary
  • Integration tests — 4 new Starlark test cases exercising default parameter paths
  • Lint cleanup — all 21 golangci-lint issues in the file provider package resolved: doc comments, type assertion safety, unused params, cognitive complexity, whitespace

Test plan

  • make test passes — all packages green
  • golangci-lint run ./pkg/op/provider/file/... — 0 issues
  • Generated params.gen.go shows ? suffixes on all defaulted params
  • Starlark integration tests exercise: write_text(path, content) without mode, mkdir(path) without mode, glob(pattern) without honor_gitignore, remove(path) without prune/boundary

- Add +devlore:defaults annotations to 7 methods: Glob (honorGitignore),
  WriteBytes/WriteText (mode), Mkdir (mode), Remove/RemoveAll/Unlink
  (prune, boundary) — enables Starlark callers to omit optional params
- Add integration tests exercising default parameters: write_text without
  mode, mkdir without mode, glob without honor_gitignore, remove without
  prune/boundary
- Fix all 21 golangci-lint issues in file provider package:
  - Add package comment, doc comments on NewProvider and Root
  - Combine consecutive same-type params (Copy, Remove, RemoveAll, Unlink)
  - Replace unchecked type assertions with errors.As pattern in 6
    Compensate* methods
  - Remove unused size param from RefreshWith/refreshWith
  - Extract WalkTree helpers (newTrackerIfEnabled, applyGitignore,
    walkDir) to reduce cognitive complexity from 35 to under 20
  - Remove all unnecessary leading newlines (whitespace)
  - Add nolint:gocritic for intentional named-return reassignment
  - Add nolint:gosec for platform-specific Dev int conversion
@David-Noble-at-work
David-Noble-at-work merged commit 33e0013 into develop Mar 18, 2026
2 checks passed
@David-Noble-at-work
David-Noble-at-work deleted the fix/file-provider-defaults branch March 18, 2026 03:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant