-
-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* adde file for type checkers according to PEP 561 Signed-off-by: Jan Kowalleck <[email protected]> * added static code analysis as a dev-test Signed-off-by: Jan Kowalleck <[email protected]> * added the "typed" trove Signed-off-by: Jan Kowalleck <[email protected]> * added `flake8-annotations` to the tests Signed-off-by: Jan Kowalleck <[email protected]> * added type hints Signed-off-by: Jan Kowalleck <[email protected]> * further typing updates Signed-off-by: Paul Horton <[email protected]> * further typing additions and test updates Signed-off-by: Paul Horton <[email protected]> * further typing Signed-off-by: Paul Horton <[email protected]> * further typing - added type stubs for toml and setuptools Signed-off-by: Paul Horton <[email protected]> * further typing Signed-off-by: Paul Horton <[email protected]> * typing work Signed-off-by: Paul Horton <[email protected]> * coding standards Signed-off-by: Paul Horton <[email protected]> * fixed tox and mypy running in correct python version Signed-off-by: Jan Kowalleck <[email protected]> * supressed mypy for `cyclonedx.utils.conda.parse_conda_json_to_conda_package` Signed-off-by: Jan Kowalleck <[email protected]> * fixed type hints Signed-off-by: Jan Kowalleck <[email protected]> * fixed some typing related flaws Signed-off-by: Jan Kowalleck <[email protected]> * added flake8-bugbear for code analysis Signed-off-by: Jan Kowalleck <[email protected]> Co-authored-by: Paul Horton <[email protected]>
- Loading branch information
1 parent
f34e2c2
commit 9144765
Showing
40 changed files
with
652 additions
and
281 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
[mypy] | ||
|
||
files = cyclonedx/ | ||
|
||
show_error_codes = True | ||
pretty = True | ||
|
||
warn_unreachable = True | ||
allow_redefinition = False | ||
|
||
# ignore_missing_imports = False | ||
# follow_imports = normal | ||
# follow_imports_for_stubs = True | ||
|
||
### Strict mode ### | ||
warn_unused_configs = True | ||
disallow_subclassing_any = True | ||
disallow_any_generics = True | ||
disallow_untyped_calls = True | ||
disallow_untyped_defs = True | ||
disallow_incomplete_defs = True | ||
check_untyped_defs = True | ||
disallow_untyped_decorators = True | ||
no_implicit_optional = True | ||
warn_redundant_casts = True | ||
warn_unused_ignores = True | ||
warn_return_any = True | ||
no_implicit_reexport = True | ||
|
||
[mypy-pytest.*] | ||
ignore_missing_imports = True | ||
|
||
[mypy-tests.*] | ||
disallow_untyped_decorators = False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# encoding: utf-8 | ||
|
||
# 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 | ||
# | ||
|
||
""" | ||
Exceptions that are specific to the CycloneDX library implementation. | ||
""" | ||
|
||
|
||
class CycloneDxException(Exception): | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# encoding: utf-8 | ||
|
||
# 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 | ||
# | ||
|
||
""" | ||
Exceptions that are specific error scenarios during occuring within Parsers in the CycloneDX library implementation. | ||
""" | ||
|
||
from . import CycloneDxException | ||
|
||
|
||
class UnknownHashTypeException(CycloneDxException): | ||
""" | ||
Exception raised when we are unable to determine the type of hash from a composite hash string. | ||
""" | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.