Skip to content

Commit

Permalink
Applied black formatting
Browse files Browse the repository at this point in the history
Signed-off-by: Chin Yeung Li <[email protected]>
  • Loading branch information
chinyeungli committed Aug 29, 2024
1 parent c009d9e commit e61804f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 11 deletions.
9 changes: 3 additions & 6 deletions src/cwe2/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,9 @@ def __str__(self):
class Database:
database_paths = (
[navigate_cwe.get(key).get("csv_file") for key in navigate_cwe.keys()]
+ [external_mapping.get(key).get("csv_file")
for key in external_mapping.keys()]
+ [helpful_view.get(key).get("csv_file")
for key in helpful_view.keys()]
+ [obsolete_views.get(key).get("csv_file")
for key in obsolete_views.keys()]
+ [external_mapping.get(key).get("csv_file") for key in external_mapping.keys()]
+ [helpful_view.get(key).get("csv_file") for key in helpful_view.keys()]
+ [obsolete_views.get(key).get("csv_file") for key in obsolete_views.keys()]
)

cwe_files = {open(path, encoding="utf-8") for path in database_paths}
Expand Down
3 changes: 1 addition & 2 deletions src/cwe2/mappings.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ def get_data_file_path(package: str, resource: str) -> str:
# Guard against non-existing files, or else importlib_resources.path
# may raise a confusing TypeError.
if not importlib_resources.is_resource(package, resource):
raise FileNotFoundError(
f"Python package '{package}' resource '{resource}' not found.")
raise FileNotFoundError(f"Python package '{package}' resource '{resource}' not found.")

with importlib_resources.path(package, resource) as resource_path:
return os.fspath(resource_path)
Expand Down
4 changes: 2 additions & 2 deletions tests/test_cwe.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#
# Copyright (c) Julian-Nash, Ziad Hany, nexB. Inc. and others. All rights reserved.
# SPDX-License-Identifier: MIT
# See https://github.com/nexB/cwe2/blob/main/mit.LICENSE for the license text.
# See https://github.com/nexB/cwe2 for support or download.
# See https://github.com/aboutcode-org/cwe2/blob/main/mit.LICENSE for the license text.
# See https://github.com/aboutcode-org/cwe2 for support or download.
# See https://aboutcode.org for more information about nexB OSS projects.
#
from unittest import TestCase
Expand Down
2 changes: 1 addition & 1 deletion tests/test_skeleton_codestyle.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# ScanCode is a trademark of nexB Inc.
# SPDX-License-Identifier: Apache-2.0
# See http://www.apache.org/licenses/LICENSE-2.0 for the license text.
# See https://github.com/nexB/skeleton for support or download.
# See https://github.com/aboutcode-org/skeleton for support or download.
# See https://aboutcode.org for more information about nexB OSS projects.
#

Expand Down

0 comments on commit e61804f

Please sign in to comment.