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 committed Sep 28, 2023
1 parent ac55279 commit 5539cb0
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 1 deletion.
20 changes: 20 additions & 0 deletions ci.mk
Original file line number Diff line number Diff line change
Expand Up @@ -287,5 +287,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))

30 changes: 29 additions & 1 deletion his_checker.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,30 @@
#!/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

METRIC_FAIL = 0

def process_metric(filenames):

"""Process each file."""
print("Checking X metric")
for file in filenames.files:
print(file)

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

process_metric(ARGS)

if METRIC_FAIL:
sys.exit(-1)

0 comments on commit 5539cb0

Please sign in to comment.