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)
- Error when parsing `Foo::Bar = -> {}` HOT 2
- How do you deal with specs? HOT 13
- [Bug Report] `Errno::ENOENT: No such file or directory @ rb_sysopen - tmp/cache/packwerk/inflections` (issue with cache) HOT 1
- Packwerk doesn't support custom root namespaces for root directories in the load path HOT 5
- Dependency violation not detected when using public folders for privacy boundary HOT 9
- Declare a specific constant as a Dependency HOT 3
- Any way of warning when extraneous dependencies exist in a package.yml file? HOT 1
- NameError errror after running packwerk validate HOT 3
- Make packwerk work with in-repo engines using load_path aliases HOT 13
- [Bug Report] `packwerk validate` fails with uninitialized constant <Class:Packwerk::PackageSet>::Bundler
- [Bug Report] Crash on ERB containing multiple CDATA blocks HOT 7
- [Feature Request] Dependency graph introspection HOT 3
- [Bug Report] Dependency on full Rails is too broad HOT 1
- Mounting an engine raises violations HOT 2
- [Bug Report] Incompatibility with latest `zeitwerk` version (2.6.4) - undefined method `root_dirs` HOT 5
- Transitive Dependencies
- [Packwerk 3.0] Update UPGRADING.md with directions to upgrade to 3.0 HOT 1
- [Packwerk 3.0] Ensure API boundaries are up-to-date HOT 1
- [Bug Report] Syntax error when rendering two partials HOT 1
- [Bug Report] Runtime Error after running packwerk check HOT 1
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.