Skip to content

fix: respect ignored files during source discovery - #37

Open
mikemikimike wants to merge 1 commit into
ferrix-lab:mainfrom
mikemikimike:issue-21-ignore-files
Open

fix: respect ignored files during source discovery#37
mikemikimike wants to merge 1 commit into
ferrix-lab:mainfrom
mikemikimike:issue-21-ignore-files

Conversation

@mikemikimike

Copy link
Copy Markdown

Summary / Problem

Closes #21.

list_source_files incorrectly yielded files listed in .insightignore, including sensitive files such as .env, so those files could be read and sent to the Gemini API. It also failed to discover standard extensionless source files such as Dockerfile and Makefile.

Changes

  • Skip ignored files for recursive discovery and explicit file inputs.
  • Keep ignored directories out of traversal.
  • Recognize Dockerfile, Makefile, Containerfile, and Jenkinsfile case-insensitively.
  • Add regression tests covering configured ignores, default ignored directories, explicit ignored files, and extensionless source filenames.

Tests

  • .venv\\Scripts\\python.exe -m pytest --basetemp=.pytest-tmp-final tests/ -q — 2 passed.
  • .venv\\Scripts\\python.exe -m py_compile setup.py insight\\__init__.py insight\\analyzer.py insight\\cli.py insight\\detector.py insight\\reporter.py insight\\utils.py — passed.
  • .venv\\Scripts\\python.exe -c "import insight" — passed.
  • .venv\\Scripts\\ruff.exe check insight\\utils.py tests\\test_utils.py --ignore UP024 — passed.
  • .venv\\Scripts\\ruff.exe format --check tests\\test_utils.py — passed.

Compatibility / Known limitations

The change preserves the existing extension matching behavior and adds only explicit filename matching for common extensionless source files. The upstream baseline currently reports 13 existing Ruff findings outside this change, including the pre-existing UP024 finding in insight/utils.py; no unrelated cleanup is included here.

Issue link

#21

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.

fix(utils): Inverse ignore logic yields ignored files and excludes extensionless files

1 participant