Skip to content

feat: load common rules from config#30

Open
TristanKruse wants to merge 1 commit into
mainfrom
codex/config-rules
Open

feat: load common rules from config#30
TristanKruse wants to merge 1 commit into
mainfrom
codex/config-rules

Conversation

@TristanKruse

Copy link
Copy Markdown
Collaborator

Pull Request

Adds initial configuration-file support for common architecture rules.

This introduces rules_from_config(...), which loads named architecture rules from a JSON file and returns normal checkable rules that can be used with assert_passes(...) or .check().

The goal is to support simple shared project/team rules while keeping the fluent Python API as the primary and most flexible interface.

Supported rule types in this first slice:

  • no_cycles
  • forbidden_dependency
  • forbidden_external_dependency

Example:

from archunitpython import assert_passes, rules_from_config

def test_configured_architecture_rules():
    for rule in rules_from_config("archunitpython.json"):
        assert_passes(rule)

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.

1 participant