archunit 0.0.1 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/API.md +498 -0
- data/CHANGELOG.md +85 -0
- data/CODE_OF_CONDUCT.md +40 -0
- data/CONTRIBUTING.md +75 -0
- data/GUIDE.md +804 -0
- data/README.md +224 -289
- data/SECURITY.md +64 -0
- data/SUPPORT.md +23 -0
- data/assets/logo-rounded.png +0 -0
- data/exe/archunit +7 -0
- data/lib/archunit/cli/analysis_report.rb +62 -0
- data/lib/archunit/cli/analysis_text.rb +25 -0
- data/lib/archunit/cli/baseline_context.rb +42 -0
- data/lib/archunit/cli/baseline_document.rb +58 -0
- data/lib/archunit/cli/baseline_fingerprint.rb +36 -0
- data/lib/archunit/cli/baseline_identity.rb +85 -0
- data/lib/archunit/cli/baseline_ledger.rb +38 -0
- data/lib/archunit/cli/baseline_object.rb +15 -0
- data/lib/archunit/cli/baseline_options.rb +48 -0
- data/lib/archunit/cli/baseline_run.rb +85 -0
- data/lib/archunit/cli/baseline_schema.rb +53 -0
- data/lib/archunit/cli/baseline_text.rb +31 -0
- data/lib/archunit/cli/configuration.rb +93 -0
- data/lib/archunit/cli/options.rb +117 -0
- data/lib/archunit/cli/report.rb +121 -0
- data/lib/archunit/cli/runner.rb +108 -0
- data/lib/archunit/cli.rb +15 -0
- data/lib/archunit/common/extraction/dependency_evidence.rb +44 -0
- data/lib/archunit/common/extraction/edge.rb +7 -2
- data/lib/archunit/common/extraction/import_kind.rb +4 -1
- data/lib/archunit/common/extraction/parse_diagnostic.rb +23 -0
- data/lib/archunit/common/extraction/source_exclusions.rb +43 -0
- data/lib/archunit/common/fluentapi/check_options.rb +53 -2
- data/lib/archunit/common/fluentapi/checkable.rb +25 -1
- data/lib/archunit/common/logging/check_logger.rb +8 -0
- data/lib/archunit/common/logging/inspection.rb +59 -0
- data/lib/archunit/common/logging/logging_options.rb +5 -0
- data/lib/archunit/common/pattern.rb +18 -8
- data/lib/archunit/common/projection/cycles/johnson_cycles.rb +35 -19
- data/lib/archunit/common/projection/cycles/tarjan_scc.rb +30 -10
- data/lib/archunit/error/source_parse_error.rb +38 -0
- data/lib/archunit/extraction/analysis_observer.rb +24 -0
- data/lib/archunit/extraction/analysis_profile.rb +30 -0
- data/lib/archunit/extraction/analysis_snapshot.rb +51 -0
- data/lib/archunit/extraction/arch_ignore.rb +91 -0
- data/lib/archunit/extraction/conservative_local_flow.rb +100 -0
- data/lib/archunit/extraction/constant_index.rb +110 -0
- data/lib/archunit/extraction/constant_visitor.rb +137 -0
- data/lib/archunit/extraction/dependency_context.rb +30 -0
- data/lib/archunit/extraction/discover_gemspec_load_paths.rb +96 -0
- data/lib/archunit/extraction/enumerate_source_files.rb +36 -9
- data/lib/archunit/extraction/extract_dependencies.rb +74 -15
- data/lib/archunit/extraction/extract_graph.rb +74 -40
- data/lib/archunit/extraction/extract_imports.rb +57 -124
- data/lib/archunit/extraction/extraction_profile.rb +105 -0
- data/lib/archunit/extraction/graph_assembly.rb +32 -0
- data/lib/archunit/extraction/graph_cache_key.rb +27 -0
- data/lib/archunit/extraction/import_calls.rb +93 -0
- data/lib/archunit/extraction/import_resolver.rb +65 -0
- data/lib/archunit/extraction/import_source_policy.rb +123 -0
- data/lib/archunit/extraction/import_visitor.rb +89 -0
- data/lib/archunit/extraction/load_arguments.rb +34 -0
- data/lib/archunit/extraction/local_string_tracker.rb +81 -0
- data/lib/archunit/extraction/resolve_import.rb +5 -3
- data/lib/archunit/extraction/resolve_load_paths.rb +98 -0
- data/lib/archunit/extraction/resolved_import.rb +5 -2
- data/lib/archunit/extraction/source_analysis.rb +26 -0
- data/lib/archunit/extraction/static_import_path.rb +111 -0
- data/lib/archunit/extraction/validate_extraction_paths.rb +37 -0
- data/lib/archunit/files/extraction/extract_file_info.rb +14 -5
- data/lib/archunit/files/extraction/file_info.rb +1 -2
- data/lib/archunit/files/fluentapi/depend_on_external_module_condition.rb +2 -0
- data/lib/archunit/files/fluentapi/depend_on_external_module_condition_builder.rb +2 -0
- data/lib/archunit/files/fluentapi/depend_on_file_condition.rb +6 -0
- data/lib/archunit/files/fluentapi/depend_on_file_condition_builder.rb +6 -0
- data/lib/archunit/files/fluentapi/file_condition_builder.rb +12 -0
- data/lib/archunit/files/fluentapi/file_rule_support.rb +8 -1
- data/lib/archunit/files/fluentapi/files.rb +6 -0
- data/lib/archunit/files/fluentapi/match_pattern_file_condition_builder.rb +14 -0
- data/lib/archunit/files/fluentapi/positive_match_pattern_file_condition_builder.rb +2 -0
- data/lib/archunit/graph/fluentapi/graph.rb +5 -0
- data/lib/archunit/graph/fluentapi/project_graph_builder.rb +44 -0
- data/lib/archunit/graph/projection/aggregate_edges.rb +4 -2
- data/lib/archunit/graph/projection/graph_query_options.rb +1 -2
- data/lib/archunit/graph/projection/graph_report_edge.rb +12 -2
- data/lib/archunit/graph/rendering/json_renderer.rb +3 -1
- data/lib/archunit/layers/fluentapi/architecture_preset.rb +49 -0
- data/lib/archunit/layers/fluentapi/layer_definition_builder.rb +4 -0
- data/lib/archunit/layers/fluentapi/layer_dependency_rule_builder.rb +4 -0
- data/lib/archunit/layers/fluentapi/layered_architecture.rb +5 -0
- data/lib/archunit/layers/fluentapi/layers.rb +5 -0
- data/lib/archunit/layers/fluentapi/preset_definitions.rb +39 -0
- data/lib/archunit/layers/fluentapi/preset_options.rb +69 -0
- data/lib/archunit/layers/fluentapi/preset_rule.rb +45 -0
- data/lib/archunit/metrics/extraction/extract_distance_info.rb +2 -3
- data/lib/archunit/metrics/extraction/extract_project_info.rb +14 -10
- data/lib/archunit/metrics/extraction/metric_info.rb +2 -4
- data/lib/archunit/metrics/extraction/source_metrics_visitor.rb +2 -4
- data/lib/archunit/metrics/fluentapi/custom_metric_builder.rb +2 -0
- data/lib/archunit/metrics/fluentapi/custom_metric_condition.rb +4 -1
- data/lib/archunit/metrics/fluentapi/logged_metric.rb +23 -0
- data/lib/archunit/metrics/fluentapi/metric_predicate_condition.rb +4 -1
- data/lib/archunit/metrics/fluentapi/metric_report_builder.rb +6 -3
- data/lib/archunit/metrics/fluentapi/metric_selection.rb +18 -2
- data/lib/archunit/metrics/fluentapi/metric_threshold_condition.rb +2 -1
- data/lib/archunit/metrics/fluentapi/metrics.rb +5 -0
- data/lib/archunit/metrics/fluentapi/metrics_builder.rb +18 -3
- data/lib/archunit/metrics/reporting/metrics_export_options.rb +6 -2
- data/lib/archunit/slices/fluentapi/diagram_slice_condition.rb +1 -0
- data/lib/archunit/slices/fluentapi/forbidden_slice_dependency_condition.rb +1 -0
- data/lib/archunit/slices/fluentapi/negative_slice_condition_builder.rb +2 -0
- data/lib/archunit/slices/fluentapi/positive_slice_condition_builder.rb +8 -0
- data/lib/archunit/slices/fluentapi/slice_scope_builder.rb +12 -0
- data/lib/archunit/slices/fluentapi/slices.rb +5 -0
- data/lib/archunit/testing/assert_passes.rb +4 -0
- data/lib/archunit/testing/result_factory.rb +16 -4
- data/lib/archunit/testing/rspec_adapter.rb +1 -2
- data/lib/archunit/testing.rb +7 -3
- data/lib/archunit/version.rb +1 -1
- data/lib/archunit.rb +11 -0
- metadata +67 -9
data/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# Contributing to ArchUnitRuby
|
|
2
|
+
|
|
3
|
+
Thank you for helping improve the Ruby member of the ArchUnitEverything family. Small, focused
|
|
4
|
+
changes with tests are easiest to review.
|
|
5
|
+
|
|
6
|
+
## Before opening a change
|
|
7
|
+
|
|
8
|
+
- Search the [existing issues](https://github.com/dragonsec-ai/ArchUnitRuby/issues).
|
|
9
|
+
- Use an issue for behavior changes or larger additions so the Ruby API can stay aligned with the
|
|
10
|
+
sibling implementations.
|
|
11
|
+
- Read [AGENTS.md](AGENTS.md) for architecture, naming, and fluent-API conventions.
|
|
12
|
+
- Never include credentials, private project source, or customer data in an issue or fixture.
|
|
13
|
+
|
|
14
|
+
## Development setup
|
|
15
|
+
|
|
16
|
+
ArchUnitRuby requires Ruby 3.3 or newer.
|
|
17
|
+
|
|
18
|
+
~~~bash
|
|
19
|
+
git clone https://github.com/dragonsec-ai/ArchUnitRuby.git
|
|
20
|
+
cd ArchUnitRuby
|
|
21
|
+
bundle install
|
|
22
|
+
bundle exec rake
|
|
23
|
+
~~~
|
|
24
|
+
|
|
25
|
+
`bundle exec rake` validates development release metadata, then runs the randomized RSpec suite and
|
|
26
|
+
RuboCop. Before submitting documentation or
|
|
27
|
+
public API changes, also run:
|
|
28
|
+
|
|
29
|
+
~~~bash
|
|
30
|
+
COVERAGE=true bundle exec rspec
|
|
31
|
+
bundle exec rake docs
|
|
32
|
+
gem build archunit.gemspec --strict
|
|
33
|
+
~~~
|
|
34
|
+
|
|
35
|
+
The coverage suite enforces at least 98% line and 90% branch coverage on every `lib/**/*.rb` runtime
|
|
36
|
+
file, including unloaded files. Specs, benchmarks, and development scripts do not contribute to
|
|
37
|
+
the enforced denominator. A subprocess regression test verifies the actual filtered report and
|
|
38
|
+
thresholds without merging its partial probe execution into the full suite. Native symlink tests
|
|
39
|
+
may be skipped on Windows accounts without link privileges; Linux CI exercises those scenarios.
|
|
40
|
+
The documentation task builds
|
|
41
|
+
the complete site, checks the public API guide, rejects unrendered Markdown, and validates internal
|
|
42
|
+
links.
|
|
43
|
+
|
|
44
|
+
Run `bundle exec rake security` separately to refresh advisories and scan the locked development
|
|
45
|
+
and runtime dependencies. See [SECURITY.md](SECURITY.md) for report locations and offline usage.
|
|
46
|
+
The normal test suite uses a synthetic local advisory and never fetches vulnerability data.
|
|
47
|
+
|
|
48
|
+
For a stable release, follow the [pre-release checklist](.github/PRE_RELEASE_CHECKLIST.md) and
|
|
49
|
+
[publishing guide](.github/RELEASING.md). Development allows an unreleased changelog heading and
|
|
50
|
+
installation instructions for the published gem. The separate `--release` metadata check requires
|
|
51
|
+
a valid dated heading and an installation example targeting the version being published.
|
|
52
|
+
|
|
53
|
+
## Design expectations
|
|
54
|
+
|
|
55
|
+
- Write the fluent sentence first and read it aloud.
|
|
56
|
+
- Prefer idiomatic Ruby when a sibling convention conflicts with the language.
|
|
57
|
+
- Keep builders immutable and lazy; only terminals perform analysis.
|
|
58
|
+
- Return structured violations for architecture disagreements—do not raise until the assertion
|
|
59
|
+
boundary.
|
|
60
|
+
- Add a focused unit test and an end-to-end fluent API test for behavior changes.
|
|
61
|
+
- Keep `# frozen_string_literal: true` in Ruby files and leave RuboCop clean.
|
|
62
|
+
- Keep `README.md` as a concise starting point; put full workflows in `GUIDE.md` and exact
|
|
63
|
+
semantics in `API.md`. Label unreleased features and update `CHANGELOG.md` for behavior changes.
|
|
64
|
+
- Mark runnable README snippets with `example:` comments and extend the documentation-example
|
|
65
|
+
acceptance checks when adding or changing them.
|
|
66
|
+
|
|
67
|
+
## Pull requests
|
|
68
|
+
|
|
69
|
+
A useful pull request explains the user-facing problem, the chosen behavior, any deliberate
|
|
70
|
+
cross-language difference, and how it was tested. Please keep unrelated formatting or refactors out
|
|
71
|
+
of the same change.
|
|
72
|
+
|
|
73
|
+
By participating, you agree to follow the [Code of Conduct](CODE_OF_CONDUCT.md). Security reports
|
|
74
|
+
must follow [SECURITY.md](SECURITY.md), not a public issue.
|
|
75
|
+
|