Skip to content

extend docs#334

Merged
frjcomp merged 5 commits into
mainfrom
improve-docs-gl
Nov 10, 2025
Merged

extend docs#334
frjcomp merged 5 commits into
mainfrom
improve-docs-gl

Conversation

@frjcomp

@frjcomp frjcomp commented Nov 9, 2025

Copy link
Copy Markdown
Collaborator

No description provided.

- Rename --coloredLog flag to --color for better CLI convention
- Auto-disable colors when logging to file to prevent ANSI codes
- Support manual override with --color=true/false flag
- Fix flag detection by checking root command flags for subcommands

Tests:
- Add 5 unit tests for logging behavior in cmd/root_test.go
- Add 8 e2e tests for comprehensive logging verification
- Update existing tests to use new --color flag name

Documentation:
- Update getting_started.md with Linux and Windows installation/usage
- Update scanning.md to use new --color flag
- Add container registry scanning section to GitLab methodology

All tests passing (13/13 logging tests, all cmd tests pass)
- Check error return from FlagSet.Set() to satisfy errcheck linter
- No functional changes, test still passes
- Replace hardcoded /tmp paths with t.TempDir() in logger tests
- Fixes test failures on Windows where /tmp doesn't exist
- All tests now pass on both Linux and Windows
- Removed TestInitLogger_ConsoleDefault, TestInitLogger_FileOutputAutoDisablesColor,
  TestInitLogger_FileOutputWithExplicitColor, TestInitLogger_JsonOutput
- These tests provided no value as they only called initLogger() without assertions
- E2e tests already cover logging behavior by checking actual log file contents
- Removed unused cobra import from root_test.go
@frjcomp frjcomp merged commit c3e7673 into main Nov 10, 2025
9 checks passed
@frjcomp frjcomp deleted the improve-docs-gl branch November 10, 2025 08:23
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