add rustfmt target
Some checks failed
Gentoo Utils / build-oci-image (push) Successful in 9s
Gentoo Utils / build (push) Failing after 27s

This commit is contained in:
2025-12-08 21:23:38 +00:00
parent 160b27e6b0
commit 53f2798549
7 changed files with 26 additions and 1 deletions

View File

@@ -5,9 +5,15 @@ project(
default_options: {'rust_std': '2024', 'rust_nightly': 'enabled'},
)
rustfmt = find_program('rustfmt')
rust = import('rust')
fs = import('fs')
sources = []
subdir('src')
mon = dependency('mon-0.1-rs')
get = dependency('get-0.1-rs')
itertools = dependency('itertools-0.14-rs')
@@ -20,6 +26,14 @@ gentoo_utils = static_library(
link_with: [thiserror],
)
custom_target(
'rustfmt',
input: sources,
output: 'rustfmt',
command: [rustfmt, '--edition=2024', '--check', '@INPUT@'],
build_always_stale: true,
)
if get_option('tests').enabled()
rust.test('unittests', gentoo_utils)
subdir('tests')