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 copyright and SPDX-License-Identifier #71

Merged
merged 2 commits into from
Oct 31, 2024
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 LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
Mozilla Public License Version 2.0
==================================

Copyright (C) 2024 ASAM e.V.

1. Definitions
--------------

Expand Down
6 changes: 6 additions & 0 deletions qc_openscenario/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# SPDX-License-Identifier: MPL-2.0
# Copyright 2024, ASAM e.V.
# This Source Code Form is subject to the terms of the Mozilla
# Public License, v. 2.0. If a copy of the MPL was not distributed
# with this file, You can obtain one at https://mozilla.org/MPL/2.0/.

from . import constants as constants
from . import checks as checks
from . import basic_preconditions as basic_preconditions
6 changes: 6 additions & 0 deletions qc_openscenario/__main__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# SPDX-License-Identifier: MPL-2.0
# Copyright 2024, ASAM e.V.
# This Source Code Form is subject to the terms of the Mozilla
# Public License, v. 2.0. If a copy of the MPL was not distributed
# with this file, You can obtain one at https://mozilla.org/MPL/2.0/.

from qc_openscenario import main

main.main()
6 changes: 6 additions & 0 deletions qc_openscenario/basic_preconditions.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# SPDX-License-Identifier: MPL-2.0
# Copyright 2024, ASAM e.V.
# This Source Code Form is subject to the terms of the Mozilla
# Public License, v. 2.0. If a copy of the MPL was not distributed
# with this file, You can obtain one at https://mozilla.org/MPL/2.0/.

