# Copyright 2026 ReK2 - Chris F.N. <rek2@hispagatos.org>
# https://rek2.hispagatos.org
# Distributed under the terms of the GNU General Public License v3

EAPI=8

RUST_MIN_VER="1.100"
CRATES=""

inherit cargo git-r3

DESCRIPTION="Linter for Postgres migrations and SQL"
HOMEPAGE="https://github.com/sbdchd/squawk"
EGIT_REPO_URI="https://github.com/sbdchd/squawk.git"

LICENSE="Apache-2.0 MIT"
# Dependent crate licenses
LICENSE+="
	Apache-2.0-with-LLVM-exceptions BSD BSD-2 CC0-1.0 ISC MPL-2.0
	Unicode-3.0 Unlicense ZLIB
"
SLOT="0"
KEYWORDS=""

QA_FLAGS_IGNORED="usr/bin/squawk"

src_unpack() {
	git-r3_src_unpack
	cd "${S}" || die
	cargo_live_src_unpack
}

src_install() {
	cargo_src_install --path crates/squawk
	dodoc README.md LICENSE-APACHE LICENSE-MIT
}