{"record":{"id":"fdbcb00216aedc28","repo":"nikivdev/code","slug":"quality-gate-blocked-commit","errorCode":null,"errorMessage":"Quality gate blocked commit","messagePattern":"Quality gate blocked commit","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/commit.rs","lineNumber":4232,"sourceCode":"        let mut gate_failures: Vec<String> = quality.gate_failures.clone();\n        if gate_overrides.skip_docs {\n            gate_failures.retain(|failure| !is_doc_gate_failure(failure));\n        }\n        if gate_overrides.skip_tests {\n            gate_failures.retain(|failure| !is_test_gate_failure(failure));\n        }\n\n        if !gate_failures.is_empty() && mode != \"off\" {\n            println!();\n            for failure in &gate_failures {\n                eprintln!(\"  quality: {}\", failure);\n            }\n\n            if mode == \"block\" {\n                eprintln!(\"\\nCommit blocked by quality gates.\");\n                eprintln!(\"Fix the issues above, or override with: f commit --skip-quality\");\n                restore_staged_snapshot_in(&repo_root, &staged_snapshot)?;\n                bail!(\"Quality gate blocked commit\");\n            } else {\n                eprintln!(\"\\nQuality warnings above. Proceeding with commit.\");\n            }\n        }\n\n        // Auto-generate/update feature docs if enabled\n        let auto_docs = quality_config.auto_generate_docs.unwrap_or(true);\n        if auto_docs && mode != \"off\" && !gate_overrides.skip_docs {\n            let commit_sha_preview = git_capture_in(&repo_root, &[\"rev-parse\", \"--short\", \"HEAD\"])\n                .unwrap_or_else(|_| \"unknown\".to_string())\n                .trim()\n                .to_string();\n\n            match features::apply_quality_results(&repo_root, quality, &commit_sha_preview) {\n                Ok(actions) => {\n                    for action in &actions {\n                        println!(\"  feature docs: {}\", action);\n                    }","sourceCodeStart":4214,"sourceCodeEnd":4250,"githubUrl":"https://github.com/nikivdev/code/blob/a747e741ae92c09071d0ae946ab48488adcff1ce/src/commit.rs#L4214-L4250","documentation":"The commit command runs quality gates before committing; when gate mode is \"block\" and issues were found, it restores the staged snapshot and aborts the commit with this error. It exists to stop low-quality changes from entering history while pointing the user at the reported issues and the override flag.","triggerScenarios":"Running `f commit` with quality gates configured in block mode when the staged changes violate one or more gates (lint/format/complexity/test issues printed just above the error).","commonSituations":"Failing linters or formatters on staged code; quality score below threshold; new gate rules added by a config/version update that existing code violates.","solutions":["Fix the issues listed above the error in the output.","If the issues are acceptable, re-run with `f commit --skip-quality` to override the gate.","Switch gate mode from \"block\" to \"warn\" in quality config if warnings should not block.","Commit in a clean state after re-running formatters/linters locally."],"exampleFix":"// before\nf commit\n// error: Quality gate blocked commit\n// after (intentional override)\nf commit --skip-quality","handlingStrategy":"validation","validationCode":"// run the same gates locally before committing\n// e.g. `cargo fmt --check && cargo clippy -- -D warnings && cargo test`","typeGuard":null,"tryCatchPattern":"if let Err(e) = commit_cmd.run() {\n    if e.to_string().contains(\"Quality gate blocked commit\") {\n        eprintln!(\"Fix reported issues, or re-run with: f commit --skip-quality\");\n    }\n}","preventionTips":["Run linters/formatters in a pre-commit hook so gates never surprise you.","Keep quality gate config in the repo and update code when rules change.","Use --skip-quality only deliberately, never as a habit."],"tags":["commit","quality-gate","lint","cli"],"backgroundTag":"quality-gate-blocked","analyzedSha":"a747e741ae92c09071d0ae946ab48488adcff1ce","analyzedAt":"2026-09-01T22:43:55.719Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}