Skip to content

[Feature Request]: sheriff verify should provide an option to export the violations #194

@michaelbe812

Description

@michaelbe812

Is your feature request related to a problem? Please describe.
I would like to use sheriff to create an architecture report in CI which can be used for incremental adoption of rules and refactoring of a big project to increase project health over time. A big bang refactoring is not possible.

Having the result of sheriff verify will enable to create a roadmap for the refactoring and also track progress.

Describe the solution you'd like
When executing sheriff verify I want to have the information about encapsulation violations and dependencyRuleViolations.

Describe alternatives you've considered
I see there mainly two alternatives:

Option 1
verify will return an object with the wished result.

Option 2
We enhance the CLI with an export option and write the result to e.g. a json-file in the project root, e.g. ./.sheriff/verify-result.json

Option 1 however will not suit the overall architecture how the CLI is designed imho, so I would not really consider this an option.

Option 2 sounds more feasible.

A few questions however need to be answered before implementing:

  • where to specify the outputPath - sheriff.config.ts maybe?
  • How to handle multi-project workspaces?

Especially for multi-project workspaces I would expect a structure like this:

 ./.sheriff
   /project-a
     verify-result.json
   /project-b
     verify-result.json

Additional context

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