{"id":23446,"library":"commit-check","title":"commit-check","description":"A Python library and CLI tool to enforce commit message formatting, branch naming conventions, author/email checks, and other git-related validations. Version 2.6.0 targets Python >=3.9 and is released periodically.","status":"active","version":"2.6.0","language":"python","source_language":"en","source_url":"https://github.com/nickderobertis/commit-check","tags":["commit","git","linter","validation","cli"],"install":[{"cmd":"pip install commit-check","lang":"bash","label":"pip install"},{"cmd":"pipx install commit-check","lang":"bash","label":"pipx install"}],"dependencies":[{"reason":"Required for git operations and repository access","package":"gitpython","optional":false},{"reason":"Required for colorful CLI output and progress display","package":"rich","optional":false},{"reason":"Required for CLI interface","package":"click","optional":false}],"imports":[{"note":"Library package name uses hyphen, but import uses underscore: commit_check","wrong":"from commitcheck import CommitCheck","symbol":"CommitCheck","correct":"from commit_check import CommitCheck"},{"note":"run_checks is in the cli module, not the top-level package","wrong":"from commit_check import run_checks","symbol":"run_checks","correct":"from commit_check.cli import run_checks"},{"note":"Config class is in the config module","wrong":"from commit_check import Config","symbol":"config","correct":"from commit_check.config import Config"}],"quickstart":{"code":"from commit_check import CommitCheck\nchecker = CommitCheck(project_root='.', config={})\nresults = checker.run()\nfor result in results:\n    print(result.passed, result.message)","lang":"python","description":"Basic usage of commit-check programmatically. For CLI: run `commit-check` in terminal."},"warnings":[{"fix":"Change 'from commit_check import Config' to 'from commit_check.config import Config'","message":"In v2.0.0, the Config class was moved from top-level to commit_check.config module. Direct imports from commit_check.Config will fail.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Replace debug=True with log_level='DEBUG'","message":"The 'debug' parameter in CommitCheck constructor is deprecated since v2.5.0 and will be removed in v3.0.0. Use 'log_level' instead.","severity":"deprecated","affected_versions":"2.5.0+"},{"fix":"Use 'python -m commit_check' if CLI command is shadowed.","message":"Installation creates a 'commit-check' command but it may conflict with other tools named 'commit-check' installed via npm or as a shell alias. Use 'python -m commit_check' as fallback.","severity":"gotcha","affected_versions":"all"},{"fix":"Wrap in try/except or check for .git directory before calling.","message":"The library expects to be run inside a git repository. Calling CommitCheck.run() outside a git repo raises GitCommandError.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Ensure the virtual environment is activated. The correct import is 'from commit_check import ...' (underscore, not hyphen).","cause":"Installed the package via 'pip install commit-check' but Python cannot find the module due to wrong import path or virtual environment not activated.","error":"ModuleNotFoundError: No module named 'commit_check'"},{"fix":"Use 'from commit_check.config import Config'.","cause":"Config class moved to 'commit_check.config' in v2.0.0.","error":"ImportError: cannot import name 'Config' from 'commit_check'"},{"fix":"Run the command inside a git repository or set project_root to a path inside a git repo.","cause":"commit-check requires a valid git repository. The current directory is not part of a git repo.","error":"GitCommandError: Cmd('git') failed due to: exit code(128) cmdline: git rev-parse --show-toplevel stderr: 'fatal: not a git repository'"},{"fix":"Use 'log_level' parameter instead. Check your commit-check version: 'pip show commit-check'.","cause":"The 'debug' parameter was removed in v2.6.0 after deprecation, or using an older version that doesn't have it.","error":"TypeError: CommitCheck() got an unexpected keyword argument 'debug'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}