documentation-developer icon indicating copy to clipboard operation
documentation-developer copied to clipboard

[CI] Added code samples testing with Deptrac

Open mnocon opened this issue 11 months ago • 2 comments

Target: 5.0 only, for new code only.

Deptrac is a code testing tool for architecture.

I've added a very simple ruleset - code samples should not use classes outside of the Ibexa\Contracts namespace.

Together with @konradoboza we've also added a few additional exceptions - like SiteAccess configuration classes etc.

This tool should act as a:

  1. sanity check when adding code samples (as it's easy to miss the non-Contracts usage that can be replaced with their Contracts counterpart)
  2. point for discussion with developers (is there a Contracts-compliant way of writing the code sample)

But we will never get rid of all the errors, as they would require architecture changes on the DXP side - so we will have to keep expanding the baseline with new code samples.

Generated baseline: https://github.com/ibexa/documentation-developer/blob/add-deptrac/deptrac.baseline.yaml

mnocon avatar Nov 30 '24 09:11 mnocon