meson: Format build files with `meson format`

Additionally, add the formatting command to `scripts/pre-submit` so it's
run by OpenBMC's CI (via `scripts/run-ci`).

Change-Id: Ifb8fc06106b8cfa9155e986528b769a5ca450b4c
Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
diff --git a/meson.build b/meson.build
index d9720ca..40f8207 100644
--- a/meson.build
+++ b/meson.build
@@ -1,20 +1,22 @@
-project('libpldm', 'c',
+project(
+    'libpldm',
+    'c',
     default_options: [
-      'debug=true',
-      'optimization=g',
-      'warning_level=3',
-      'werror=true',
-      'cpp_std=c++23',
-      'c_std=c17',
-      'b_ndebug=if-release',
-      'tests=' + (meson.is_subproject() ? 'disabled' : 'enabled'),
+        'debug=true',
+        'optimization=g',
+        'warning_level=3',
+        'werror=true',
+        'cpp_std=c++23',
+        'c_std=c17',
+        'b_ndebug=if-release',
+        'tests=' + (meson.is_subproject() ? 'disabled' : 'enabled'),
     ],
     version: '0.9.0',
     meson_version: '>=1.1.1',
 )
 
 if get_option('tests').allowed()
-  add_languages('cpp')
+    add_languages('cpp')
 endif
 
 # For memmem() in src/msgbuf.h
@@ -23,49 +25,92 @@
 compiler = meson.get_compiler('c')
 conf = configuration_data()
 if compiler.has_header('poll.h')
-  conf.set('PLDM_HAS_POLL', 1)
+    conf.set('PLDM_HAS_POLL', 1)
 endif
 
 # ABI control
-visible =  '__attribute__((visibility("default")))'
+visible = '__attribute__((visibility("default")))'
 libpldm_deprecated_aliases = []
 if get_option('abi').contains('deprecated')
-  conf.set('LIBPLDM_ABI_DEPRECATED', visible)
-  add_project_arguments('-DLIBPLDM_API_DEPRECATED', language: ['c', 'cpp'])
-  libpldm_deprecated_aliases += [
-    ['get_fru_record_by_option_check', 'get_fru_record_by_option'],
-    ['pldm_bios_table_append_pad_checksum_check', 'pldm_bios_table_append_pad_checksum'],
-    ['pldm_bios_table_attr_entry_enum_decode_def_num_check', 'pldm_bios_table_attr_entry_enum_decode_def_num'],
-    ['pldm_bios_table_attr_entry_enum_decode_pv_hdls_check', 'pldm_bios_table_attr_entry_enum_decode_pv_hdls'],
-    ['pldm_bios_table_attr_entry_enum_decode_pv_num_check', 'pldm_bios_table_attr_entry_enum_decode_pv_num'],
-    ['pldm_bios_table_attr_entry_enum_encode_check', 'pldm_bios_table_attr_entry_enum_encode'],
-    ['pldm_bios_table_attr_entry_integer_encode_check', 'pldm_bios_table_attr_entry_integer_encode'],
-    ['pldm_bios_table_attr_entry_string_decode_def_string_length_check', 'pldm_bios_table_attr_entry_string_decode_def_string_length'],
-    ['pldm_bios_table_attr_entry_string_encode_check', 'pldm_bios_table_attr_entry_string_encode'],
-    ['pldm_bios_table_attr_value_entry_encode_enum_check', 'pldm_bios_table_attr_value_entry_encode_enum'],
-    ['pldm_bios_table_attr_value_entry_encode_integer_check', 'pldm_bios_table_attr_value_entry_encode_integer'],
-    ['pldm_bios_table_attr_value_entry_encode_string_check', 'pldm_bios_table_attr_value_entry_encode_string'],
-    ['pldm_bios_table_string_entry_decode_string_check', 'pldm_bios_table_string_entry_decode_string'],
-    ['pldm_bios_table_string_entry_encode_check', 'pldm_bios_table_string_entry_encode'],
-    ['pldm_entity_association_pdr_add_check', 'pldm_entity_association_pdr_add'],
-    ['pldm_entity_association_pdr_add_from_node_check', 'pldm_entity_association_pdr_add_from_node'],
-    ['pldm_pdr_add_check', 'pldm_pdr_add'],
-    ['pldm_pdr_add_fru_record_set_check', 'pldm_pdr_add_fru_record_set'],
-  ]
+    conf.set('LIBPLDM_ABI_DEPRECATED', visible)
+    add_project_arguments('-DLIBPLDM_API_DEPRECATED', language: ['c', 'cpp'])
+    libpldm_deprecated_aliases += [
+        ['get_fru_record_by_option_check', 'get_fru_record_by_option'],
+        [
+            'pldm_bios_table_append_pad_checksum_check',
+            'pldm_bios_table_append_pad_checksum',
+        ],
+        [
+            'pldm_bios_table_attr_entry_enum_decode_def_num_check',
+            'pldm_bios_table_attr_entry_enum_decode_def_num',
+        ],
+        [
+            'pldm_bios_table_attr_entry_enum_decode_pv_hdls_check',
+            'pldm_bios_table_attr_entry_enum_decode_pv_hdls',
+        ],
+        [
+            'pldm_bios_table_attr_entry_enum_decode_pv_num_check',
+            'pldm_bios_table_attr_entry_enum_decode_pv_num',
+        ],
+        [
+            'pldm_bios_table_attr_entry_enum_encode_check',
+            'pldm_bios_table_attr_entry_enum_encode',
+        ],
+        [
+            'pldm_bios_table_attr_entry_integer_encode_check',
+            'pldm_bios_table_attr_entry_integer_encode',
+        ],
+        [
+            'pldm_bios_table_attr_entry_string_decode_def_string_length_check',
+            'pldm_bios_table_attr_entry_string_decode_def_string_length',
+        ],
+        [
+            'pldm_bios_table_attr_entry_string_encode_check',
+            'pldm_bios_table_attr_entry_string_encode',
+        ],
+        [
+            'pldm_bios_table_attr_value_entry_encode_enum_check',
+            'pldm_bios_table_attr_value_entry_encode_enum',
+        ],
+        [
+            'pldm_bios_table_attr_value_entry_encode_integer_check',
+            'pldm_bios_table_attr_value_entry_encode_integer',
+        ],
+        [
+            'pldm_bios_table_attr_value_entry_encode_string_check',
+            'pldm_bios_table_attr_value_entry_encode_string',
+        ],
+        [
+            'pldm_bios_table_string_entry_decode_string_check',
+            'pldm_bios_table_string_entry_decode_string',
+        ],
+        [
+            'pldm_bios_table_string_entry_encode_check',
+            'pldm_bios_table_string_entry_encode',
+        ],
+        [
+            'pldm_entity_association_pdr_add_check',
+            'pldm_entity_association_pdr_add',
+        ],
+        [
+            'pldm_entity_association_pdr_add_from_node_check',
+            'pldm_entity_association_pdr_add_from_node',
+        ],
+        ['pldm_pdr_add_check', 'pldm_pdr_add'],
+        ['pldm_pdr_add_fru_record_set_check', 'pldm_pdr_add_fru_record_set'],
+    ]
 else
-  conf.set('LIBPLDM_ABI_DEPRECATED', '')
+    conf.set('LIBPLDM_ABI_DEPRECATED', '')
 endif
-conf.set('LIBPLDM_ABI_STABLE', visible) # Always expose the stable symbols
+conf.set('LIBPLDM_ABI_STABLE', visible)  # Always expose the stable symbols
 if get_option('abi').contains('testing')
-  conf.set('LIBPLDM_ABI_TESTING', visible)
-  add_project_arguments('-DLIBPLDM_API_TESTING', language: ['c', 'cpp'])
+    conf.set('LIBPLDM_ABI_TESTING', visible)
+    add_project_arguments('-DLIBPLDM_API_TESTING', language: ['c', 'cpp'])
 else
-  conf.set('LIBPLDM_ABI_TESTING', '')
+    conf.set('LIBPLDM_ABI_TESTING', '')
 endif
 
-config = configure_file(output: 'config.h',
-  configuration: conf
-)
+config = configure_file(output: 'config.h', configuration: conf)
 
 add_project_arguments('-include', '@0@'.format(config), language: 'c')
 
@@ -75,9 +120,11 @@
 subdir('src')
 
 if get_option('tests').allowed()
-  subdir('tests')
+    subdir('tests')
 endif
 
-install_subdir('instance-db',
-               install_mode: 'r--r--r--',
-               install_dir: get_option('datadir') / meson.project_name())
+install_subdir(
+    'instance-db',
+    install_mode: 'r--r--r--',
+    install_dir: get_option('datadir') / meson.project_name(),
+)