-
Notifications
You must be signed in to change notification settings - Fork 27
STYLE: Adding precommit hook and workflow for checking code quality #302
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request adds automated code quality enforcement by introducing pre-commit hooks and GitHub Actions workflows to check Python and C++ code against linting standards.
Key changes:
- GitHub Actions workflow for automatic linting checks on pull requests with configurable thresholds
- Pre-commit hooks for local linting enforcement before commits
- Configuration files defining linting rules, disabled checks, and error thresholds for both Python (pylint) and C++ (cpplint)
Reviewed Changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
.github/workflows/code-quality-check.yml |
Implements CI workflow to run pylint and cpplint on PRs, report status, and post results as comments |
.pre-commit-config.yml |
Configures pre-commit hooks for pylint and cpplint with specified arguments and file exclusions |
pyproject.toml |
Defines pylint configuration including disabled checks, minimum score threshold of 8.5, and max line length |
cpplint.cfg |
Sets C++ linting rules including line length limit and filtered checks |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
📊 Code Coverage Report
🔥 Diff Coverage
100%
🎯 Overall Coverage
77%
📈 Total Lines Covered: 4623 out of 5965
📁 Project: mssql-python
Diff Coverage
Diff: main...HEAD, staged and unstaged changes
No lines with coverage information in this diff.
📋 Files Needing Attention
📉 Files with overall lowest coverage (click to expand)
mssql_python.pybind.ddbc_bindings.cpp: 70.7% mssql_python.row.py: 77.9% mssql_python.ddbc_bindings.py: 79.6% mssql_python.pybind.connection.connection.cpp: 81.2% mssql_python.connection.py: 82.9% mssql_python.cursor.py: 83.6% mssql_python.pybind.connection.connection_pool.cpp: 84.8% mssql_python.auth.py: 87.1% mssql_python.pooling.py: 87.7% mssql_python.exceptions.py: 92.1%
🔗 Quick Links
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
only minor change required. rest all looks good
Uh oh!
There was an error while loading. Please reload this page.
Work Item / Issue Reference
Summary
This pull request introduces automated code quality checks for both Python and C++ files, ensuring consistent linting standards across the project. It adds configuration files and workflow automation to enforce linting thresholds, error limits, and style guidelines. The most important changes are grouped below by theme.
Continuous Integration and Workflow Automation:
.github/workflows/code-quality-check.ymlto run linting checks automatically on pull requests for Python and C++ files, including status reporting and PR comments.Linting Configuration:
.pre-commit-config.ymlto enable pre-commit hooks forpylintandcpplint, ensuring code is linted before commits are made.pyproject.tomlconfiguration forpylint, specifying disabled checks, minimum score threshold, and maximum line length.cpplint.cfgto configure C++ linting rules, such as excluding build files, setting line length, and disabling specific readability checks.