@@ -26,13 +26,14 @@ def _sync_file(
2626 file : Path ,
2727 writer_cls : Type [ProjectMetadataWriter ],
2828 merge_codemeta : Optional [bool ] = False ,
29+ pass_validation : Optional [bool ] = False ,
2930):
3031 """Sync metadata to a file using the provided writer."""
3132 logger .verbose (f"Loading '{ file .name } ' ..." )
3233 if writer_cls == CodeMeta :
33- writer = writer_cls (file , merge = merge_codemeta )
34+ writer = writer_cls (file , merge = merge_codemeta , pass_validation = pass_validation )
3435 else :
35- writer = writer_cls (file )
36+ writer = writer_cls (file , pass_validation = pass_validation )
3637 logger .verbose (f"Syncing '{ file .name } ' ..." )
3738 writer .sync (metadata )
3839 writer .save (file )
@@ -49,34 +50,75 @@ def sync(somesy_input: SomesyInput):
4950 # update these only if they exist:
5051
5152 if conf .pyproject_file .is_file () and not conf .no_sync_pyproject :
52- _sync_file (metadata , conf .pyproject_file , Pyproject )
53+ _sync_file (
54+ metadata ,
55+ conf .pyproject_file ,
56+ Pyproject ,
57+ pass_validation = conf .pass_validation ,
58+ )
5359
5460 if conf .package_json_file .is_file () and not conf .no_sync_package_json :
55- _sync_file (metadata , conf .package_json_file , PackageJSON )
61+ _sync_file (
62+ metadata ,
63+ conf .package_json_file ,
64+ PackageJSON ,
65+ pass_validation = conf .pass_validation ,
66+ )
5667
5768 if conf .julia_file .is_file () and not conf .no_sync_julia :
58- _sync_file (metadata , conf .julia_file , Julia )
69+ _sync_file (
70+ metadata ,
71+ conf .julia_file ,
72+ Julia ,
73+ pass_validation = conf .pass_validation ,
74+ )
5975
6076 if conf .fortran_file .is_file () and not conf .no_sync_fortran :
61- _sync_file (metadata , conf .fortran_file , Fortran )
77+ _sync_file (
78+ metadata ,
79+ conf .fortran_file ,
80+ Fortran ,
81+ pass_validation = conf .pass_validation ,
82+ )
6283
6384 if conf .pom_xml_file .is_file () and not conf .no_sync_pom_xml :
64- _sync_file (metadata , conf .pom_xml_file , POM )
85+ _sync_file (
86+ metadata ,
87+ conf .pom_xml_file ,
88+ POM ,
89+ pass_validation = conf .pass_validation ,
90+ )
6591
6692 if conf .mkdocs_file .is_file () and not conf .no_sync_mkdocs :
67- _sync_file (metadata , conf .mkdocs_file , MkDocs )
93+ _sync_file (
94+ metadata ,
95+ conf .mkdocs_file ,
96+ MkDocs ,
97+ pass_validation = conf .pass_validation ,
98+ )
6899
69100 if conf .rust_file .is_file () and not conf .no_sync_rust :
70- _sync_file (metadata , conf .rust_file , Rust )
101+ _sync_file (
102+ metadata ,
103+ conf .rust_file ,
104+ Rust ,
105+ pass_validation = conf .pass_validation ,
106+ )
71107
72108 # create these by default if they are missing:
73109 if not conf .no_sync_cff :
74- _sync_file (metadata , conf .cff_file , CFF )
110+ _sync_file (
111+ metadata ,
112+ conf .cff_file ,
113+ CFF ,
114+ pass_validation = conf .pass_validation ,
115+ )
75116
76117 if not conf .no_sync_codemeta :
77118 _sync_file (
78119 metadata ,
79120 conf .codemeta_file ,
80121 CodeMeta ,
81122 merge_codemeta = conf .merge_codemeta ,
123+ pass_validation = conf .pass_validation ,
82124 )
0 commit comments