forked from jbcoe/value_types
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* A feature test macro to spec * Add support for pre-commit checks * Fix merge error
- Loading branch information
Showing
11 changed files
with
166 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Integrity Checks | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
jobs: | ||
check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
|
||
- name: Install action-validator with asdf | ||
uses: asdf-vm/actions/install@v2 | ||
with: | ||
tool_versions: | | ||
action-validator 0.5.1 | ||
- name: Lint Actions | ||
run: | | ||
find .github/workflows -type f \( -iname \*.yaml -o -iname \*.yml \) \ | ||
| xargs -I {} action-validator --verbose {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
.idea/ | ||
.venv/ | ||
.vs/ | ||
.vscode/ | ||
_build | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# .pre-commit-config.yaml | ||
# ======================== | ||
# | ||
# pre-commit clean | ||
# pre-commit install | ||
# pre-commit install-hooks | ||
# | ||
# precommit hooks installation | ||
# | ||
# - pre-commit autoupdate | ||
# | ||
# - pre-commit run black | ||
# | ||
# continuous integration | ||
# ====================== | ||
# | ||
# - pre-commit run --all-files | ||
# | ||
# See https://pre-commit.com for more information | ||
# See https://pre-commit.com/hooks.html for more hooks | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.5.0 | ||
hooks: | ||
- id: check-yaml | ||
- id: end-of-file-fixer | ||
- id: forbid-submodules | ||
- id: requirements-txt-fixer | ||
- id: trailing-whitespace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,8 +2,8 @@ | |
@jbcoe | ||
@twon | ||
|
||
# CMake | ||
# CMake | ||
CMakeLists.txt @twon | ||
|
||
# Bazel | ||
# Bazel | ||
*.bazel @jbcoe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# Using pre-commit for git hooks | ||
|
||
This repository uses the Python `pre-commit` library to manage git hook run as | ||
part of the commit process. Use the following steps to install a virtual | ||
environment with pre-commmit set up, and then use precommit to install git hooks | ||
it to your local repository. | ||
|
||
```bash | ||
cd <project root> | ||
python3 -m venv .venv # Create a Python virtual env | ||
source ./.venv/bin/activate # Activate the virtual env for bash by source. | ||
pip install -r requirements.txt # Install latest requirements including pre-commit | ||
pre-commit install # Use pre-commit to install git hooks into the working repository. | ||
``` | ||
|
||
# Building with CMake | ||
|
||
To build the repository with CMake use the following steps | ||
```bash | ||
cd <project root> | ||
mkdir build # Make a build directory | ||
cd build # Switch into the build directory | ||
cmake ../ # Generate build system specified in root with cmake | ||
cmake --build ./ # Build the underlying build system via CMake | ||
``` | ||
|
||
# Including in your own project | ||
|
||
To use the value types code in your own CMake project then you can pull | ||
the project in as a dependency via CMake's FetchContent module as follows: | ||
|
||
``` | ||
FetchContent_Declare( | ||
value_types | ||
GIT_REPOSITORY https://github.com/jbcoe/value_types | ||
) | ||
FetchContent_MakeAvailable(value_types) | ||
add_executable(my_program) | ||
target_link_libraries(my_program | ||
PUBLIC | ||
value_types::value_types | ||
) | ||
``` |
Oops, something went wrong.