Skip to content

Conversation

@gvatsal60
Copy link
Contributor

Issue #1138

Changes Made

  • devcontainer.json:

    • Implemented the pre-commit feature and included pre-commit hook installation.
    • Added default settings for the Visual Studio Code workspace.
  • Introduced the .pre-commit-config.yaml file containing hooks. Currently, the hooks are commented out, as enabling them will require significant modifications. It may be beneficial to enable them incrementally.

Some work still remains to enhance robustness and usability.

@gvatsal60 gvatsal60 requested a review from a team as a code owner October 13, 2024 10:38
@gvatsal60 gvatsal60 force-pushed the feature/pre-commit-hook_support_1138 branch from 16be955 to 0425c3a Compare September 18, 2025 13:25
Copilot AI review requested due to automatic review settings December 29, 2025 05:07
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 PR introduces pre-commit hooks support to the repository by adding a .pre-commit-config.yaml configuration file. The configuration includes various linting and validation hooks, though most are currently commented out to allow for incremental adoption.

Key changes:

  • Added .pre-commit-config.yaml with hook configurations for file checks, linting, formatting, and security scanning
  • Most hooks are commented out to minimize initial impact and allow gradual enablement

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@@ -0,0 +1,70 @@
repos:
Copy link

Copilot AI Dec 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The indentation at the start of this file is incorrect. The "repos:" key should have no leading spaces. Currently, it has 2 leading spaces which will cause YAML parsing errors.

Copilot uses AI. Check for mistakes.
repos:
# Syncs pre-commit dependencies with the latest versions.
- repo: https://github.com/mxr/sync-pre-commit-deps
rev: "v0.0.1"
Copy link

Copilot AI Dec 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The version for the sync-pre-commit-deps hook appears to be very old (v0.0.1). This is the initial release and may not be stable or feature-complete. Consider using a more recent stable version to ensure better reliability and functionality.

Suggested change
rev: "v0.0.1"
rev: "v0.0.5"

Copilot uses AI. Check for mistakes.
# - id: check-vcs-permalinks
# - id: check-yaml
# - id: destroyed-symlinks
# - id: detect-private-key
Copy link

Copilot AI Dec 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The commented-out detect-private-key hook should be enabled to prevent accidentally committing sensitive information like private keys to the repository. This is a critical security feature that should be active, especially in a project that will be shared or made public.

Suggested change
# - id: detect-private-key
- id: detect-private-key

Copilot uses AI. Check for mistakes.
Comment on lines +22 to +27
# - id: end-of-file-fixer
# - id: fix-byte-order-marker
# - id: mixed-line-ending
# - id: pretty-format-json
# args: [--autofix, --no-sort-keys]
# - id: trailing-whitespace
Copy link

Copilot AI Dec 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The end-of-file-fixer and trailing-whitespace hooks should be enabled to maintain consistent formatting across the codebase. These are low-impact hooks that automatically fix common formatting issues and help maintain code quality standards without requiring significant modifications.

Suggested change
# - id: end-of-file-fixer
# - id: fix-byte-order-marker
# - id: mixed-line-ending
# - id: pretty-format-json
# args: [--autofix, --no-sort-keys]
# - id: trailing-whitespace
- id: end-of-file-fixer
# - id: fix-byte-order-marker
# - id: mixed-line-ending
# - id: pretty-format-json
# args: [--autofix, --no-sort-keys]
- id: trailing-whitespace

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant