Skip to content

feat: reintroduce pretty-logging and update codebase for modern conventions#17

Merged
jamesainslie merged 8 commits intomainfrom
chore-more-polish
Dec 5, 2025
Merged

feat: reintroduce pretty-logging and update codebase for modern conventions#17
jamesainslie merged 8 commits intomainfrom
chore-more-polish

Conversation

@preminger
Copy link
Copy Markdown
Collaborator

@preminger preminger commented Dec 5, 2025

Screenshots

Before: (running with --verbose --debug)

image

After: (running with --verbose --debug)

image

Description

This pull request includes the following updates and improvements:

  • Reinstated pretty-logging for compiled output and improved linting; details:

    • Mage originally enforced (via testing) a requirement that the stave_output_file.go it produces - generated from (what is now, in the Stave codebase) the mainfile.gotmpl template - make use of no dependencies that are not in the Go standard library.
      • I cannot see why this is necessary.
        • I see the logic in it not pulling down any Stave pkg/ dependencies in particular - since that would create a "burrowing" dependency:
          • I.e., the compilation & testing of version n+1 of Stave would depend on what was the latest release of Stave at that time, creating a non-repeatable development path.
        • But this problem does not arise with dependencies on other non-3rd-party code.
    • So I relaxed that requirement, and used charmbracelet/log in mainfile.gotmpl.
      • Thus, the generated binary that the stavefile is compiled into has pretty-printed structured logging, just like the outer Stave app has.
    • I also replaced the previous TestOnlyStdLib test with a TestNoSelfDependencies that enforces the new, more relaxed requirement (namely, that mainfile.gotmpl not import any stave code).
  • Adjusted LintGo target dependencies to include the missing Init dependency.

  • Reverted structured-logging for verbose option (-v/--verbose) to simpler console messages.

before:

time=2025-12-05T15:54:07.761-05:00 level=INFO msg="running dependency" dependency=Test
time=2025-12-05T15:54:07.761-05:00 level=INFO msg="running dependency" dependency=Init
time=2025-12-05T15:54:07.761-05:00 level=INFO msg="running dependency" dependency=TestGo
time=2025-12-05T15:54:07.761-05:00 level=INFO msg="running dependency" dependency=Lint
time=2025-12-05T15:54:07.761-05:00 level=INFO msg=exec cmd=brew args="[\"bundle\" \"--file=Brewfile\"]"
time=2025-12-05T15:54:07.761-05:00 level=INFO msg="running dependency" dependency=LintGo
time=2025-12-05T15:54:07.761-05:00 level=INFO msg="running dependency" dependency=Markdownlint
time=2025-12-05T15:54:07.761-05:00 level=INFO msg=exec cmd=golangci-lint args="[\"run\" \"--fix\" \"--allow-parallel-runners\" \"--build-tags='!ignore'\"]"

after:

[STAVE] Running dependency: Test
[STAVE] Running dependency: Init
[STAVE] Running dependency: TestGo
[STAVE] Running dependency: Lint
[STAVE] Running dependency: LintGo
[STAVE] Running dependency: Markdownlint
[STAVE] exec: brew "bundle" "--file=Brewfile"
[STAVE] exec: golangci-lint "run" "--fix" "--allow-parallel-runners" "--build-tags='!ignore'"
  • Removed deprecated // +build statements for modern build tags.

  • Replaced usages of deprecated io/ioutil package with appropriate alternatives.

  • Deleted install_test.go as its functionality is now covered by CI's dogfooding bootstrap.

@preminger preminger changed the title Reintroduce pretty-logging and update codebase for modern conventions feat: reintroduce pretty-logging and update codebase for modern conventions Dec 5, 2025
@preminger preminger marked this pull request as ready for review December 5, 2025 20:50
Copy link
Copy Markdown
Contributor

@jamesainslie jamesainslie left a comment

Choose a reason for hiding this comment

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

Wonderbra!!

@jamesainslie jamesainslie merged commit 0cd8091 into main Dec 5, 2025
1 check passed
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.

2 participants