qossmic / deptrac

Keep your architecture clean.
https://qossmic.github.io/deptrac
MIT License
2.6k stars 135 forks source link

Referencing non-existing layer in depfile emits no error, but breaks the referencing layer #1381

Closed janedbal closed 6 months ago

janedbal commented 6 months ago

Assume following depfile:

deptrac:
  paths:
    - ./src
  layers:
    - name: Domain
      collectors:
        - type: directory
          value: ./src/Domain

    - name: Other
      collectors:
        - type: bool
          must:
            - type: directory
              value: ./src
          must_not:
            - type: layer
              layer: Domain_typo # typo here, should be Domain

Running deptrac with such config causes no failure or warning about reference to non-existing layer. But this clearly break things, because the Other layer is now empty. This can be verified by deptrac debug:layer Other. When the typo is fixed, Other is filled with tokens normally.

patrickkusebauch commented 6 months ago

Hmm, this is weird, we have a test for this exact situation in both the main branch and the latest release:

patrickkusebauch commented 6 months ago

Never mind, found it, I will provide a fix shortly.