https://github.com/joro75/pre-commit-hooks
A pre-commit hook to check if the Microsoft C/C++ project has been successfully built.
https://github.com/joro75/pre-commit-hooks
pre-commit-hook python3
Last synced: 9 months ago
JSON representation
A pre-commit hook to check if the Microsoft C/C++ project has been successfully built.
- Host: GitHub
- URL: https://github.com/joro75/pre-commit-hooks
- Owner: joro75
- License: mit
- Created: 2021-01-07T19:39:56.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2021-11-22T18:37:19.000Z (over 4 years ago)
- Last Synced: 2025-01-23T12:46:09.871Z (over 1 year ago)
- Topics: pre-commit-hook, python3
- Language: Python
- Homepage:
- Size: 83 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[]()
[](https://github.com/joro75/pre-commit-hooks/releases)
[](https://github.com/pre-commit/pre-commit)
[](https://codecov.io/gh/joro75/pre-commit-hooks)
pre-commit-hooks
================
A [pre-commit](https://pre-commit.com/) hook to check if the Microsoft C/C++ project has been successfully built, before the code changes are actually committed.
See also: https://github.com/pre-commit/pre-commit
### Using pre-commit-hooks with pre-commit
Add this to your `.pre-commit-config.yaml`
```yaml
- repo: https://github.com/joro75/pre-commit-hooks
rev: v0.5.1
hooks:
- id: check-successful-c-msbuild
```
### Hooks available
#### `check-successful-c-msbuild`
Check that the Microsoft C/C++ project has been successfully built, before the code changes are actually committed.
* `--buildtype` - specifies the build type (or 'Solution Configuration' as it is called by Microsoft) that should be checked. Can be specified multiple times, and defaults to 'Release' if not specified at all.
For each modified file, it is checked which Microsoft C/C++ project files (\*.vcxproj) are present in the same or one of its parent directories. If the modified file is indeed included in one or more of the Microsoft C/C++ project files, a check is done if the build was successful, and is more recent than the change time of the modified file.