GithubHelp home page GithubHelp logo

Group offenses together about packwerk HOT 3 OPEN

shopify avatar shopify commented on July 28, 2024 2
Group offenses together

from packwerk.

Comments (3)

exterm avatar exterm commented on July 28, 2024 1

Should probably be implemented as an additional output formatter, so that we can switch between both formats and allow users to keep the old format if they depend on it.

from packwerk.

Epigene avatar Epigene commented on July 28, 2024

This would definitely be useful.
I'm only using packwerk for dependency enforcement, so here's my two cents - implement some packwerk check --concise flag that changes output from:

packs/awards/app/graphql/events/award/options/mutations/reorder.rb:20:14
Dependency violation: ::Order belongs to 'app/services', but 'packs/awards/app/graphql' does not specify a dependency on 'app/services'.
Are we missing an abstraction?
Is the code making the reference, and the referenced constant, in the right packages?

Inference details: this is a reference to ::Order which seems to be defined in app/services/order.rb.
To receive help interpreting or resolving this error message, see: https://github.com/Shopify/packwerk/blob/main/TROUBLESHOOT.md#Troubleshooting-violations


packs/awards/app/graphql/events/award/options/mutations/reorder.rb:21:14
Dependency violation: ::User belongs to 'app/models', but 'packs/awards/app/graphql' does not specify a dependency on 'app/models'.
Are we missing an abstraction?
Is the code making the reference, and the referenced constant, in the right packages?

Inference details: this is a reference to ::User which seems to be defined in app/models/user.rb.
To receive help interpreting or resolving this error message, see: https://github.com/Shopify/packwerk/blob/main/TROUBLESHOOT.md#Troubleshooting-violations


packs/awards/app/graphql/events/award/options_resolver.rb:27:10
Dependency violation: ::Filters::FilteredScope belongs to 'app/services', but 'packs/awards/app/graphql' does not specify a dependency on 'app/services'.
Are we missing an abstraction?
Is the code making the reference, and the referenced constant, in the right packages?

Inference details: this is a reference to ::Filters::FilteredScope which seems to be defined in app/services/filters/filtered_scope.rb.
To receive help interpreting or resolving this error message, see: https://github.com/Shopify/packwerk/blob/main/TROUBLESHOOT.md#Troubleshooting-violations

to:

'packs/awards/app/graphql' unspecified dependencies:
  - 'app/models'
  - 'app/services'  

This way it's straightforward to judge which pack(s) have dependency problems, especially after moving existing code to a new pack or when defining sub-packs.

from packwerk.

alexevanczuk avatar alexevanczuk commented on July 28, 2024

@Epigene Something to consider if you want this new format sooner or you want it to say something very specific to your org is that you can create your own offenses formatter and pass that in. At Gusto, this is what we do to layer in more specific Gusto information like the team that owns the package in question. Let me know if you need any help with this!

Separately, out of curiosity, are you making your models and services separate packs? We have divided up our app by domain, including putting models for a domain in its domain pack, so would be interesting to chat more and share strategies. You're welcome to join the Ruby/Rails Modularity Slack Server if you want to chat more!

from packwerk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.