Skip to content
Merged
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: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# @copyright Copyright (c) contributors to Project Ocre,
# which has been established as Project Ocre a Series of LF Projects, LLC
#
# SPDX-License-Identifier: Apache-2.0

blank_issues_enabled: true
contact_links:
- name: Ocre Community
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/formatting-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,8 @@ jobs:
- name: Run YAML Format Checks
run: sh scripts/yml_linter.sh

- name: Run Banner License Checks
run: sh scripts/check_license_banner.sh
- name: License Banner Checks(.c files)
run: sh scripts/check_license_banner_c.sh

- name: License Banner Checks(conf files)
run: sh scripts/check_license_banner_conf_files.sh
136 changes: 68 additions & 68 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,68 +1,68 @@
# These are some examples of commonly ignored file patterns.
# You should customize this list as applicable to your project.
# Learn more about .gitignore:
# https://www.atlassian.com/git/tutorials/saving-changes/gitignore
# Zephyr build folder
build/
# Zephyr native_sim/POSIX simulated flash
*.bin
# Generated files
*.g
# Node artifact files
node_modules/
dist/
# Compiled Java class files
*.class
# Compiled Python bytecode
*.py[cod]
# Log files
*.log
# Package files
*.jar
# Maven
target/
dist/
# Unit test reports
TEST*.xml
# Generated by Windows
Thumbs.db
# Applications
*.app
*.exe
*.war
# Large media files
*.mp4
*.tiff
*.avi
*.flv
*.mov
*.wmv
# Generated by VS
settings.json
src/common/include/ocre/commit_id.h
**/.DS_Store
# hidden files
.*
!.git
!.gitignore
!/.gitmodules
!/.github
!.devcontainer
!.clang-format
# @copyright Copyright (c) contributors to Project Ocre,
# which has been established as Project Ocre a Series of LF Projects, LLC
#
# SPDX-License-Identifier: Apache-2.0

# Zephyr build folder
build/

# Zephyr native_sim/POSIX simulated flash
*.bin

# Generated files
*.g

# Node artifact files
node_modules/
dist/

# Compiled Java class files
*.class

# Compiled Python bytecode
*.py[cod]

# Log files
*.log

# Package files
*.jar

# Maven
target/
dist/

# Unit test reports
TEST*.xml

# Generated by Windows
Thumbs.db

# Applications
*.app
*.exe
*.war

# Large media files
*.mp4
*.tiff
*.avi
*.flv
*.mov
*.wmv

# Generated by VS
settings.json

src/common/include/ocre/commit_id.h

**/.DS_Store

# hidden files
.*
!.git
!.gitignore
!/.gitmodules
!/.github
!.devcontainer
!.clang-format
5 changes: 5 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# @copyright Copyright (c) contributors to Project Ocre,
# which has been established as Project Ocre a Series of LF Projects, LLC
#
# SPDX-License-Identifier: Apache-2.0

