Skip to content

Unable to exclude autogenerated code which violates encapsulation rules #217

@alvaro450

Description

@alvaro450

Issue

When using @hey-api/openapi-ts the generated code does not follow sheriff encapsulation rules. This causes sheriff to report errors when having imports from the generated code

Ask

  • Can we have a way to exclude modules/paths in the sheriff.config.ts?
{   
   ignorePaths: ['src/client/**`]
}

Stackblitz Reproduction

https://stackblitz.com/edit/sheriff-openapit-ts?file=sheriff.config.ts

Report output

> sheriff verify


Verification Report

Issues found:
  Total Invalid Files: 7
  Total Encapsulation Violations: 12
  Total Dependency Rule Violations: 0
----------------------------------

|-- src/app/app.component.ts
|   |-- Encapsulation Violations
|   |   |-- ../client/sdk.gen
|-- src/client/sdk.gen.ts
|   |-- Encapsulation Violations
|   |   |-- ./client.gen
|-- src/client/client/index.ts
|   |-- Encapsulation Violations
|   |   |-- ../core/auth
|   |   |-- ../core/bodySerializer
|   |   |-- ../core/params
|-- src/client/client/types.ts
|   |-- Encapsulation Violations
|   |   |-- ../core/auth
|   |   |-- ../core/types
|-- src/client/client/utils.ts
|   |-- Encapsulation Violations
|   |   |-- ../core/auth
|   |   |-- ../core/bodySerializer
|   |   |-- ../core/pathSerializer
|-- src/client/client.gen.ts
|   |-- Encapsulation Violations
|   |   |-- ./types.gen
|-- src/client/index.ts
|   |-- Encapsulation Violations
|   |   |-- ./client.gen

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions