Skip to content

feat: integrate charmbracelet/fang v2 with golangci-lint brand theme#6473

Draft
LarsArtmann wants to merge 2 commits intogolangci:mainfrom
LarsArtmann:feat/fang-v2-integration
Draft

feat: integrate charmbracelet/fang v2 with golangci-lint brand theme#6473
LarsArtmann wants to merge 2 commits intogolangci:mainfrom
LarsArtmann:feat/fang-v2-integration

Conversation

@LarsArtmann
Copy link
Copy Markdown

@LarsArtmann LarsArtmann commented Apr 1, 2026

Closes #6464

What

Styles the golangci-lint CLI with charmbracelet/fang v2: colorful help pages, error messages, and version output using a custom color scheme matching the golangci-lint.run website.

Changes

Core integration (root.go, main.go, theme.go, go.mod):

  • Replace c.cmd.Execute() with fang.Execute() + fang.WithVersion(c.info.Version) for native version handling
  • Add custom golangciColorScheme using brand colors (primary blue #2563eb, teal accent #0d9488)
  • Remove duplicate error printing from main.go (fang handles styled errors internally)

Cleanup (12 files):

  • Remove color.GreenString() from ~60 flag descriptions — fang now styles these via ColorScheme.FlagDescription
  • Remove unused github.com/fatih/color imports from 7 files

Preserved behavior

  • version subcommand with --json, --debug, --short flags unchanged
  • help linters / help formatters subcommands unchanged
  • --color flag still controls linter output coloring
  • All exit codes unchanged

Integrate charmbracelet/fang v2 to provide styled help pages and error
messages for the golangci-lint CLI. This replaces the default Cobra help
and error output with colorful, well-formatted alternatives.

- Replace cobra.Command.Execute() with fang.Execute() in root command
- Use fang.WithoutVersion() to preserve existing version handling
- Remove duplicate error printing in main.go (fang handles errors)
- Existing custom help subcommands (help linters, help formatters) preserved

Closes golangci#6464

💘 Generated with Crush

Assisted-by: GLM-5.1 via Crush <crush@charm.land>
@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@boring-cyborg
Copy link
Copy Markdown

boring-cyborg bot commented Apr 1, 2026

Hey, thank you for opening your first Pull Request !

@LarsArtmann
Copy link
Copy Markdown
Author

I can not accept the CLA at: https://cla-assistant.io/golangci/golangci-lint?pullRequest=6473

Screenshot 2026-04-01 at 05 10 36

@LarsArtmann LarsArtmann marked this pull request as draft April 1, 2026 03:11
…rsion

 --no-long WithoutVersion

Integrate charmbracelet/fang v2 with a custom color scheme matching the
golangci-lint branding (primary blue #2563eb).

Now that fang styles the CLI help and error messages, and version output,
we can remove the redundant color.GreenString() wrappers from all
flag descriptions since fang already provides consistent theming.

- Add WithVersion() instead of WithoutVersion() for let fang handle --version
  natively
- Add custom color theme using golangci-lint.run brand colors
- Remove color.GreenString() from ~60 flag descriptions across 12 files
- Remove unused color imports from 7 files

💘 Generated with Crush

Assisted-by: GLM-5.1 via Crush <crush@charm.land>
@LarsArtmann LarsArtmann changed the title feat: adopt charmbracelet/fang v2 for styled CLI help and errors feat: integrate charmbracelet/fang v2 with golangci-lint brand theme Apr 1, 2026
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.

adopt charmbracelet/fang v2 for a better looking UI

2 participants