from qc_openscenario.checks.basic_checker import (
valid_xml_document,
root_tag_is_openscenario,
Expand Down
6 changes: 6 additions & 0 deletions qc_openscenario/checks/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# SPDX-License-Identifier: MPL-2.0
# Copyright 2024, ASAM e.V.
# This Source Code Form is subject to the terms of the Mozilla
# Public License, v. 2.0. If a copy of the MPL was not distributed
# with this file, You can obtain one at https://mozilla.org/MPL/2.0/.

from . import schema_checker as schema_checker
from . import basic_checker as basic_checker
from . import reference_checker as reference_checker
Expand Down
6 changes: 6 additions & 0 deletions qc_openscenario/checks/basic_checker/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# SPDX-License-Identifier: MPL-2.0
# Copyright 2024, ASAM e.V.
# This Source Code Form is subject to the terms of the Mozilla
# Public License, v. 2.0. If a copy of the MPL was not distributed
# with this file, You can obtain one at https://mozilla.org/MPL/2.0/.

from . import valid_xml_document as valid_xml_document
from . import root_tag_is_openscenario as root_tag_is_openscenario
from . import fileheader_is_present as fileheader_is_present
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# SPDX-License-Identifier: MPL-2.0
# Copyright 2024, ASAM e.V.
# This Source Code Form is subject to the terms of the Mozilla
# Public License, v. 2.0. If a copy of the MPL was not distributed
# with this file, You can obtain one at https://mozilla.org/MPL/2.0/.

import logging
from qc_baselib import IssueSeverity

Expand Down Expand Up @@ -40,7 +46,6 @@ def check_rule(checker_data: models.CheckerData) -> None:
is_valid = False

if not is_valid:

issue_id = checker_data.result.register_issue(
checker_bundle_name=constants.BUNDLE_NAME,
checker_id=CHECKER_ID,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# SPDX-License-Identifier: MPL-2.0
# Copyright 2024, ASAM e.V.
# This Source Code Form is subject to the terms of the Mozilla
# Public License, v. 2.0. If a copy of the MPL was not distributed
# with this file, You can obtain one at https://mozilla.org/MPL/2.0/.

import logging
from qc_baselib import IssueSeverity

Expand Down Expand Up @@ -32,7 +38,6 @@ def check_rule(checker_data: models.CheckerData) -> None:
is_valid = False

if not is_valid:

issue_id = checker_data.result.register_issue(
checker_bundle_name=constants.BUNDLE_NAME,
checker_id=CHECKER_ID,
Expand Down
7 changes: 6 additions & 1 deletion qc_openscenario/checks/basic_checker/valid_xml_document.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# SPDX-License-Identifier: MPL-2.0
# Copyright 2024, ASAM e.V.
# This Source Code Form is subject to the terms of the Mozilla
# Public License, v. 2.0. If a copy of the MPL was not distributed
# with this file, You can obtain one at https://mozilla.org/MPL/2.0/.

import logging

from lxml import etree
Expand Down Expand Up @@ -37,7 +43,6 @@ def check_rule(checker_data: models.CheckerData) -> None:
is_valid, error_location = _is_xml_doc(checker_data.xml_file_path)

if not is_valid:

issue_id = checker_data.result.register_issue(
checker_bundle_name=constants.BUNDLE_NAME,
checker_id=CHECKER_ID,
Expand Down
7 changes: 6 additions & 1 deletion qc_openscenario/checks/basic_checker/version_is_defined.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# SPDX-License-Identifier: MPL-2.0
# Copyright 2024, ASAM e.V.
# This Source Code Form is subject to the terms of the Mozilla
# Public License, v. 2.0. If a copy of the MPL was not distributed
# with this file, You can obtain one at https://mozilla.org/MPL/2.0/.

import logging

from qc_baselib import IssueSeverity, StatusType
Expand Down Expand Up @@ -69,7 +75,6 @@ def check_rule(checker_data: models.CheckerData) -> None:
is_valid = False

if not is_valid:

issue_id = checker_data.result.register_issue(
checker_bundle_name=constants.BUNDLE_NAME,
checker_id=CHECKER_ID,
Expand Down
6 changes: 6 additions & 0 deletions qc_openscenario/checks/data_type_checker/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# SPDX-License-Identifier: MPL-2.0
# Copyright 2024, ASAM e.V.
# This Source Code Form is subject to the terms of the Mozilla
# Public License, v. 2.0. If a copy of the MPL was not distributed
# with this file, You can obtain one at https://mozilla.org/MPL/2.0/.

from . import allowed_operators as allowed_operators
from . import (
non_negative_transition_time_in_light_state_action as non_negative_transition_time_in_light_state_action,
Expand Down
6 changes: 6 additions & 0 deletions qc_openscenario/checks/data_type_checker/allowed_operators.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# SPDX-License-Identifier: MPL-2.0
# Copyright 2024, ASAM e.V.
# This Source Code Form is subject to the terms of the Mozilla
# Public License, v. 2.0. If a copy of the MPL was not distributed
# with this file, You can obtain one at https://mozilla.org/MPL/2.0/.

import logging

from dataclasses import dataclass
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# SPDX-License-Identifier: MPL-2.0
# Copyright 2024, ASAM e.V.
# This Source Code Form is subject to the terms of the Mozilla
# Public License, v. 2.0. If a copy of the MPL was not distributed
# with this file, You can obtain one at https://mozilla.org/MPL/2.0/.

import logging

from qc_baselib import IssueSeverity, StatusType
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# SPDX-License-Identifier: MPL-2.0
# Copyright 2024, ASAM e.V.
# This Source Code Form is subject to the terms of the Mozilla
# Public License, v. 2.0. If a copy of the MPL was not distributed
# with this file, You can obtain one at https://mozilla.org/MPL/2.0/.

import logging

from qc_baselib import IssueSeverity, StatusType
Expand Down
6 changes: 6 additions & 0 deletions qc_openscenario/checks/models.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# SPDX-License-Identifier: MPL-2.0
# Copyright 2024, ASAM e.V.
# This Source Code Form is subject to the terms of the Mozilla
# Public License, v. 2.0. If a copy of the MPL was not distributed
# with this file, You can obtain one at https://mozilla.org/MPL/2.0/.

from dataclasses import dataclass
from lxml import etree
from typing import Optional
Expand Down
6 changes: 6 additions & 0 deletions qc_openscenario/checks/parameters_checker/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# SPDX-License-Identifier: MPL-2.0
# Copyright 2024, ASAM e.V.
# This Source Code Form is subject to the terms of the Mozilla
# Public License, v. 2.0. If a copy of the MPL was not distributed
# with this file, You can obtain one at https://mozilla.org/MPL/2.0/.

from . import (
valid_parameter_declaration_in_catalogs as valid_parameter_declaration_in_catalogs,
)
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# SPDX-License-Identifier: MPL-2.0
# Copyright 2024, ASAM e.V.
# This Source Code Form is subject to the terms of the Mozilla
# Public License, v. 2.0. If a copy of the MPL was not distributed
# with this file, You can obtain one at https://mozilla.org/MPL/2.0/.

import logging


Expand Down Expand Up @@ -55,7 +61,6 @@ def check_rule(checker_data: models.CheckerData) -> None:
logging.debug(f"catalogs_node : {catalogs_node}")

for catalog_node in catalogs_node:

parameter_declaration_nodes = catalog_node.find(".//ParameterDeclarations")
logging.debug(f"parameter_declaration_nodes : {parameter_declaration_nodes}")
# Get parameters declarations and check if they have default value
Expand Down Expand Up @@ -92,7 +97,6 @@ def check_rule(checker_data: models.CheckerData) -> None:
== models.AttributeType.PARAMETER
and attr_value[1:] not in defined_parameters_with_default
):

issue_id = checker_data.result.register_issue(
checker_bundle_name=constants.BUNDLE_NAME,
checker_id=CHECKER_ID,
Expand Down
6 changes: 6 additions & 0 deletions qc_openscenario/checks/reference_checker/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# SPDX-License-Identifier: MPL-2.0
# Copyright 2024, ASAM e.V.
# This Source Code Form is subject to the terms of the Mozilla
# Public License, v. 2.0. If a copy of the MPL was not distributed
# with this file, You can obtain one at https://mozilla.org/MPL/2.0/.

from . import (
uniquely_resolvable_entity_references as uniquely_resolvable_entity_references,
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# SPDX-License-Identifier: MPL-2.0
# Copyright 2024, ASAM e.V.
# This Source Code Form is subject to the terms of the Mozilla
# Public License, v. 2.0. If a copy of the MPL was not distributed
# with this file, You can obtain one at https://mozilla.org/MPL/2.0/.

import logging

from qc_baselib import IssueSeverity, StatusType
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# SPDX-License-Identifier: MPL-2.0
# Copyright 2024, ASAM e.V.
# This Source Code Form is subject to the terms of the Mozilla
# Public License, v. 2.0. If a copy of the MPL was not distributed
# with this file, You can obtain one at https://mozilla.org/MPL/2.0/.

import logging

from qc_baselib import IssueSeverity, StatusType
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# SPDX-License-Identifier: MPL-2.0
# Copyright 2024, ASAM e.V.
# This Source Code Form is subject to the terms of the Mozilla
# Public License, v. 2.0. If a copy of the MPL was not distributed
# with this file, You can obtain one at https://mozilla.org/MPL/2.0/.

import logging

from qc_baselib import IssueSeverity, StatusType
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# SPDX-License-Identifier: MPL-2.0
# Copyright 2024, ASAM e.V.
# This Source Code Form is subject to the terms of the Mozilla
# Public License, v. 2.0. If a copy of the MPL was not distributed
# with this file, You can obtain one at https://mozilla.org/MPL/2.0/.

import logging

from qc_baselib import IssueSeverity, StatusType
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# SPDX-License-Identifier: MPL-2.0
# Copyright 2024, ASAM e.V.
# This Source Code Form is subject to the terms of the Mozilla
# Public License, v. 2.0. If a copy of the MPL was not distributed
# with this file, You can obtain one at https://mozilla.org/MPL/2.0/.

import logging


Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# SPDX-License-Identifier: MPL-2.0
# Copyright 2024, ASAM e.V.
# This Source Code Form is subject to the terms of the Mozilla
# Public License, v. 2.0. If a copy of the MPL was not distributed
# with this file, You can obtain one at https://mozilla.org/MPL/2.0/.

import logging

from dataclasses import dataclass
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# SPDX-License-Identifier: MPL-2.0
# Copyright 2024, ASAM e.V.
# This Source Code Form is subject to the terms of the Mozilla
# Public License, v. 2.0. If a copy of the MPL was not distributed
# with this file, You can obtain one at https://mozilla.org/MPL/2.0/.

import logging

from typing import List
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# SPDX-License-Identifier: MPL-2.0
# Copyright 2024, ASAM e.V.
# This Source Code Form is subject to the terms of the Mozilla
# Public License, v. 2.0. If a copy of the MPL was not distributed
# with this file, You can obtain one at https://mozilla.org/MPL/2.0/.

import logging


Expand Down Expand Up @@ -54,7 +60,6 @@ def check_rule(checker_data: models.CheckerData) -> None:
return

for maneuver_group in maneuver_groups:

private_actions = maneuver_group.findall(".//PrivateAction")
entity_refs = maneuver_group.findall(".//EntityRef")

Expand Down
6 changes: 6 additions & 0 deletions qc_openscenario/checks/schema_checker/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
# SPDX-License-Identifier: MPL-2.0
# Copyright 2024, ASAM e.V.
# This Source Code Form is subject to the terms of the Mozilla
# Public License, v. 2.0. If a copy of the MPL was not distributed
# with this file, You can obtain one at https://mozilla.org/MPL/2.0/.

from . import valid_schema as valid_schema
7 changes: 6 additions & 1 deletion qc_openscenario/checks/schema_checker/valid_schema.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# SPDX-License-Identifier: MPL-2.0
# Copyright 2024, ASAM e.V.
# This Source Code Form is subject to the terms of the Mozilla
# Public License, v. 2.0. If a copy of the MPL was not distributed
# with this file, You can obtain one at https://mozilla.org/MPL/2.0/.

import importlib.resources
import logging

Expand Down Expand Up @@ -90,7 +96,6 @@ def check_rule(checker_data: models.CheckerData) -> None:
)

if not schema_compliant:

for error in errors:
issue_id = checker_data.result.register_issue(
checker_bundle_name=constants.BUNDLE_NAME,
Expand Down
6 changes: 6 additions & 0 deletions qc_openscenario/checks/utils.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# SPDX-License-Identifier: MPL-2.0
# Copyright 2024, ASAM e.V.
# This Source Code Form is subject to the terms of the Mozilla
# Public License, v. 2.0. If a copy of the MPL was not distributed
# with this file, You can obtain one at https://mozilla.org/MPL/2.0/.

from lxml import etree
from io import BytesIO
from typing import Union, Optional
Expand Down
6 changes: 6 additions & 0 deletions qc_openscenario/constants.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
# SPDX-License-Identifier: MPL-2.0
# Copyright 2024, ASAM e.V.
# This Source Code Form is subject to the terms of the Mozilla
# Public License, v. 2.0. If a copy of the MPL was not distributed
# with this file, You can obtain one at https://mozilla.org/MPL/2.0/.

BUNDLE_NAME = "xoscBundle"
BUNDLE_VERSION = "v1.0.0-rc.1"
6 changes: 6 additions & 0 deletions qc_openscenario/main.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# SPDX-License-Identifier: MPL-2.0
# Copyright 2024, ASAM e.V.
# This Source Code Form is subject to the terms of the Mozilla
# Public License, v. 2.0. If a copy of the MPL was not distributed
# with this file, You can obtain one at https://mozilla.org/MPL/2.0/.

import argparse
import logging
from datetime import datetime
Expand Down
6 changes: 6 additions & 0 deletions qc_openscenario/schema/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
# SPDX-License-Identifier: MPL-2.0
# Copyright 2024, ASAM e.V.
# This Source Code Form is subject to the terms of the Mozilla
# Public License, v. 2.0. If a copy of the MPL was not distributed
# with this file, You can obtain one at https://mozilla.org/MPL/2.0/.

from . import schema_files as schema_files
6 changes: 6 additions & 0 deletions qc_openscenario/schema/schema_files.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# SPDX-License-Identifier: MPL-2.0
# Copyright 2024, ASAM e.V.
# This Source Code Form is subject to the terms of the Mozilla
# Public License, v. 2.0. If a copy of the MPL was not distributed
# with this file, You can obtain one at https://mozilla.org/MPL/2.0/.

SCHEMA_FILES = {
"1.0.0": "1.0.0/OpenSCENARIO.xsd",
"1.1.0": "1.1.0/OpenSCENARIO.xsd",
Expand Down
6 changes: 6 additions & 0 deletions tests/test_basic_checks.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# SPDX-License-Identifier: MPL-2.0
# Copyright 2024, ASAM e.V.
# This Source Code Form is subject to the terms of the Mozilla
# Public License, v. 2.0. If a copy of the MPL was not distributed
# with this file, You can obtain one at https://mozilla.org/MPL/2.0/.

import os
import pytest
import test_utils
Expand Down
Loading