Skip to content

Fix --git without --ref and --size_limit for single file - #993

Merged
babenek merged 2 commits into
mainfrom
bug_fix
Oct 22, 2026
Merged

babenek merged 2 commits into
mainfrom
bug_fix

Conversation

@Pomidorry

Copy link
Copy Markdown
Collaborator

Description

  • Fix --git without --ref skipping local branches
  • Fix --size_limit ignored for a single file in --path

1. --git without --ref skips local branches

Steps to reproduce bug before fix:

mkdir /tmp/cs_git && cd /tmp/cs_git && git init
echo 'aws_id = "AKIAGIREOGIAWSKEY123"' > conf.py
git add . && git commit -m init

python -m credsweeper --git /tmp/cs_git --ml_threshold 0
# for 0 commits : 0   <- expected 1
python -m credsweeper --git /tmp/cs_git --ref master --ml_threshold 0
# for 1 commits : 1

2. --size_limit ignored for a single file

Steps to reproduce bug before fix:

mkdir /tmp/cs_size
echo 'aws_id = "AKIAGIREOGIAWSKEY123"' > /tmp/cs_size/conf.py

python -m credsweeper --path /tmp/cs_size --size_limit 10 --ml_threshold 0
# over limit, Detected Credentials: 0
python -m credsweeper --path /tmp/cs_size/conf.py --size_limit 10 --ml_threshold 0
# Detected Credentials: 1   <- expected 0

How has this been tested?

  • UnitTest
  • Benchmark

@Pomidorry
Pomidorry requested a review from a team as a code owner October 21, 2026 11:52
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.65%. Comparing base (135a9dc) to head (efdf62f).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #993      +/-   ##
==========================================
+ Coverage   90.63%   90.65%   +0.01%     
==========================================
  Files         169      169              
  Lines        7307     7307              
  Branches     1225     1225              
==========================================
+ Hits         6623     6624       +1     
+ Misses        462      461       -1     
  Partials      222      222              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@babenek babenek left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@babenek
babenek merged commit b4875ca into main Oct 22, 2026
@babenek
babenek deleted the bug_fix branch October 24, 2026 07:14
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.

3 participants