Skip to content

Commit

Permalink
feat(HIS): add HIS checker to ci makefile
Browse files Browse the repository at this point in the history
Signed-off-by: Afonso Santos <[email protected]>
  • Loading branch information
AfonsoSantos96 authored and danielRep committed Feb 27, 2024
1 parent ffc5a6e commit d92a8d4
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 1 deletion.
21 changes: 21 additions & 0 deletions ci.mk
Original file line number Diff line number Diff line change
Expand Up @@ -360,4 +360,25 @@ endef

#############################################################################

# HIS Checker
# Use this rule to run the HIS add-on checker:
# make his-check <files>
# @param files space separated list of files (with path)
# @example $(call ci, his, file1.c file2.c file3.h)

his_check_script:=$(ci_dir)/his_checker.py

his-check:
@$(his_check_script) $(_his_files)

.PHONY: his-check
non_build_targets+=his-check

define his
_his_files+=$1
endef

#############################################################################

ci=$(eval $(call $1, $2, $3, $4, $5, $6, $7, $8, $9))

24 changes: 23 additions & 1 deletion his_checker.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,24 @@
#!/bin/python3

# wip
# SPDX-License-Identifier: Apache-2.0
# Copyright (c) Bao Project and Contributors. All rights reserved

"""
Generating HIS metrics check
"""

import sys
import argparse

if __name__ == "__main__":
METRICS_LIST = []
CHECK_FAIL = 0
PARSER = argparse.ArgumentParser()
PARSER.add_argument("files", nargs="+", help="The files to process")
ARGS = PARSER.parse_args()

for metric in METRICS_LIST:
CHECK_FAIL += metric(ARGS)

if CHECK_FAIL:
sys.exit(-1)

0 comments on commit d92a8d4

Please sign in to comment.