[submodule "wasm-micro-runtime"]
path = wasm-micro-runtime
url = https://github.com/project-ocre/wasm-micro-runtime.git
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ echo "Checking license banners."
ERROR_FOUND=0
for file in $(find . -type f \( -name '*.c' -o -name '*.h' \) \
! -name 'utlist.h' \
! -name 'CMakeCCompilerId.c' \
! -path './tests/Unity/*' \
! -path './build/*' \
! -path './wasm-micro-runtime/*' \
Expand Down
65 changes: 65 additions & 0 deletions scripts/check_license_banner_conf_files.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#!/bin/sh
# @copyright Copyright (c) contributors to Project Ocre,
# which has been established as Project Ocre a Series of LF Projects, LLC
#
# SPDX-License-Identifier: Apache-2.0

# Checks all C/C++ files for license banner

set -e

SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
ROOT_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
SRC_DIR="$ROOT_DIR/src"

check_license_banner() {
local file="$1"
local file_header
local start_line=1

# Check first line and skip if it's a shebang line(only for .sh scripts)
local first_line
first_line=$(head -n 1 "$file")
if [ "${first_line#\#\!/bin}" != "$first_line" ]; then
start_line=2
fi

file_header=$(tail -n +$start_line "$file" | head -n 4)

# Expected license banner
local expected_banner="# @copyright Copyright (c) contributors to Project Ocre,
# which has been established as Project Ocre a Series of LF Projects, LLC
#
# SPDX-License-Identifier: Apache-2.0"

if [ "$file_header" != "$expected_banner" ]; then
echo "ERROR: Missing or incorrect license banner in $file"
return 1
fi

return 0
}

echo "Checking license banners."
ERROR_FOUND=0
for file in $(find . -type f \( -name 'CMakeLists.txt' -o -name '*.yaml' \
-o -name '*.yml' -o -name '*.awk' -o -name '*.conf' -o -name 'Kconfig*' \
-o -name '.gitignore' -o -name '.gitmodules' -o -name '*.sh' -o -name '*.cmake' \) \
! -name 'utlist.h' \
! -path './tests/Unity/*' \
! -path './build/*' \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
! -path './build/*' \

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image I think we don't need to check build folder

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There should be no build folder. What if the build folder is somewhere else?

! -path './wasm-micro-runtime/*' \
! -path './ocre-sdk/*' \
! -path './src/shell/sha256/*' \
! -path './src/runtime/wamr-wasip1/ocre_api/utils/*' \
| sort); do

if ! check_license_banner "$file"; then
ERROR_FOUND=1
fi
done

if [ $ERROR_FOUND -ne 0 ]; then
echo "License check failed."
exit 1
fi
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# @copyright Copyright (c) contributors to Project Ocre,
# which has been established as Project Ocre a Series of LF Projects, LLC
#
# SPDX-License-Identifier: Apache-2.0

# custom,rng-sensor.yaml

title: Custom RNG Sensor
Expand Down
5 changes: 5 additions & 0 deletions src/samples/supervisor/zephyr/boards/overlay-nsos.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# @copyright Copyright (c) contributors to Project Ocre,
# which has been established as Project Ocre a Series of LF Projects, LLC
#
# SPDX-License-Identifier: Apache-2.0

CONFIG_ETH_NATIVE_TAP=n
CONFIG_NET_DRIVERS=y
CONFIG_NET_SOCKETS=y
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# @copyright Copyright (c) contributors to Project Ocre,
# which has been established as Project Ocre a Series of LF Projects, LLC
#
# SPDX-License-Identifier: Apache-2.0

if SHIELD_ENC28J60

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# @copyright Copyright (c) contributors to Project Ocre,
# which has been established as Project Ocre a Series of LF Projects, LLC
#
# SPDX-License-Identifier: Apache-2.0

config SHIELD_ENC28J60
def_bool $(shields_list_contains,enc28j60)

Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# @copyright Copyright (c) contributors to Project Ocre,
# which has been established as Project Ocre a Series of LF Projects, LLC
#
# SPDX-License-Identifier: Apache-2.0

shield:
name: enc28j60
full_name: Microchip ENC28J60 Ethernet Shield
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# @copyright Copyright (c) contributors to Project Ocre,
# which has been established as Project Ocre a Series of LF Projects, LLC
#
# SPDX-License-Identifier: Apache-2.0

if SHIELD_WIZNET_W5500

Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
# @copyright Copyright (c) contributors to Project Ocre,
# which has been established as Project Ocre a Series of LF Projects, LLC
#
# SPDX-License-Identifier: Apache-2.0

config SHIELD_WIZNET_W5500
def_bool $(shields_list_contains,wiznet_w5500)
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# @copyright Copyright (c) contributors to Project Ocre,
# which has been established as Project Ocre a Series of LF Projects, LLC
#
# SPDX-License-Identifier: Apache-2.0

shield:
name: wiznet_w5500
full_name: WIZnet W5500 Ethernet Shield
Expand Down
6 changes: 5 additions & 1 deletion tests_hw/beginTests.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
#!/bin/bash
# @copyright Copyright (c) contributors to Project Ocre,
# which has been established as Project Ocre a Series of LF Projects, LLC
#
# SPDX-License-Identifier: Apache-2.0

TG=$1
LOGFILE="/tmp/$TG.log"
Expand Down Expand Up @@ -116,4 +120,4 @@ else
echo "$NAME test group failed"
fi

exit $TEST_GROUP_RESULT
exit $TEST_GROUP_RESULT
7 changes: 6 additions & 1 deletion tests_hw/groups/flashValidation/clean.sh
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
echo "Cleanup is complete"
# @copyright Copyright (c) contributors to Project Ocre,
# which has been established as Project Ocre a Series of LF Projects, LLC
#
# SPDX-License-Identifier: Apache-2.0

echo "Cleanup is complete"
7 changes: 6 additions & 1 deletion tests_hw/groups/flashValidation/setup.sh
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
echo "Setup is complete"
# @copyright Copyright (c) contributors to Project Ocre,
# which has been established as Project Ocre a Series of LF Projects, LLC
#
# SPDX-License-Identifier: Apache-2.0

echo "Setup is complete"