Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/hooks/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/sh
# NQL pre-commit hook: run the same checks as CI before allowing a commit.
# To install: cp .github/hooks/pre-commit .git/hooks/pre-commit && chmod +x .git/hooks/pre-commit

set -e

echo "[pre-commit] Running cargo fmt --all -- --check"
cargo fmt --all -- --check

echo "[pre-commit] Running cargo clippy --all-targets -- -D warnings"
cargo clippy --all-targets -- -D warnings

echo "[pre-commit] Running cargo test --all"
cargo test --all

echo "[pre-commit] OK"
26 changes: 26 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
repos:
- repo: local
hooks:
- id: cargo-fmt
name: cargo fmt
entry: cargo fmt --all -- --check
language: system
types: [rust]
pass_filenames: false
stages: [pre-commit]

- id: cargo-clippy
name: cargo clippy
entry: cargo clippy --all-targets -- -D warnings
language: system
types: [rust]
pass_filenames: false
stages: [pre-commit]

- id: cargo-test
name: cargo test
entry: cargo test --all
language: system
types: [rust]
pass_filenames: false
stages: [pre-commit]
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "nql"
version = "0.1.6"
version = "0.1.7"
edition = "2021"
authors = ["NPC Worldwide <info@npcworldwi.de>"]
description = "NQL — SQL compiler with AI function calls targeting multiple databases"
Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use nql::compiler::Target;
use nql::runner::Runner;

#[derive(Parser)]
#[command(name = "nql", about = "NQL — SQL compiler with AI function calls")]
#[command(name = "nql", about = "NQL — SQL compiler with AI function calls", version = env!("CARGO_PKG_VERSION"))]
struct Cli {
#[command(subcommand)]
command: Commands,
Expand Down
5 changes: 4 additions & 1 deletion src/runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,10 @@ impl Runner {
let mut bq_args = query_args.clone();
bq_args.push(format!("--job_id={}", job_id));

eprintln!("[nql] Executing model on BigQuery: {} (job_id={})", name, job_id);
eprintln!(
"[nql] Executing model on BigQuery: {} (job_id={})",
name, job_id
);
let mut child = std::process::Command::new("bq")
.args(&bq_args)
.stdin(std::process::Stdio::piped())
Expand Down
Loading