# Maintainer:
pkgname=biome
pkgver=1.9.4
pkgrel=1
pkgdesc="Toolchain of the web"
url="https://biomejs.dev/"
license="MIT"
arch="aarch64 x86_64" # architectures supported by upstream
makedepends="cargo cargo-auditable"
source="https://github.com/biomejs/biome/archive/cli/v$pkgver/biome-$pkgver.tar.gz"
builddir="$srcdir/biome-cli-v$pkgver"

prepare() {
	default_prepare

	cargo fetch --target="$CTARGET" --locked

	git init
	git config --local user.name "example"
	git config --local user.email "example@example.com"
	git add .
	git commit -m "needed for symlink tests"
}

build() {
	BIOME_VERSION="$pkgver" cargo auditable build -p biome_cli --frozen --release
}

check() {
	cargo test -p biome_cli --frozen -- \
		--skip cases::diagnostics::max_diagnostics_are_lifted \
		--skip commands::check::max_diagnostics_default \
		--skip commands::check::maximum_diagnostics \
		--skip commands::check::file_too_large \
		--skip commands::ci::max_diagnostics \
		--skip commands::ci::max_diagnostics_default \
		--skip commands::ci::file_too_large
}

package() {
	install -Dm755 target/release/$pkgname -t "$pkgdir"/usr/bin/
}

sha512sums="
5c0cdcd8e407739ef9ca8ccc14107dcb9e335d705930e3391caa975614fe132ac64690f8f69fa0bd50ae95f0c4d4e36ec53adfd2d950bd9a1cf0215513b840fc  biome-1.9.4.tar.gz
"
