File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,10 +16,15 @@ module DangerPackwerk
1616 class PackwerkWrapper
1717 extend T ::Sig
1818
19+ # This code is partially copied from exe/packwerk within the packwerk gem. We're imitating the
20+ # cli here but with our own offense formatter to collect the violating data directly.
21+ #
22+ # We capture and ignore the output of the Cli so that we don't leak it to the build system logs.
23+ # When packwerk produces errors it can make the build system look like it's failing when really
24+ # this is expected behavior.
1925 sig { params ( files : T ::Array [ String ] ) . returns ( T ::Array [ Packwerk ::ReferenceOffense ] ) }
2026 def self . get_offenses_for_files ( files )
2127 formatter = OffensesAggregatorFormatter . new
22- # This is mostly copied from exe/packwerk within the packwerk gem, but we use our own formatters
2328 ENV [ 'RAILS_ENV' ] = 'test'
2429 cli = Packwerk ::Cli . new ( offenses_formatter : formatter , out : StringIO . new )
2530 cli . execute_command ( [ 'check' , *files ] )
You can’t perform that action at this time.
0 commit comments