Skip to content

Commit 0dfedca

Browse files
committed
chore: add precommit to format meson.build files
found at : mesonbuild/meson#13114 (comment)
1 parent 97312ba commit 0dfedca

File tree

11 files changed

+100
-99
lines changed

11 files changed

+100
-99
lines changed

.pre-commit-config.yaml

+8-1
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,11 @@ repos:
3737
language: system
3838
files: ^(docs/.*|pandora/.*)$
3939
pass_filenames: False
40-
stages: [pre-push]
40+
stages: [pre-push]
41+
42+
- id: meson
43+
name: meson
44+
language: python
45+
entry: meson format -e -i
46+
files: ^(.*/)?(meson\.build|meson\.format|meson\.options)$
47+
additional_dependencies: ['meson==1.6.1']

meson.build

+21-39
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,41 @@
11
project(
2-
'pandora',
3-
'cpp',
4-
version: run_command(
5-
'version.sh',
6-
'get-vcs',
7-
check: true,
8-
).stdout().strip(),
9-
default_options: [
10-
'cpp_std=c++17',
11-
],
12-
meson_version: '>=1.1'
2+
'pandora',
3+
'cpp',
4+
version: run_command('version.sh', 'get-vcs', check: true).stdout().strip(),
5+
default_options: ['cpp_std=c++17'],
6+
meson_version: '>=1.1',
137
)
148

15-
meson.add_dist_script( meson.project_source_root() / 'version.sh', 'set-dist', meson.project_version())
16-
9+
meson.add_dist_script(
10+
meson.project_source_root() / 'version.sh',
11+
'set-dist',
12+
meson.project_version(),
13+
)
1714

1815
py = import('python').find_installation(pure: false)
1916

2017
pybind11_dep = dependency('pybind11')
2118
doctest_dep = dependency('doctest', required: get_option('build_cpp_tests'))
22-
python_dep = py.dependency(embed:true, required: get_option('build_cpp_tests'))
23-
19+
python_dep = py.dependency(embed: true, required: get_option('build_cpp_tests'))
2420

2521
install_subdir(
26-
'pandora',
27-
install_dir: py.get_install_dir() / 'pandora',
28-
strip_directory: true,
22+
'pandora',
23+
install_dir: py.get_install_dir() / 'pandora',
24+
strip_directory: true,
2925
)
3026

31-
subdir(
32-
'pandora/cpp'
33-
)
27+
subdir('pandora/cpp')
3428

35-
subdir(
36-
'pandora/validation/cpp'
37-
)
29+
subdir('pandora/validation/cpp')
3830

39-
subdir(
40-
'pandora/aggregation/cpp'
41-
)
31+
subdir('pandora/aggregation/cpp')
4232

43-
subdir(
44-
'pandora/cost_volume_confidence/cpp'
45-
)
33+
subdir('pandora/cost_volume_confidence/cpp')
4634

47-
subdir(
48-
'pandora/refinement/cpp'
49-
)
35+
subdir('pandora/refinement/cpp')
5036

51-
subdir(
52-
'pandora/matching_cost/cpp'
53-
)
37+
subdir('pandora/matching_cost/cpp')
5438

5539
if get_option('build_cpp_tests').enabled()
56-
subdir(
57-
'tests/test_cpp/'
58-
)
40+
subdir('tests/test_cpp/')
5941
endif

meson.options

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ option(
33
type: 'feature',
44
value: 'disabled',
55
description: 'If enabled, configure tests and their dependencies.',
6-
)
6+
)

pandora/aggregation/cpp/meson.build

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11

22
py.extension_module(
3-
'aggregation_cpp',
4-
['src/bindings.cpp', 'src/aggregation.cpp'],
5-
include_directories: ['includes'],
6-
subdir: 'pandora/aggregation/cpp',
7-
install: true,
8-
dependencies : [pybind11_dep],
9-
)
3+
'aggregation_cpp',
4+
['src/bindings.cpp', 'src/aggregation.cpp'],
5+
include_directories: ['includes'],
6+
subdir: 'pandora/aggregation/cpp',
7+
install: true,
8+
dependencies: [pybind11_dep],
9+
)
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11

22
py.extension_module(
3-
'cost_volume_confidence_cpp',
4-
['src/cost_volume_confidence_tools.cpp', 'src/bindings.cpp', 'src/ambiguity.cpp', 'src/interval_bounds.cpp', 'src/risk.cpp'],
5-
include_directories: ['includes'],
6-
subdir: 'pandora/cost_volume_confidence/cpp',
7-
install: true,
8-
dependencies : [pybind11_dep],
9-
)
3+
'cost_volume_confidence_cpp',
4+
[
5+
'src/cost_volume_confidence_tools.cpp',
6+
'src/bindings.cpp',
7+
'src/ambiguity.cpp',
8+
'src/interval_bounds.cpp',
9+
'src/risk.cpp',
10+
],
11+
include_directories: ['includes'],
12+
subdir: 'pandora/cost_volume_confidence/cpp',
13+
install: true,
14+
dependencies: [pybind11_dep],
15+
)

