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

Change copyright headers #643

Merged
merged 2 commits into from
Oct 25, 2023
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
2 changes: 2 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[flake8]
max_line_length = 120
17 changes: 17 additions & 0 deletions .github/actions/verify-headers/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: verify-headers
description: Verify that files affected by a PR include expected header

branding:
icon: zap
color: gray-dark

inputs:
files:
description: >
A comma-separated list of all files to check.
default: ''
runs:
using: "composite"
steps:
- run: $GITHUB_ACTION_PATH/verify-headers.py
shell: bash
38 changes: 38 additions & 0 deletions .github/actions/verify-headers/verify-headers.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/usr/bin/python3
# Copyright (c) 2023 Contributors to COVESA
#
# This program and the accompanying materials are made available under the
# terms of the Mozilla Public License 2.0 which is available at
# https://www.mozilla.org/en-US/MPL/2.0/
#
# SPDX-License-Identifier: MPL-2.0

import os


def string_exists(file_path, search_string) -> bool:
with open(file_path, 'r') as file:
content = file.read()
if search_string in content:
return True
return False


if __name__ == '__main__':

files = os.getenv('files')
files = files.split(',')
for file in files:
file = os.path.abspath(file)
if os.path.isfile(file):
ext = os.path.splitext(file)[1]
if ext in [".vspec", ".py"]:
if not string_exists(file, "Contributors to COVESA"):
print(f"No contribution statement found in {file}")
raise Exception("Check the output, some files have not the right contribution statement!")
if not string_exists(file, "SPDX-License-Identifier: MPL-2.0"):
print(f"Incorrect license statement found in {file}")
raise Exception("Check the output, some files have not the right SPDX statement!")

print(f"Check succeeded for {file}")
raise SystemExit(0)
28 changes: 28 additions & 0 deletions .github/workflows/check-header.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: check-header

on:
pull_request

concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true

jobs:
check-headers:
runs-on: ubuntu-latest

steps:

- name: Checkout code
uses: actions/checkout@v3
with:
# required to grab the history of the PR
fetch-depth: 0

- name: Get changed files
run: |
echo "files=$(git diff --name-only ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }} | tr '\n' ',')" >> $GITHUB_ENV

- uses: ./.github/actions/verify-headers
with:
files: "${{ env.files }}"
21 changes: 21 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,27 @@ By supplying this sign-off line, you indicate your acceptance of the COVESA Cert

If using git command line you can add a sign-off by using the `-s` argument when creating a commit.

For certain files it is requested that a copyright and license statement is added as file header.
This currently applies to the following file types:

* VSS source files (`*.vspec`)
* Python files (vss-tools, `*.py`)

