File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11PATH
22 remote: .
33 specs:
4- parse_packwerk (0.25 .0 )
4+ parse_packwerk (0.26 .0 )
55 bigdecimal
66 sorbet-runtime
77
Original file line number Diff line number Diff line change @@ -94,8 +94,6 @@ def self.write_package_yml!(package)
9494 merged_config = merged_config . to_a . sort_by { |key , _value | T . unsafe ( sorted_keys ) . index ( key ) || 1000 } . to_h
9595
9696 raw_yaml = YAML . dump ( merged_config )
97- # Add indentation for dependencies
98- raw_yaml . gsub! ( /^- / , ' - ' )
9997 stylized_yaml = raw_yaml . gsub ( "---\n " , '' )
10098 file . write ( stylized_yaml )
10199 end
Original file line number Diff line number Diff line change 11Gem ::Specification . new do |spec |
22 spec . name = 'parse_packwerk'
3- spec . version = '0.25 .0'
3+ spec . version = '0.26 .0'
44 spec . authors = [ 'Gusto Engineers' ]
55 spec . email = [ 'dev@gusto.com' ]
66 spec . summary = 'A low-dependency gem for parsing and writing packwerk YML files'
Original file line number Diff line number Diff line change @@ -1008,6 +1008,26 @@ def pack_as_hash(package)
10081008 }
10091009 end
10101010
1011+ it 'does not generate invalid yaml for configs using enforcement_globs_ignore' do
1012+ path = Pathname . new ( 'packs/my_pack/package.yml' )
1013+
1014+ write_file path , <<~CONTENTS
1015+ enforce_dependencies: false
1016+ enforce_privacy: false
1017+ enforcement_globs_ignore:
1018+ - enforcements:
1019+ - privacy
1020+ ignores:
1021+ - "**/*"
1022+ CONTENTS
1023+
1024+ package = ParsePackwerk ::Package . from ( path )
1025+
1026+ ParsePackwerk . write_package_yml! ( package )
1027+
1028+ expect { YAML . load_file ( path ) } . not_to raise_error
1029+ end
1030+
10111031 context 'a simple package' do
10121032 let ( :package ) { build_pack }
10131033
@@ -1073,8 +1093,8 @@ def pack_as_hash(package)
10731093 enforce_privacy: true
10741094 enforce_layers: true
10751095 dependencies:
1076- - my_other_pack1
1077- - my_other_pack2
1096+ - my_other_pack1
1097+ - my_other_pack2
10781098 PACKAGEYML
10791099
10801100 expect ( all_packages . count ) . to eq 1
You can’t perform that action at this time.
0 commit comments