pandora/cpp/meson.build

+13-13
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11

22
py.extension_module(
3-
'img_tools_cpp',
4-
['src/bindings_img_tools.cpp', 'src/img_tools.cpp'],
5-
include_directories: ['includes'],
6-
subdir: 'pandora/cpp',
7-
install: true,
8-
dependencies : [pybind11_dep],
3+
'img_tools_cpp',
4+
['src/bindings_img_tools.cpp', 'src/img_tools.cpp'],
5+
include_directories: ['includes'],
6+
subdir: 'pandora/cpp',
7+
install: true,
8+
dependencies: [pybind11_dep],
99
)
1010

1111
py.extension_module(
12-
'interval_tools_cpp',
13-
['src/bindings_interval_tools.cpp', 'src/interval_tools.cpp'],
14-
include_directories: ['includes'],
15-
subdir: 'pandora/cpp',
16-
install: true,
17-
dependencies : [pybind11_dep],
18-
)
12+
'interval_tools_cpp',
13+
['src/bindings_interval_tools.cpp', 'src/interval_tools.cpp'],
14+
include_directories: ['includes'],
15+
subdir: 'pandora/cpp',
16+
install: true,
17+
dependencies: [pybind11_dep],
18+
)

pandora/matching_cost/cpp/meson.build

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11

22
py.extension_module(
3-
'matching_cost_cpp',
4-
['src/bindings.cpp', 'src/census.cpp'],
5-
include_directories: ['includes'],
6-
subdir: 'pandora/matching_cost/cpp',
7-
install: true,
8-
dependencies : [pybind11_dep],
9-
)
3+
'matching_cost_cpp',
4+
['src/bindings.cpp', 'src/census.cpp'],
5+
include_directories: ['includes'],
6+
subdir: 'pandora/matching_cost/cpp',
7+
install: true,
8+
dependencies: [pybind11_dep],
9+
)

pandora/refinement/cpp/meson.build

+13-7
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11

22
py.extension_module(
3-
'refinement_cpp',
4-
['src/bindings.cpp', 'src/refinement_tools.cpp', 'src/refinement.cpp', 'src/vfit.cpp', 'src/quadratic.cpp'],
5-
include_directories: ['includes'],
6-
subdir: 'pandora/refinement/cpp',
7-
install: true,
8-
dependencies : [pybind11_dep],
9-
)
3+
'refinement_cpp',
4+
[
5+
'src/bindings.cpp',
6+
'src/refinement_tools.cpp',
7+
'src/refinement.cpp',
8+
'src/vfit.cpp',
9+
'src/quadratic.cpp',
10+
],
11+
include_directories: ['includes'],
12+
subdir: 'pandora/refinement/cpp',
13+
install: true,
14+
dependencies: [pybind11_dep],
15+
)

pandora/validation/cpp/meson.build

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11

22
py.extension_module(
3-
'validation_cpp',
4-
['src/bindings.cpp', 'src/interpolated_disparity.cpp'],
5-
include_directories: ['includes'],
6-
subdir: 'pandora/validation/cpp',
7-
install: true,
8-
dependencies : [pybind11_dep],
9-
)
3+
'validation_cpp',
4+
['src/bindings.cpp', 'src/interpolated_disparity.cpp'],
5+
include_directories: ['includes'],
6+
subdir: 'pandora/validation/cpp',
7+
install: true,
8+
dependencies: [pybind11_dep],
9+
)

tests/test_cpp/meson.build

-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
subdir('test_confidence')
2-

tests/test_cpp/test_confidence/meson.build

+10-9
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
test(
2-
'Confidence',
3-
executable(
4-
'test_confidence',
5-
['test_confidence.cpp', '../../../pandora/cost_volume_confidence/cpp/src/cost_volume_confidence_tools.cpp'],
6-
include_directories: ['../../../pandora/cost_volume_confidence/cpp/includes/'],
7-
dependencies: [doctest_dep, pybind11_dep, python_dep],
8-
),
2+
'Confidence',
3+
executable(
4+
'test_confidence',
5+
[
6+
'test_confidence.cpp',
7+
'../../../pandora/cost_volume_confidence/cpp/src/cost_volume_confidence_tools.cpp',
8+
],
9+
include_directories: ['../../../pandora/cost_volume_confidence/cpp/includes/'],
10+
dependencies: [doctest_dep, pybind11_dep, python_dep],
11+
),
912
)
10-
11-

0 commit comments

Comments
 (0)