Comments (3)
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.
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.
@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)
- [Bug Report] Exception when loading signatures
- [Bug Report] Default require behaviour
- [Bug Report] Dependency violation not detected when using public folders or in non-public folder with dependencies specified HOT 1
- [Feature Request] Allow configuration of `package_todo.yml` violation destinations HOT 4
- [Feature Request] Separate run-time and test-time dependencies HOT 11
- [Bug Report] HOT 2
- [Bug Report] bundler: failed to load command: packwerk HOT 1
- [Bug Report] Getting "There were stale violations found, please run `packwerk update-todo`" even there is no stale violations HOT 3
- [Bug Report] has_many relationship for serializers create false positive violations HOT 1
- [Bug] resolve module namespaces HOT 4
- [Feature Request] Haml support HOT 3
- Error: We could not extract autoload paths from your Rails app HOT 1
- [Feature Request] YARD support as method interface HOT 5
- [Request For Comments] Use Prism as the default parser? HOT 2
- [Bug Report] location column for violations through association inspector is wrongly displayed in packwerk-vscode HOT 1
- [Bug Report] Syntax error: Invalid yield in a brand new Rails application HOT 5
- [Bug Report] Packwerk::NodeHelpers::TypeError when using module_parent in a class definition
- [Issue Report] Lack of information about packages that are located outside the/app folder HOT 1
- [Bug Report] Dependency violation not flagged when Zeitwerk collapsing is used HOT 13
- [Bug Report] Get Segmentation fault when run packwerk check
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from packwerk.