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

Add 'pre-commit' framework #906

Open
wants to merge 1 commit into
base: test/ceedling_0_32_rc
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}

# Install Ruby Testing Tools (Bundler version should match the one in Gemfile.lock)
- name: Install Ruby Testing Tools
run: |
Expand Down Expand Up @@ -152,7 +152,7 @@ jobs:
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}

# Install Ruby Testing Tools
# Bundler version should match the one in Gemfile.lock
- name: Install Ruby Testing Tools
Expand Down Expand Up @@ -284,4 +284,3 @@ jobs:
# prerelease: true
# files: |
# *.gem

50 changes: 50 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# =========================================================================
# Ceedling - Test-Centered Build System for C
# ThrowTheSwitch.org
# Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams
# SPDX-License-Identifier: MIT
# =========================================================================

---
# Continuous Integration Workflow
name: pre-commit

# Triggers the workflow on push or pull request events for master & test branches
on:
push:
branches:
- 'master'
- 'test/**'
pull_request:
branches: [ master ]
workflow_dispatch:


# Needed by softprops/action-gh-release
permissions:
# Allow built gem file push to Github release
contents: write

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"
# based on https://pre-commit.com/#github-actions-example
- name: set PY
run: echo "PY=$(python3.12 -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV
- name: Cache pre-commit
uses: actions/cache@v4
with:
path: ~/.cache/pre-commit
key: pre-commit| ${{ env.PY }} | ${{ hashFiles('.pre-commit-config.yaml') }}
- name: Install pre-commit
# install fixed version for reproducibility
run: python3.12 -m pip install pre-commit==3.7.1
- name: Run pre-commit
run: pre-commit run --all-files
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
branch = master
[submodule "vendor/cmock"]
path = vendor/cmock
url = https://github.com/ThrowTheSwitch/CMock.git
url = https://github.com/ThrowTheSwitch/CMock.git
branch = master
19 changes: 19 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: check-added-large-files
- id: check-case-conflict
- id: check-executables-have-shebangs
- id: check-merge-conflict
- id: check-shebang-scripts-are-executable
- id: check-symlinks
- id: check-yaml
args: [--allow-multiple-documents]
- id: destroyed-symlinks
- id: end-of-file-fixer
- id: fix-byte-order-marker
- id: mixed-line-ending
- id: trailing-whitespace
exclude_types:
- markdown
Empty file modified Rakefile
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion assets/default_gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
/build/

# But reserve the artifacts/ subdirectory for revision control.
# Ceedling's notion of artifacts includes reports or release binaries you *may* want to revision.
# Ceedling's notion of artifacts includes reports or release binaries you *may* want to revision.
!/build/artifacts/
72 changes: 36 additions & 36 deletions assets/project_as_gem.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
:default_tasks:
- test:all

# performance options. If your tools start giving mysterious errors, consider
# performance options. If your tools start giving mysterious errors, consider
# dropping this to 1 to force single-tasking
:test_threads: 8
:compile_threads: 8
Expand All @@ -47,8 +47,8 @@
:artifacts: []

# Plugins are optional Ceedling features which can be enabled. Ceedling supports
# a variety of plugins which may effect the way things are compiled, reported,
# or may provide new command options. Refer to the readme in each plugin for
# a variety of plugins which may effect the way things are compiled, reported,
# or may provide new command options. Refer to the readme in each plugin for
# details on how to use it.
:plugins:
:load_paths: []
Expand All @@ -75,10 +75,10 @@
# Specify which reports you'd like from the log factory
:report_tests_log_factory:
:reports:
- json
- junit
- cppunit
- html
- json
- junit
- cppunit
- html

# override the default extensions for your system and toolchain
:extension:
Expand Down Expand Up @@ -123,8 +123,8 @@
- TEST # Simple list option to add symbol 'TEST' to compilation of all files in all test executables
:release: []

# Enable to inject name of a test as a unique compilation symbol into its respective executable build.
:use_test_definition: FALSE
# Enable to inject name of a test as a unique compilation symbol into its respective executable build.
:use_test_definition: FALSE

# Configure additional command line flags provided to tools used in each build step
# :flags:
Expand Down Expand Up @@ -188,15 +188,15 @@
:callback_include_count: true # Do we want cmock to include the number of calls to this callback, when using callbacks?
:callback_after_arg_check: false # Do we want cmock to enforce an argument check first when using a callback?
#:includes: [] # You can add additional includes here, or specify the location with the options below
#:includes_h_pre_orig_header: []
#:includes_h_pre_orig_header: []
#:includes_h_post_orig_header: []
#:includes_c_pre_header: []
#:includes_c_post_header: []
#:array_size_type: [] # Specify a type or types that should be used for array lengths
#:array_size_name: 'size|len' # Specify a name or names that CMock might automatically recognize as the length of an array
:exclude_setjmp_h: false # Don't use setjmp when running CMock. Note that this might result in late reporting or out-of-order failures.

# Configuration options specific to Unity.
# Configuration options specific to Unity.
:unity:
:defines:
- UNITY_EXCLUDE_FLOAT
Expand Down Expand Up @@ -296,7 +296,7 @@
# :includes:
# - include/**

# :subprojects:
# :subprojects:
# :paths:
# - :name: libprojectA
# :source:
Expand Down Expand Up @@ -338,64 +338,64 @@
# As [:tools] is blank, gcc will be used (so long as it's in your system path)
# See documentation to configure a given toolchain for use
# :tools:
# :test_compiler:
# :test_compiler:
# :executable:
# :arguments: []
# :name:
# :name:
# :optional: FALSE
# :test_linker:
# :test_linker:
# :executable:
# :arguments: []
# :name:
# :name:
# :optional: FALSE
# :test_assembler:
# :test_assembler:
# :executable:
# :arguments: []
# :name:
# :name:
# :optional: FALSE
# :test_fixture:
# :test_fixture:
# :executable:
# :arguments: []
# :name:
# :name:
# :optional: FALSE
# :test_includes_preprocessor:
# :test_includes_preprocessor:
# :executable:
# :arguments: []
# :name:
# :name:
# :optional: FALSE
# :test_file_preprocessor:
# :test_file_preprocessor:
# :executable:
# :arguments: []
# :name:
# :name:
# :optional: FALSE
# :test_file_preprocessor_directives:
# :test_file_preprocessor_directives:
# :executable:
# :arguments: []
# :name:
# :name:
# :optional: FALSE
# :test_dependencies_generator:
# :test_dependencies_generator:
# :executable:
# :arguments: []
# :name:
# :name:
# :optional: FALSE
# :release_compiler:
# :release_compiler:
# :executable:
# :arguments: []
# :name:
# :name:
# :optional: FALSE
# :release_linker:
# :release_linker:
# :executable:
# :arguments: []
# :name:
# :name:
# :optional: FALSE
# :release_assembler:
# :release_assembler:
# :executable:
# :arguments: []
# :name:
# :name:
# :optional: FALSE
# :release_dependencies_generator:
# :release_dependencies_generator:
# :executable:
# :arguments: []
# :name:
# :name:
# :optional: FALSE
...
Loading