Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix wrong line number #1891

Merged
merged 3 commits into from
Oct 17, 2023
Merged

Conversation

shreyas-sriram
Copy link
Contributor

@shreyas-sriram shreyas-sriram commented Oct 13, 2023

Description:

This fixes the wrong line numbers that are reported. See #1876.

  • line number is to be calculated as count("\n") + 1

Checklist:

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

@shreyas-sriram shreyas-sriram requested a review from a team as a code owner October 13, 2023 20:17
@CLAassistant
Copy link

CLAassistant commented Oct 13, 2023

CLA assistant check
All committers have signed the CLA.

@shreyas-sriram
Copy link
Contributor Author

Hey @dustin-decker! Can I get a review of this?

Copy link
Collaborator

@bill-rich bill-rich left a comment

Choose a reason for hiding this comment

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

Thanks for the fix!

@bill-rich bill-rich merged commit 7f534d0 into trufflesecurity:main Oct 17, 2023
7 of 8 checks passed
@shreyas-sriram shreyas-sriram deleted the fix/line-number branch October 17, 2023 14:07
@sxlijin
Copy link

sxlijin commented Oct 18, 2023

This doesn't appear to be a "fix wrong line number" PR - this changes trufflehog's JSON output from returning 0-indexed line numbers to 1-indexed line numbers and is a backwards breaking change. Am I missing something here?

@bill-rich
Copy link
Collaborator

Turns out that the issue is only in the filesystem source. The fix is to add line-aware chunking there.

bill-rich pushed a commit that referenced this pull request Oct 24, 2023
Phoenix591 pushed a commit to Phoenix591/trufflehog that referenced this pull request Oct 27, 2023
Phoenix591 pushed a commit to Phoenix591/trufflehog that referenced this pull request Oct 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants