Skip to content
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

Enable pre-commit for formatting and linting #267

Merged
merged 32 commits into from
Feb 21, 2025
Merged

Conversation

cwlacewe
Copy link
Contributor

@cwlacewe cwlacewe commented Feb 20, 2025

Closes #266

The following were performed in this PR:

  • Add pre-commit hooks
  • Applied hooks to repo (Many file changes)
  • Update CI to include auto-application of pre-commit

Manually modified files:

  • .clang-format-ignore
  • .github/CONTRIBUTING.md
  • .github/scripts/auto-formatter.sh (removed)
  • .github/workflows/CI.yml
  • .github/workflows/_CI_coverage.yml
  • .github/workflows/_CI_update.yml
  • .github/workflows/_precommit.yml
  • .pre-commit-config.yaml
  • client/python/vdms/init.py
  • README.md

Remaining files were modified after applying hooks

After this is merged, users can manually setup to apply to all commits:

# Initial setup (first-time)
pip install pre-commit
pre-commit install

# Manually check files
pre-commit run --all-files

But as a safe-guard, it is also included in the CI process. In cases where changes are needed, the CI job will fail. If pre-commit can automatically fix issues, the CI will restart with new changes. If pre-commit cannot fix any issues, user should fix requested issues and CI will start once PR is updated.

@cwlacewe cwlacewe linked an issue Feb 20, 2025 that may be closed by this pull request
Copy link
Contributor

Target CPP Coverage: 64.1421%
Source CPP Coverage: 64.1323%

Target Python Coverage: 98.02%
Source Python Coverage: 97.94%

Copy link
Contributor

Target CPP Coverage: 64.1421%
Source CPP Coverage: 64.1323%

Target Python Coverage: 98.02%
Source Python Coverage: 97.94%

Copy link
Contributor

Target CPP Coverage: 64.1421%
Source CPP Coverage: 64.1421%

Target Python Coverage: 98.02%
Source Python Coverage: 97.94%

Copy link
Contributor

Target CPP Coverage: 64.1421%
Source CPP Coverage: 64.1421%

Target Python Coverage: 98.02%
Source Python Coverage: 97.94%

Copy link
Contributor

Target CPP Coverage: 64.1421%
Source CPP Coverage: 64.1323%

Target Python Coverage: 98.02%
Source Python Coverage: 97.94%

Copy link
Contributor

Target CPP Coverage: 64.1421%
Source CPP Coverage: 64.1421%

Target Python Coverage: 98.02%
Source Python Coverage: 97.94%

@cwlacewe cwlacewe marked this pull request as ready for review February 21, 2025 08:24
Copy link
Contributor

Target CPP Coverage: 64.1421%
Source CPP Coverage: 64.1421%

Target Python Coverage: 98.02%
Source Python Coverage: 97.94%

Copy link
Contributor

@rolandoquesada rolandoquesada left a comment

Choose a reason for hiding this comment

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

The changes look good to me.
I like that this format tool also removes unused variables and imported/included libraries.

@cwlacewe cwlacewe merged commit cf1f51d into develop Feb 21, 2025
2 checks passed
@cwlacewe cwlacewe deleted the add_precommit branch February 21, 2025 19:15
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.

Add pre-commit
2 participants