🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.
TypeScript analyticsautogenevaluationlangchainlarge-language-modelsllama-indexllmllm-evaluationllm-observabilityllmopsmonitoringobservabilityopen-sourceopenaiplaygroundprompt-engineeringprompt-managementself-hostedycombinator
chore: Allow skipping lint in pre-commit hook (#14118)
Ben Bachemad480f404010
diff --git a/.husky/pre-commit b/.husky/pre-commitindex 0576858393..49a544abc5 100755--- a/.husky/pre-commit+++ b/.husky/pre-commit@@ -6,6 +6,15 @@ current_branch=$(git rev-parse --abbrev-ref HEAD)# Define the protected branchprotected_branch="main"+run_lint() {+ if [ -n "${LANGFUSE_PRE_COMMIT_SKIP_LINT-}" ]; then+ echo "Skipping lint because LANGFUSE_PRE_COMMIT_SKIP_LINT is set."+ return 0+ fi++ pnpm run lint+}+# Check if the current branch is the protected branchif [ "$current_branch" = "$protected_branch" ]; thenecho "🚨 You are about to commit to the $protected_branch branch. Are you sure? (y/n)"@@ -13,7 +22,7 @@ if [ "$current_branch" = "$protected_branch" ]; thenif [ "$answer" != "${answer#[Yy]}" ]; then# Commit approved, run checkspnpm run format:check- pnpm run lint+ run_lintelseecho "Commit to $protected_branch branch has been canceled."exit 1 # Commit will be blocked@@ -22,4 +31,4 @@ fi# If not the protected branch, run checkspnpm run format:check-pnpm run lint+run_lintdiff --git a/CONTRIBUTING.md b/CONTRIBUTING.mdindex 8a057929c6..c1ea23ccc2 100644--- a/CONTRIBUTING.md+++ b/CONTRIBUTING.md@@ -211,6 +211,15 @@ When you change the shared MCP setup:pnpm run prepare # Sets up Husky pre-commit hooks for code formatting```+ The pre-commit hook runs formatting and lint checks. To skip only the lint+ check for a commit, set `LANGFUSE_PRE_COMMIT_SKIP_LINT`, for example:++ ```bash+ LANGFUSE_PRE_COMMIT_SKIP_LINT=1 git commit -m "your commit message"+ ```++ CI still runs the required checks for pull requests.+4. Create an env file```bash