Skip to content

Commit

Permalink
fix: file copyright headers (#676)
Browse files Browse the repository at this point in the history
utilizes flake8 plugin
<https://pypi.org/project/flake8-copyright-validator/> to assert the
correct headers

Signed-off-by: Jan Kowalleck <[email protected]>
  • Loading branch information
jkowalleck authored Sep 18, 2024
1 parent 934d39d commit 35e00b4
Show file tree
Hide file tree
Showing 70 changed files with 117 additions and 44 deletions.
19 changes: 19 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,22 @@ ignore =
# > Despite being in the best practice section, this will soon be considered an anti-pattern.
# So lets ignore this "suggestion" that is actually an anti-pattern already!
W503

## https://pypi.org/project/flake8-copyright-validator/
copyright-text =
'# This file is part of CycloneDX Python Library'
'#'
'# Licensed under the Apache License, Version 2.0 (the "License");'
'# you may not use this file except in compliance with the License.'
'# You may obtain a copy of the License at'
'#'
'# http://www.apache.org/licenses/LICENSE-2.0'
'#'
'# Unless required by applicable law or agreed to in writing, software'
'# distributed under the License is distributed on an "AS IS" BASIS,'
'# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.'
'# See the License for the specific language governing permissions and'
'# limitations under the License.'
'#'
'# SPDX-License-Identifier: Apache-2.0'
'# Copyright (c) OWASP Foundation. All Rights Reserved.'
2 changes: 2 additions & 0 deletions cyclonedx/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# This file is part of CycloneDX Python Library
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Expand Down
2 changes: 2 additions & 0 deletions cyclonedx/_internal/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# This file is part of CycloneDX Python Library
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Expand Down
2 changes: 2 additions & 0 deletions cyclonedx/_internal/compare.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# This file is part of CycloneDX Python Library
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Expand Down
2 changes: 2 additions & 0 deletions cyclonedx/_internal/hash.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# This file is part of CycloneDX Python Library
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Expand Down
2 changes: 2 additions & 0 deletions cyclonedx/_internal/time.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# This file is part of CycloneDX Python Library
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Expand Down
2 changes: 2 additions & 0 deletions cyclonedx/exception/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# This file is part of CycloneDX Python Library
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Expand Down
2 changes: 2 additions & 0 deletions cyclonedx/exception/factory.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# This file is part of CycloneDX Python Library
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Expand Down
2 changes: 2 additions & 0 deletions cyclonedx/exception/model.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# This file is part of CycloneDX Python Library
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Expand Down
2 changes: 2 additions & 0 deletions cyclonedx/exception/output.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# This file is part of CycloneDX Python Library
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Expand Down
2 changes: 2 additions & 0 deletions cyclonedx/exception/serialization.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# This file is part of CycloneDX Python Library
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Expand Down
2 changes: 2 additions & 0 deletions cyclonedx/factory/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# This file is part of CycloneDX Python Library
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Expand Down
2 changes: 2 additions & 0 deletions cyclonedx/factory/license.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# This file is part of CycloneDX Python Library
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Expand Down
2 changes: 2 additions & 0 deletions cyclonedx/model/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# This file is part of CycloneDX Python Library
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Expand Down
2 changes: 1 addition & 1 deletion cyclonedx/model/bom.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file is part of CycloneDX Python Lib
# This file is part of CycloneDX Python Library
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion cyclonedx/model/bom_ref.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file is part of CycloneDX Python Lib
# This file is part of CycloneDX Python Library
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion cyclonedx/model/component.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file is part of CycloneDX Python Lib
# This file is part of CycloneDX Python Library
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 2 additions & 0 deletions cyclonedx/model/contact.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# This file is part of CycloneDX Python Library
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Expand Down
2 changes: 1 addition & 1 deletion cyclonedx/model/crypto.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file is part of CycloneDX Python Lib
# This file is part of CycloneDX Python Library
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion cyclonedx/model/dependency.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file is part of CycloneDX Python Lib
# This file is part of CycloneDX Python Library
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion cyclonedx/model/impact_analysis.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file is part of CycloneDX Python Lib
# This file is part of CycloneDX Python Library
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 2 additions & 0 deletions cyclonedx/model/issue.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# This file is part of CycloneDX Python Library
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Expand Down
4 changes: 2 additions & 2 deletions cyclonedx/model/license.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# encoding: utf-8

# This file is part of CycloneDX Python Library
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Expand Down
2 changes: 1 addition & 1 deletion cyclonedx/model/release_note.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file is part of CycloneDX Python Lib
# This file is part of CycloneDX Python Library
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 2 additions & 0 deletions cyclonedx/model/service.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# This file is part of CycloneDX Python Library
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Expand Down
2 changes: 1 addition & 1 deletion cyclonedx/model/vulnerability.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file is part of CycloneDX Python Lib
# This file is part of CycloneDX Python Library
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 2 additions & 0 deletions cyclonedx/output/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# This file is part of CycloneDX Python Library
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Expand Down
2 changes: 1 addition & 1 deletion cyclonedx/output/json.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file is part of CycloneDX Python Lib
# This file is part of CycloneDX Python Library
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion cyclonedx/output/xml.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file is part of CycloneDX Python Lib
# This file is part of CycloneDX Python Library
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 2 additions & 0 deletions cyclonedx/schema/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# This file is part of CycloneDX Python Library
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Expand Down
2 changes: 2 additions & 0 deletions cyclonedx/schema/_res/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# This file is part of CycloneDX Python Library
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Expand Down
2 changes: 1 addition & 1 deletion cyclonedx/schema/schema.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file is part of CycloneDX Python Lib
# This file is part of CycloneDX Python Library
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 2 additions & 0 deletions cyclonedx/serialization/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# This file is part of CycloneDX Python Library
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Expand Down
2 changes: 2 additions & 0 deletions cyclonedx/spdx.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# This file is part of CycloneDX Python Library
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Expand Down
2 changes: 2 additions & 0 deletions cyclonedx/validation/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# This file is part of CycloneDX Python Library
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Expand Down
2 changes: 2 additions & 0 deletions cyclonedx/validation/json.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# This file is part of CycloneDX Python Library
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Expand Down
2 changes: 2 additions & 0 deletions cyclonedx/validation/model.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# This file is part of CycloneDX Python Library
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Expand Down
2 changes: 2 additions & 0 deletions cyclonedx/validation/xml.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# This file is part of CycloneDX Python Library
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Expand Down
2 changes: 1 addition & 1 deletion examples/complex_deserialize.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file is part of CycloneDX Python Lib
# This file is part of CycloneDX Python Library
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion examples/complex_serialize.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file is part of CycloneDX Python Lib
# This file is part of CycloneDX Python Library
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ coverage = "7.6.1"
flake8 = { version="7.1.1", python=">=3.8.1" }
flake8-annotations = { version="3.1.1", python=">=3.8.1" }
flake8-bugbear = { version="24.8.19", python=">=3.8.1" }
flake8-copyright-validator = "0.0.1"
flake8-isort = "6.1.1"
flake8-quotes = "3.4.0"
flake8-use-fstring = "1.4"
Expand Down
2 changes: 1 addition & 1 deletion tests/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file is part of CycloneDX Python Lib
# This file is part of CycloneDX Python Library
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
4 changes: 1 addition & 3 deletions tests/_data/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# encoding: utf-8

# This file is part of CycloneDX Python Lib
# This file is part of CycloneDX Python Library
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion tests/_data/models.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file is part of CycloneDX Python Lib
# This file is part of CycloneDX Python Library
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion tests/test_component.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file is part of CycloneDX Python Lib
# This file is part of CycloneDX Python Library
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion tests/test_deserialize_json.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file is part of CycloneDX Python Lib
# This file is part of CycloneDX Python Library
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion tests/test_deserialize_xml.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file is part of CycloneDX Python Lib
# This file is part of CycloneDX Python Library
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 2 additions & 0 deletions tests/test_enums.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# This file is part of CycloneDX Python Library
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Expand Down
2 changes: 1 addition & 1 deletion tests/test_factory_license.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file is part of CycloneDX Python Lib
# This file is part of CycloneDX Python Library
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion tests/test_model.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file is part of CycloneDX Python Lib
# This file is part of CycloneDX Python Library
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion tests/test_model_bom.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file is part of CycloneDX Python Lib
# This file is part of CycloneDX Python Library
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion tests/test_model_bom_ref.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file is part of CycloneDX Python Lib
# This file is part of CycloneDX Python Library
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion tests/test_model_component.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file is part of CycloneDX Python Lib
# This file is part of CycloneDX Python Library
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion tests/test_model_dependency.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file is part of CycloneDX Python Lib
# This file is part of CycloneDX Python Library
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion tests/test_model_issue.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file is part of CycloneDX Python Lib
# This file is part of CycloneDX Python Library
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion tests/test_model_license.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file is part of CycloneDX Python Lib
# This file is part of CycloneDX Python Library
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion tests/test_model_release_note.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file is part of CycloneDX Python Lib
# This file is part of CycloneDX Python Library
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion tests/test_model_service.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file is part of CycloneDX Python Lib
# This file is part of CycloneDX Python Library
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion tests/test_model_vulnerability.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file is part of CycloneDX Python Lib
# This file is part of CycloneDX Python Library
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion tests/test_output.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file is part of CycloneDX Python Lib
# This file is part of CycloneDX Python Library
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion tests/test_output_json.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file is part of CycloneDX Python Lib
# This file is part of CycloneDX Python Library
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion tests/test_output_xml.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file is part of CycloneDX Python Lib
# This file is part of CycloneDX Python Library
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
Loading

0 comments on commit 35e00b4

Please sign in to comment.