Those files shall have copyright statement of this form, inspired by the [Eclipse generic copyright header](https://www.eclipse.org/projects/handbook/#ip-copyright-headers).
Copyright/License-statement may also be added to other files if considered relevant.

```
# Copyright (c) {year} Contributors to COVESA
#
# This program and the accompanying materials are made available under the
# terms of the Mozilla Public License 2.0 which is available at
# https://www.mozilla.org/en-US/MPL/2.0/
#
# SPDX-License-Identifier: MPL-2.0

```
Where XXXX is the year the file was originally created, no need to update or append new years or a range of years later.

### VSS Signals shall be generic

Signals added to standard VSS shall be generic, i.e. it shall be possible that other manufacturers can reuse the signal.
Expand Down
7 changes: 6 additions & 1 deletion overlays/extensions/dual_wiper_systems.vspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Copyright (c) 2022 Contributors to COVESA
#
# (C) 2022 Robert Bosch GmbH
# This program and the accompanying materials are made available under the
# terms of the Mozilla Public License 2.0 which is available at
# https://www.mozilla.org/en-US/MPL/2.0/
#
# SPDX-License-Identifier: MPL-2.0

# Overlay to extend wiper system to support multiple instances
# Dependencies to other overlays: None
# Known conflicts with other overlays: None
Expand Down
12 changes: 6 additions & 6 deletions overlays/profiles/motorbike.vspec
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Copyright (c) 2022 Contributors to COVESA
#
# (C) 2022, Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
# (C) 2022 Robert Bosch GmbH
#
# All files and artifacts in this repository are licensed under the
# provisions of the license provided by the LICENSE file in this repository.
#
# This program and the accompanying materials are made available under the
# terms of the Mozilla Public License 2.0 which is available at
# https://www.mozilla.org/en-US/MPL/2.0/
#
# SPDX-License-Identifier: MPL-2.0

# This file contains adoptions to the main spec concering motorbikes.
# It mainly addresses istantiation issues (e.g. wheels) and
# additional signals, which are motorbike specific (e.g. handlebars).
Expand Down
11 changes: 5 additions & 6 deletions spec/ADAS/ADAS.vspec
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
# Copyright (c) 2016 Contributors to COVESA
#
# (C) 2022 Robert Bosch GmbH
# (C) 2018 Volvo Cars
# (C) 2016 Jaguar Land Rover
#
# All files and artifacts in this repository are licensed under the
# provisions of the license provided by the LICENSE file in this repository.
# This program and the accompanying materials are made available under the
# terms of the Mozilla Public License 2.0 which is available at
# https://www.mozilla.org/en-US/MPL/2.0/
#
# SPDX-License-Identifier: MPL-2.0

#
# All Advanced Driver Assist System signals
Expand Down
11 changes: 5 additions & 6 deletions spec/Body/Body.vspec
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
# Copyright (c) 2016 Contributors to COVESA
#
# (C) 2023 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
# (C) 2018 Volvo Cars
# (C) 2016 Jaguar Land Rover
#
# All files and artifacts in this repository are licensed under the
# provisions of the license provided by the LICENSE file in this repository.
# This program and the accompanying materials are made available under the
# terms of the Mozilla Public License 2.0 which is available at
# https://www.mozilla.org/en-US/MPL/2.0/
#
# SPDX-License-Identifier: MPL-2.0

#
# All body signals and attributes.
Expand Down
6 changes: 5 additions & 1 deletion spec/Body/BrakeLights.vspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Copyright (c) 2022 Contributors to COVESA
#
# (C) 2022 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - All rights reserved.
# This program and the accompanying materials are made available under the
# terms of the Mozilla Public License 2.0 which is available at
# https://www.mozilla.org/en-US/MPL/2.0/
#
# SPDX-License-Identifier: MPL-2.0

IsActive:
datatype: string
Expand Down
10 changes: 5 additions & 5 deletions spec/Body/ExteriorMirrors.vspec
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Copyright (c) 2016 Contributors to COVESA
#
# (C) 2018 Volvo Cars
# (C) 2016 Jaguar Land Rover
#
# All files and artifacts in this repository are licensed under the
# provisions of the license provided by the LICENSE file in this repository.
# This program and the accompanying materials are made available under the
# terms of the Mozilla Public License 2.0 which is available at
# https://www.mozilla.org/en-US/MPL/2.0/
#
# SPDX-License-Identifier: MPL-2.0

#
# All exterior mirrors
Expand Down
6 changes: 5 additions & 1 deletion spec/Body/SignalingLights.vspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Copyright (c) 2022 Contributors to COVESA
#
# (C) 2022 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - All rights reserved.
# This program and the accompanying materials are made available under the
# terms of the Mozilla Public License 2.0 which is available at
# https://www.mozilla.org/en-US/MPL/2.0/
#
# SPDX-License-Identifier: MPL-2.0

IsSignaling:
datatype: boolean
Expand Down
6 changes: 5 additions & 1 deletion spec/Body/StaticLights.vspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Copyright (c) 2022 Contributors to COVESA
#
# (C) 2022 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - All rights reserved.
# This program and the accompanying materials are made available under the
# terms of the Mozilla Public License 2.0 which is available at
# https://www.mozilla.org/en-US/MPL/2.0/
#
# SPDX-License-Identifier: MPL-2.0

IsOn:
datatype: boolean
Expand Down
10 changes: 6 additions & 4 deletions spec/Body/WiperSystem.vspec
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# Copyright (c) 2022 Contributors to COVESA
#
# (C) 2022 Robert Bosch GmbH
#
# All files and artifacts in this repository are licensed under the
# provisions of the license provided by the LICENSE file in this repository.
# This program and the accompanying materials are made available under the
# terms of the Mozilla Public License 2.0 which is available at
# https://www.mozilla.org/en-US/MPL/2.0/
#
# SPDX-License-Identifier: MPL-2.0

# This file describes signals for a wiper system interface, allowing movement for one or more wipers
# to be controlled in great detail.
#
Expand Down
11 changes: 5 additions & 6 deletions spec/Cabin/Cabin.vspec
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
# Copyright (c) 2016 Contributors to COVESA
#
# (C) 2023 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
# (C) 2018 Volvo Cars
# (C) 2016 Jaguar Land Rover
#
# All files and artifacts in this repository are licensed under the
# provisions of the license provided by the LICENSE file in this repository.
# This program and the accompanying materials are made available under the
# terms of the Mozilla Public License 2.0 which is available at
# https://www.mozilla.org/en-US/MPL/2.0/
#
# SPDX-License-Identifier: MPL-2.0

#
# All in-cabin originated signals and attributes
Expand Down
11 changes: 5 additions & 6 deletions spec/Cabin/HVAC.vspec
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
# Copyright (c) 2016 Contributors to COVESA
#
# (C) 2023 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
# (C) 2018 Volvo Cars
# (C) 2016 Jaguar Land Rover
#
# All files and artifacts in this repository are licensed under the
# provisions of the license provided by the LICENSE file in this repository.
# This program and the accompanying materials are made available under the
# terms of the Mozilla Public License 2.0 which is available at
# https://www.mozilla.org/en-US/MPL/2.0/
#
# SPDX-License-Identifier: MPL-2.0

#
# All HVAC-originated signals
Expand Down
10 changes: 5 additions & 5 deletions spec/Cabin/Infotainment.vspec
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Copyright (c) 2016 Contributors to COVESA
#
# (C) 2018 Volvo Cars
# (C) 2016 Jaguar Land Rover
#
# All files and artifacts in this repository are licensed under the
# provisions of the license provided by the LICENSE file in this repository.
# This program and the accompanying materials are made available under the
# terms of the Mozilla Public License 2.0 which is available at
# https://www.mozilla.org/en-US/MPL/2.0/
#
# SPDX-License-Identifier: MPL-2.0

#
# In-Vehicle Infotainment Signals
Expand Down
11 changes: 5 additions & 6 deletions spec/Cabin/InteriorLights.vspec
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
# Copyright (c) 2016 Contributors to COVESA
#
# (C) 2023 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
# (C) 2018 Volvo Cars
# (C) 2016 Jaguar Land Rover
#
# All files and artifacts in this repository are licensed under the
# provisions of the license provided by the LICENSE file in this repository.
# This program and the accompanying materials are made available under the
# terms of the Mozilla Public License 2.0 which is available at
# https://www.mozilla.org/en-US/MPL/2.0/
#
# SPDX-License-Identifier: MPL-2.0

#
# All interior lights and sensors
Expand Down
10 changes: 6 additions & 4 deletions spec/Cabin/Occupant.vspec
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# Copyright (c) 2020 Contributors to COVESA
#
# (C) 2020 Robert Bosch GmbH
#
# All files and artifacts in this repository are licensed under the
# provisions of the license provided by the LICENSE file in this repository.
# This program and the accompanying materials are made available under the
# terms of the Mozilla Public License 2.0 which is available at
# https://www.mozilla.org/en-US/MPL/2.0/
#
# SPDX-License-Identifier: MPL-2.0

#
# Occupant data
#
Expand Down
10 changes: 6 additions & 4 deletions spec/Cabin/SingleConfigurableLight.vspec
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# Copyright (c) 2023 Contributors to COVESA
#
# (C) 2023 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
#
# All files and artifacts in this repository are licensed under the
# provisions of the license provided by the LICENSE file in this repository.
# This program and the accompanying materials are made available under the
# terms of the Mozilla Public License 2.0 which is available at
# https://www.mozilla.org/en-US/MPL/2.0/
#
# SPDX-License-Identifier: MPL-2.0


#
# Generic specification for a light whose color and brightness can be configured.
Expand Down
11 changes: 6 additions & 5 deletions spec/Cabin/SingleDoor.vspec
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# Copyright (c) 2023 Contributors to COVESA
#
# (C) 2018 Volvo Cars
# (C) 2016 Jaguar Land Rover
#
# All files and artifacts in this repository are licensed under the
# provisions of the license provided by the LICENSE file in this repository.
# This program and the accompanying materials are made available under the
# terms of the Mozilla Public License 2.0 which is available at
# https://www.mozilla.org/en-US/MPL/2.0/
#
# SPDX-License-Identifier: MPL-2.0


#
# Definition of a single door. Start position for Door is Closed.
Expand Down
10 changes: 5 additions & 5 deletions spec/Cabin/SingleHVACStation.vspec
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Copyright (c) 2016 Contributors to COVESA
#
# (C) 2018 Volvo Cars
# (C) 2016 Jaguar Land Rover
#
# All files and artifacts in this repository are licensed under the
# provisions of the license provided by the LICENSE file in this repository.
# This program and the accompanying materials are made available under the
# terms of the Mozilla Public License 2.0 which is available at
# https://www.mozilla.org/en-US/MPL/2.0/
#
# SPDX-License-Identifier: MPL-2.0

#
# A single HVAC station in the vehicle.
Expand Down
11 changes: 5 additions & 6 deletions spec/Cabin/SingleSeat.vspec
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
# Copyright (c) 2016 Contributors to COVESA
#
# (C) 2022 Robert Bosch GmbH
# (C) 2018 Volvo Cars
# (C) 2016 Jaguar Land Rover
#
# All files and artifacts in this repository are licensed under the
# provisions of the license provided by the LICENSE file in this repository.
# This program and the accompanying materials are made available under the
# terms of the Mozilla Public License 2.0 which is available at
# https://www.mozilla.org/en-US/MPL/2.0/
#
# SPDX-License-Identifier: MPL-2.0

#
# Seat signals
Expand Down
Loading