Skip to content

feat: support .archignore exclusions#14

Open
TristanKruse wants to merge 5 commits into
mainfrom
codex/archignore-support
Open

feat: support .archignore exclusions#14
TristanKruse wants to merge 5 commits into
mainfrom
codex/archignore-support

Conversation

@TristanKruse

Copy link
Copy Markdown
Collaborator

Pull Request

Adds .archignore support so projects can exclude generated, legacy, or otherwise irrelevant files from architecture checks and file-based metrics.

The ignore file is loaded automatically from the analyzed project root and supports:

  • blank lines and comments
  • glob patterns
  • root-relative patterns
  • path patterns
  • trailing-slash directory patterns

Ignored files are excluded from graph extraction and metric file scans. Local files ignored by .archignore are also not retained as internal dependency targets.

Change Type

  • Bug fix
  • Feature
  • Documentation
  • Refactoring

Validation

  • Full test suite passes: 243 passed
  • Ruff passes on touched Python files
  • mypy passes for src/archunitpython/
  • git diff --check passes

Notes

This intentionally implements a small .gitignore-style subset. Negation patterns like !keep.py are not supported yet and can be added later if needed.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds first-class .archignore support so file-based analysis (dependency graph extraction and metrics scanning) can exclude generated/legacy/irrelevant files, and tightens release automation by synchronizing version metadata checks + package build in CI.

Changes:

  • Implement .archignore parsing and path-based exclusion handling in the core Python file discovery / graph extraction pipeline.
  • Apply resolved exclude patterns to file-metric scans and class-info extraction, and add tests covering ignore behavior (including dependency-target suppression).
  • Add release metadata helper scripts, wire them into semantic-release + CI, and ensure CI builds the package.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/archunitpython/common/extraction/extract_graph.py Adds .archignore loading, path-aware exclude matching, and ensures ignored files aren’t retained as dependency targets.
src/archunitpython/metrics/fluentapi/metrics.py Updates file-metric scanning to use resolved exclude patterns (defaults + .archignore).
src/archunitpython/metrics/extraction/extract_class_info.py Ensures class-info extraction respects .archignore via resolved exclude patterns.
tests/common/test_extract_graph.py Adds tests for .archignore exclusions and for ignoring dependency targets.
tests/metrics/test_metrics_fluentapi.py Adds a regression test ensuring file metrics respect .archignore.
README.md Documents how to use .archignore patterns.
scripts/check_release_metadata.py New script to validate pyproject / package __version__ / changelog version synchronization.
scripts/bump_release_version.py New script used by semantic-release to update version metadata consistently.
.releaserc.json Switches prepare step to the new bump script and commits __init__.py version updates.
.github/workflows/integrate.yaml Adds release metadata check, expands Ruff scope to scripts/, and builds the package in CI.
pyproject.toml Adds build to dev dependencies to support CI package build.
BACKLOG.md Marks .archignore and release-metadata items as completed.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/archunitpython/common/extraction/extract_graph.py
Comment thread src/archunitpython/common/extraction/extract_graph.py
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