chore: add code quality automation with pre-commit hooks, coverage, and Dependabot#65
Open
knqiufan wants to merge 4 commits intooceanbase:mainfrom
Open
chore: add code quality automation with pre-commit hooks, coverage, and Dependabot#65knqiufan wants to merge 4 commits intooceanbase:mainfrom
knqiufan wants to merge 4 commits intooceanbase:mainfrom
Conversation
…nd improve SQL syntax in checkpointer.py for clarity and consistency
…g in OceanBase integration - Introduced a comprehensive troubleshooting section in README.md covering common connection issues, vector dimension mismatches, index creation failures, and AI function support. - Enhanced error handling in the OceanBase integration by replacing generic ValueErrors with specific OceanBase exceptions for better clarity and debugging. - Updated exception handling in the OceanBaseCheckpointSaver and OceanbaseVectorStore classes to provide more informative error messages.
…guration - Added a .pre-commit-config.yaml file to integrate pre-commit hooks for code quality checks, including trailing whitespace removal, YAML validation, and Ruff for linting. - Updated the Makefile to include targets for installing and running pre-commit hooks, as well as a new target for testing coverage. - Expanded .gitignore to exclude coverage-related files and directories. - Updated pyproject.toml to include pre-commit and pytest-cov as development dependencies. - Added coverage package to poetry.lock for test coverage measurement.
Contributor
|
@knqiufan Thank you for your contribution. Can you resolve the PR conflict |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds code quality automation tooling to improve development workflow and maintain code standards, including pre-commit hooks, type checking support, test coverage reporting, and automated dependency updates.
close #44
Dependencies
Changes
1. Pre-commit Hooks (
.pre-commit-config.yaml)pre-commit-hooksv4.5.0: trailing-whitespace, end-of-file-fixer, check-yaml, check-added-large-files, check-merge-conflict, debug-statementsruff-pre-commitv0.5.0: linting and formattingmirrors-mypyv1.10.0: type checking forlangchain_oceanbase/directorypre-commit = "^3.7"to dev dependencies inpyproject.tomlinstall-hooks,run-hooks2. py.typed Marker (PEP 561)
langchain_oceanbase/py.typedempty marker filepyproject.tomlwithpackagesandincludeconfiguration3. Test Coverage
pytest-cov = "^4.1"to test dependenciestest-coverage(generates HTML coverage report).gitignorefor coverage files (.coverage,htmlcov/)4. Dependabot (
.github/dependabot.yml)Usage
Install pre-commit hooks
poetry install --with dev
poetry run pre-commit install
Run hooks manually
poetry run pre-commit run --all-files
Run tests with coverage
poetry run pytest --cov=langchain_oceanbase --cov-report=html tests/unit_tests/