Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Open
jahnvi480 wants to merge 4 commits into main
base: main
Choose a base branch
Loading
from jahnvi/linting_prehook

Conversation

@jahnvi480
Copy link
Contributor

@jahnvi480 jahnvi480 commented Oct 28, 2025
edited by azure-boards bot
Loading

Work Item / Issue Reference

AB#33454


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:

  • Added .github/workflows/code-quality-check.yml to run linting checks automatically on pull requests for Python and C++ files, including status reporting and PR comments.

Linting Configuration:

  • Created .pre-commit-config.yml to enable pre-commit hooks for pylint and cpplint, ensuring code is linted before commits are made.
  • Added pyproject.toml configuration for pylint, specifying disabled checks, minimum score threshold, and maximum line length.
  • Added cpplint.cfg to configure C++ linting rules, such as excluding build files, setting line length, and disabling specific readability checks.

Copilot AI review requested due to automatic review settings October 28, 2025 07:27
@github-actions github-actions bot added the pr-size: medium Moderate update size label Oct 28, 2025
Copy link
Contributor

Copilot AI left a 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.

Copy link

github-actions bot commented Oct 28, 2025
edited
Loading

📊 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

⚙️ Build Summary 📋 Coverage Details

Copy link
Contributor

@sumitmsft sumitmsft left a 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Copilot code review Copilot Copilot left review comments

@bewithgaurav bewithgaurav bewithgaurav approved these changes

@sumitmsft sumitmsft sumitmsft approved these changes

Assignees

No one assigned

Labels

pr-size: medium Moderate update size

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /