Skip to content

[FEATURE] ShouldNot DependOnSelfΒ #6

@vethman

Description

@vethman

Feature Request

I would like to have the ability to check if a layer does not imports another file in the same layer. For example that you have a car-port.ts that should not be able to import the bike-port.ts

Problem

I have the following:
Image
This is my result:

` 1. File dependency violation:
From pattern: src\api\archunit\ports\car-port.ts:1:1
To pattern: src\api\archunit\ports\car-port.ts:1:1
Rule: This dependency should not exist

   Violating dependencies:
   1. src\api\archunit\ports\car-port.ts:1:1 β†’ src\api\visma-bluevi\steppers\car-port.ts:1:1`

Proposed Solution

How would this feature work? What would the API look like?

const rule = projectFiles()
    .inFolder(`src/api/${api}/steppers`)
    .shouldNot()
    .dependOnSameFiles()

Use Case

See above


## πŸ”„ Alternatives Considered

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

## πŸ“Š Impact Assessment

**What areas would this affect?**

- [ ] Core architecture testing
- [x] File dependencies
- [ ] Metrics calculation
- [ ] Slice testing
- [ ] Error messages
- [ ] Test framework integration
- [ ] Performance
- [x] Documentation

## 🎨 Implementation Ideas

**Do you have ideas on how this could be implemented?**
Any thoughts on the implementation approach, if you have them.

## πŸ“‹ Additional Context

Add any other context or screenshots about the feature request here.

## βœ‹ Checklist

- [ ] I have searched existing issues to make sure this isn't a duplicate
- [ ] I have provided a clear use case
- [ ] I have considered the API design
- [ ] I have thought about backward compatibility

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions