Skip to content

Commit 45eb648

Browse files
committed
meson: Coding style
- Use 2 spaces - Use trailing commans when possible - Do not use join_path() when unnecessary
1 parent 880bfbb commit 45eb648

File tree

4 files changed

+62
-58
lines changed

4 files changed

+62
-58
lines changed

.editorconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,7 @@ tab_width = 4
1414
# Markup files
1515
[{*.html,*.xml,*.xml.in*,*.yml}]
1616
tab_width = 2
17+
18+
# meson files
19+
[{meson.*}]
20+
tab_width = 2

examples/meson.build

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
example_sources = files(
2-
'Application.vala'
2+
'Application.vala',
33
)
44

55
executable(
6-
'example',
7-
example_sources,
8-
dependencies: libchcase,
9-
install: false
6+
'example',
7+
example_sources,
8+
dependencies: libchcase,
9+
install: false,
1010
)

lib/meson.build

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,41 @@
11
sources = files(
2-
'PatternType' / 'Case' / 'Camel.vala',
3-
'PatternType' / 'Case' / 'Kebab.vala',
4-
'PatternType' / 'Case' / 'Pascal.vala',
5-
'PatternType' / 'Case' / 'Sentence.vala',
6-
'PatternType' / 'Case' / 'Snake.vala',
7-
'PatternType' / 'Case' / 'SpaceSeparated.vala',
8-
'PatternType' / 'Pattern.vala',
9-
'Case.vala',
10-
'Converter.vala',
2+
'PatternType/Case/Camel.vala',
3+
'PatternType/Case/Kebab.vala',
4+
'PatternType/Case/Pascal.vala',
5+
'PatternType/Case/Sentence.vala',
6+
'PatternType/Case/Snake.vala',
7+
'PatternType/Case/SpaceSeparated.vala',
8+
'PatternType/Pattern.vala',
9+
'Case.vala',
10+
'Converter.vala',
1111
)
1212

1313
chcase_lib = library(
14-
'chcase',
15-
sources,
16-
dependencies: libchcase_deps,
17-
vala_header: 'chcase.h',
18-
install: true,
19-
install_dir: [true, true, true]
14+
'chcase',
15+
sources,
16+
dependencies: libchcase_deps,
17+
vala_header: 'chcase.h',
18+
install: true,
19+
install_dir: [true, true, true],
2020
)
2121

2222
install_data(
23-
'chcase.deps',
24-
install_dir: get_option('datadir') / 'vala' / 'vapi'
23+
'chcase.deps',
24+
install_dir: get_option('datadir') / 'vala' / 'vapi',
2525
)
2626

2727
libchcase = declare_dependency(
28-
dependencies: libchcase_deps,
29-
include_directories: include_directories('.'),
30-
link_with: chcase_lib
28+
dependencies: libchcase_deps,
29+
include_directories: include_directories('.'),
30+
link_with: chcase_lib,
3131
)
3232

3333
chcase_pc = pkgconfig.generate(
34-
chcase_lib,
35-
name: 'chcase',
36-
requires: libchcase_deps,
37-
subdirs: ['chcase'],
38-
description: 'A small library to convert case of a given string',
39-
version: meson.project_version(),
40-
url: 'https://github.com/ryonakano/chcase',
34+
chcase_lib,
35+
name: 'chcase',
36+
requires: libchcase_deps,
37+
subdirs: ['chcase'],
38+
description: 'A small library to convert case of a given string',
39+
version: meson.project_version(),
40+
url: 'https://github.com/ryonakano/chcase',
4141
)

meson.build

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,43 @@
11
project('chcase',
2-
'vala', 'c',
3-
version: '2.3.0',
4-
meson_version: '>=0.56.0'
2+
'vala', 'c',
3+
version: '2.3.0',
4+
meson_version: '>= 0.56.0',
55
)
66

77
pkgconfig = import('pkgconfig')
88

99
add_project_arguments(['-W'], language: 'c')
1010

1111
libchcase_deps = [
12-
dependency('gio-2.0'),
13-
dependency('glib-2.0')
12+
dependency('gio-2.0'),
13+
dependency('glib-2.0'),
1414
]
1515

1616
subdir('lib')
1717

1818
if get_option('demo')
19-
subdir('examples')
19+
subdir('examples')
2020
endif
2121

2222
if get_option('doc')
23-
doc_outdir = 'docs'
24-
valadoc = find_program('valadoc')
25-
26-
custom_target(
27-
'valadoc',
28-
command: [
29-
valadoc,
30-
sources,
31-
'--package-name=' + meson.project_name(),
32-
'--package-version=' + meson.project_version(),
33-
'--verbose',
34-
'--force',
35-
'--use-svg-images',
36-
'-o', meson.project_source_root() / doc_outdir,
37-
],
38-
39-
build_by_default: true,
40-
output: doc_outdir,
41-
depends: chcase_lib
42-
)
23+
doc_outdir = 'docs'
24+
valadoc = find_program('valadoc')
25+
26+
custom_target(
27+
'valadoc',
28+
command: [
29+
valadoc,
30+
sources,
31+
'--package-name=' + meson.project_name(),
32+
'--package-version=' + meson.project_version(),
33+
'--verbose',
34+
'--force',
35+
'--use-svg-images',
36+
'-o', meson.project_source_root() / doc_outdir,
37+
],
38+
39+
build_by_default: true,
40+
output: doc_outdir,
41+
depends: chcase_lib,
42+
)
4343
endif

0 commit comments

Comments
 (0)