Skip to content

Comments

Add include/exclude override system for config-driven path re-inclusion#1

Merged
FloLey merged 1 commit intomasterfrom
claude/add-include-exclude-overrides-l17Fp
Feb 16, 2026
Merged

Add include/exclude override system for config-driven path re-inclusion#1
FloLey merged 1 commit intomasterfrom
claude/add-include-exclude-overrides-l17Fp

Conversation

@FloLey
Copy link
Owner

@FloLey FloLey commented Feb 16, 2026

Implement config-driven include overrides and profile-scoped include/exclude
extensions so users can re-include paths normally excluded by ignore_patterns,
.gitignore, or default excludes without editing .gitignore or weakening global
excludes.

Changes:

  • config.py: Add include_patterns to DEFAULT_CONFIG, validate new fields
    (include_patterns, profile additional_excludes/additional_includes)
  • core.py: Add included_patterns support to DumpSession with _is_force_included
    helper that checks both pathspec matching and directory ancestor traversal
  • engine.py: Merge top-level and profile include/exclude lists in
    _initialize_session, pass effective includes to DumpSession
  • Add 45 comprehensive tests covering validation, behavior, engine integration,
    regression, and force-include helper logic

https://claude.ai/code/session_01U9Lzb7fYHLCXcBuWao1px1

Implement config-driven include overrides and profile-scoped include/exclude
extensions so users can re-include paths normally excluded by ignore_patterns,
.gitignore, or default excludes without editing .gitignore or weakening global
excludes.

Changes:
- config.py: Add include_patterns to DEFAULT_CONFIG, validate new fields
  (include_patterns, profile additional_excludes/additional_includes)
- core.py: Add included_patterns support to DumpSession with _is_force_included
  helper that checks both pathspec matching and directory ancestor traversal
- engine.py: Merge top-level and profile include/exclude lists in
  _initialize_session, pass effective includes to DumpSession
- Add 45 comprehensive tests covering validation, behavior, engine integration,
  regression, and force-include helper logic

https://claude.ai/code/session_01U9Lzb7fYHLCXcBuWao1px1
@FloLey FloLey merged commit 651a4c1 into master Feb 16, 2026
12 checks passed
@gemini-code-assist
Copy link

Summary of Changes

Hello @FloLey, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a flexible system for overriding file exclusion rules, allowing users to explicitly re-include files or directories that would otherwise be ignored by .gitignore or ignore_patterns. This enhancement provides more granular control over which files are processed, especially useful for including specific artifacts from generally excluded directories, without weakening global exclusion settings.

Highlights

  • New Configuration Options: Introduced a new top-level include_patterns configuration option and profile-specific additional_excludes and additional_includes for fine-grained control over file selection.
  • Exclusion Override Logic: Implemented core logic in DumpSession to allow paths matching include_patterns to override existing exclusion rules (e.g., from .gitignore or ignore_patterns).
  • Directory Traversal for Included Files: Ensured that directories are traversed even if they are generally excluded, provided they contain files that are explicitly force-included.
  • Engine Integration: Integrated the new include/exclude patterns into the DumpEngine's session initialization, merging top-level and profile-specific settings.
  • Comprehensive Testing: Added extensive test coverage for config validation, DumpSession behavior, DumpEngine integration, regression scenarios, and the _is_force_included helper logic.
Changelog
  • .dump_config.json
    • Added an empty include_patterns array to the default configuration.
  • src/dumpcode/config.py
    • Updated DEFAULT_CONFIG to include an empty include_patterns list.
    • Enhanced validate_config to check the type of include_patterns and the new additional_excludes and additional_includes fields within profiles.
    • Expanded valid_keys for profiles to recognize additional_excludes and additional_includes.
  • src/dumpcode/core.py
    • Imported the fnmatch module for pattern matching.
    • Modified DumpSession's constructor to accept and store included_patterns.
    • Implemented _create_include_matcher to generate a pathspec matcher for inclusion patterns.
    • Added _is_force_included helper method to determine if a path should be force-included, including logic for directory ancestors.
    • Updated is_excluded to first check for exclusion and then apply force-inclusion logic if a path was initially excluded.
  • src/dumpcode/engine.py
    • Modified _initialize_session to merge top-level ignore_patterns with profile-specific additional_excludes.
    • Combined top-level include_patterns with profile-specific additional_includes to create a comprehensive list for the DumpSession.
    • Passed the combined included_patterns to the DumpSession constructor.
  • tests/test_include_exclude_overrides.py
    • Added a new test file to cover the new include/exclude override system.
    • Included tests for config validation, DumpSession behavior, DumpEngine integration, regression scenarios, and the _is_force_included helper.
Activity
  • No human activity has been recorded on this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a powerful and well-designed override system for file inclusion/exclusion. The changes are logically structured across the configuration, core, and engine components. The new configuration options (include_patterns, additional_excludes, additional_includes) are properly validated. The core logic for force-inclusion in core.py, while intricate, is supported by an exceptionally comprehensive new test suite, which provides strong confidence in its correctness and robustness. The integration into the engine is also clean. I have one minor suggestion to refactor a small piece of duplicated validation logic for improved maintainability. Overall, this is an excellent and high-quality contribution.

Comment on lines +61 to +67
if "additional_excludes" in body:
if not isinstance(body["additional_excludes"], list):
return False

if "additional_includes" in body:
if not isinstance(body["additional_includes"], list):
return False

Choose a reason for hiding this comment

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

medium

The validation logic for additional_excludes and additional_includes is duplicated. You can refactor this into a loop to make the code more concise and easier to maintain if more list-based keys are added in the future.

Suggested change
if "additional_excludes" in body:
if not isinstance(body["additional_excludes"], list):
return False
if "additional_includes" in body:
if not isinstance(body["additional_includes"], list):
return False
for key in ("additional_excludes", "additional_includes"):
if key in body and not isinstance(body[key], list):
return False

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.

2 participants