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

fix: typing for kwargs #462

Merged
merged 1 commit into from
Oct 5, 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
6 changes: 3 additions & 3 deletions cyclonedx/output/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import os
from abc import ABC, abstractmethod
from importlib import import_module
from typing import Any, Dict, Iterable, Optional, Type, Union
from typing import Any, Iterable, Optional, Type, Union

from ..model.bom import Bom
from ..model.component import Component
Expand Down Expand Up @@ -72,12 +72,12 @@ def generate(self, force_regeneration: bool = False) -> None:
@abstractmethod
def output_as_string(self, *,
indent: Optional[Union[int, str]] = None,
**kwargs: Dict[str, Any]) -> str:
**kwargs: Any) -> str:
...

def output_to_file(self, filename: str, allow_overwrite: bool = False, *,
indent: Optional[Union[int, str]] = None,
**kwargs: Dict[str, Any]) -> None:
**kwargs: Any) -> None:
# Check directory writable
output_filename = os.path.realpath(filename)
output_directory = os.path.dirname(output_filename)
Expand Down
2 changes: 1 addition & 1 deletion cyclonedx/output/json.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def generate(self, force_regeneration: bool = False) -> None:

def output_as_string(self, *,
indent: Optional[Union[int, str]] = None,
**kwargs: Dict[str, Any]) -> str:
**kwargs: Any) -> str:
self.generate()
return json_dumps(self._bom_json,
indent=indent)
Expand Down
2 changes: 1 addition & 1 deletion cyclonedx/output/xml.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def __make_indent(v: Optional[Union[int, str]]) -> str:

def output_as_string(self, *,
indent: Optional[Union[int, str]] = None,
**kwargs: Dict[str, Any]) -> str:
**kwargs: Any) -> str:
self.generate()
return self._bom_xml if indent is None else dom_parseString(self._bom_xml).toprettyxml(
indent=self.__make_indent(indent)
Expand Down