Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: restructures the via* sub-restrictions to also accept & validate against dependency types (BREAKING for API users) #894

Merged
merged 9 commits into from Dec 22, 2023

Conversation

sverweij
Copy link
Owner

@sverweij sverweij commented Dec 20, 2023

Description

  • restructures the via* sub restrictions to also accept & validate against dependency types
  • deprecates the viaNot and viaSomeNot restrictions in favor of viaOnly.pathNot and via.pathNot restrictions respectively. You could still have them in dependency-cruiser configs, but internally they're rewritten into viaOnly and via rules when possible.

This is a breaking change for the API only

  • in the input/ rules instead of a string | string[] the via and viaOnly restrictions can now also be an object with path, pathNot, dependencyTypes and dependencyTypesNot attributes
  • in the cruise result via and viaOnly are only available as that object (in stead of string | string[])
  • in the cruise result the viaNot and viaSomeNot have disappeared (rules in the input will have been rewritten as via or viaOnly rules).

Motivation and Context

There's a long outstanding and much upvoted request (#695) to be able to exclude e.g. type-only over a whole cycle instead to just the first dependency of the cycle. This PR enables that.

How Has This Been Tested?

  • green ci
  • additional automated non-regression tests

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • Documentation only change
  • Refactor (non-breaking change which fixes an issue without changing functionality)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change) => for API only

Checklist

  • 📖

    • My change doesn't require a documentation update, or ...
    • it does and I have updated it
  • ⚖️

    • The contribution will be subject to The MIT license, and I'm OK with that.
    • The contribution is my own original work.
    • I am ok with the stuff in CONTRIBUTING.md.

@sverweij sverweij force-pushed the feature/adds-dependency-types-to-vias branch from a928dfb to c99e429 Compare December 22, 2023 09:54
@sverweij sverweij changed the title feat!: restructures the via* sub restrictions to also accept & validate against dependency types (BREAKING for API users) feat!: restructures the via* sub-restrictions to also accept & validate against dependency types (BREAKING for API users) Dec 22, 2023
Copy link

codeclimate bot commented Dec 22, 2023

Code Climate has analyzed commit 67cf761 and detected 0 issues on this pull request.

View more on Code Climate.

@sverweij sverweij merged commit 05d9795 into main Dec 22, 2023
9 checks passed
@sverweij sverweij deleted the feature/adds-dependency-types-to-vias branch December 22, 2023 11:37
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.

None yet

1 participant