Skip to content

Conversation

@dasmfm
Copy link

@dasmfm dasmfm commented Jan 8, 2026

Description:

Basic support for Markdown output.
For now there are hardcoded fields, but in the future it could be easily extended.

Checklist:

  • Tests passing (make test-community)?
  • Lint passing (make lint this requires golangci-lint)?

@dasmfm dasmfm requested a review from a team January 8, 2026 14:13
@CLAassistant
Copy link

CLAassistant commented Jan 8, 2026

CLA assistant check
All committers have signed the CLA.

@rosecodym
Copy link
Contributor

Hey @dasmfm - thanks for taking the time to contribute to the project! Unfortunately, we have some concerns about the specificity of this PR. Markdown output is cool, but this implementation is tailored for filesystem output, and will generate deficient output if other sources are scanned instead.

It also seems like markdown could be generated from generated JSON (by a separate postprocessor), which would allow for more generality and eliminate the need to change TruffleHog itself. This seems to us like a preferable solution. I don't know what your use case is - did you consider something like that? Would it work for you?

if isTrue(inputs["markdown"].Value) {
command = append(command, "--markdown")
}

Copy link

Choose a reason for hiding this comment

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

TUI allows conflicting output format flags simultaneously

Low Severity

The TUI configuration allows users to enable both --markdown and --json output formats simultaneously without any validation or warning. When both are enabled, the Cmd() function appends both flags to the command, but main.go's switch statement checks *jsonOut before *markdownOut, causing JSON to silently take precedence. Users enabling both options may unexpectedly receive JSON output instead of the Markdown they also selected.

Additional Locations (1)

Fix in Cursor Fix in Web

Choose a reason for hiding this comment

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

It's common pattern for all printers. If neccesary, should be fixed in separate PR.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.


if !hasFile {
file = "n/a"
}
Copy link

Choose a reason for hiding this comment

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

Redundant fallback already handled by helper function

Low Severity

The check if !hasFile { file = "n/a" } is redundant. The extractFileLine function in helpers.go already initializes file to "n/a" as its default value (line 9), and only updates it when a file is actually found. When hasFile is false, file is already "n/a", making this conditional assignment unnecessary.

Fix in Cursor Fix in Web

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.

4 participants