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

chore: ignore coverage of abstract methods #699

Merged
merged 1 commit into from
Oct 10, 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: 1 addition & 1 deletion cyclonedx/model/dependency.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,4 @@ class Dependable(ABC):
@property
@abstractmethod
def bom_ref(self) -> BomRef:
...
... # pragma: no cover
14 changes: 7 additions & 7 deletions cyclonedx/output/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ def __init__(self, bom: 'Bom', **kwargs: int) -> None:
@property
@abstractmethod
def schema_version(self) -> SchemaVersion:
...
... # pragma: no cover

@property
@abstractmethod
def output_format(self) -> OutputFormat:
...
... # pragma: no cover

@property
def generated(self) -> bool:
Expand All @@ -69,13 +69,13 @@ def set_bom(self, bom: 'Bom') -> None:

@abstractmethod
def generate(self, force_regeneration: bool = False) -> None:
...
... # pragma: no cover

@abstractmethod
def output_as_string(self, *,
indent: Optional[Union[int, str]] = None,
**kwargs: Any) -> str:
...
... # pragma: no cover

def output_to_file(self, filename: str, allow_overwrite: bool = False, *,
indent: Optional[Union[int, str]] = None,
Expand All @@ -94,19 +94,19 @@ def output_to_file(self, filename: str, allow_overwrite: bool = False, *,
@overload
def make_outputter(bom: 'Bom', output_format: Literal[OutputFormat.JSON],
schema_version: SchemaVersion) -> 'JsonOutputter':
...
... # pragma: no cover


@overload
def make_outputter(bom: 'Bom', output_format: Literal[OutputFormat.XML],
schema_version: SchemaVersion) -> 'XmlOutputter':
...
... # pragma: no cover


@overload
def make_outputter(bom: 'Bom', output_format: OutputFormat,
schema_version: SchemaVersion) -> Union['XmlOutputter', 'JsonOutputter']:
...
... # pragma: no cover


def make_outputter(bom: 'Bom', output_format: OutputFormat, schema_version: SchemaVersion) -> BaseOutput:
Expand Down
2 changes: 1 addition & 1 deletion cyclonedx/output/json.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def output_as_string(self, *,

@abstractmethod
def _get_schema_uri(self) -> Optional[str]:
pass
... # pragma: no cover


class JsonV1Dot0(Json, SchemaVersion1Dot0):
Expand Down
2 changes: 1 addition & 1 deletion cyclonedx/schema/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class BaseSchemaVersion(ABC, ViewType):
@property
@abstractmethod
def schema_version_enum(self) -> SchemaVersion:
...
... # pragma: no cover

def get_schema_version(self) -> str:
return self.schema_version_enum.to_version()
Expand Down
12 changes: 6 additions & 6 deletions cyclonedx/validation/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def validate_str(self, data: str) -> Optional[ValidationError]:
:retval None: if ``data`` is valid
:retval ValidationError: if ``data`` is invalid
"""
...
... # pragma: no cover


class BaseSchemabasedValidator(ABC, SchemabasedValidator):
Expand All @@ -76,31 +76,31 @@ def schema_version(self) -> 'SchemaVersion':
@abstractmethod
def output_format(self) -> OutputFormat:
"""Get the format."""
...
... # pragma: no cover

@property
@abstractmethod
def _schema_file(self) -> Optional[str]:
"""Get the schema file according to schema version."""
...
... # pragma: no cover


@overload
def make_schemabased_validator(output_format: Literal[OutputFormat.JSON], schema_version: 'SchemaVersion'
) -> 'JsonValidator':
...
... # pragma: no cover


@overload
def make_schemabased_validator(output_format: Literal[OutputFormat.XML], schema_version: 'SchemaVersion'
) -> 'XmlValidator':
...
... # pragma: no cover


@overload
def make_schemabased_validator(output_format: OutputFormat, schema_version: 'SchemaVersion'
) -> Union['JsonValidator', 'XmlValidator']:
...
... # pragma: no cover


def make_schemabased_validator(output_format: OutputFormat, schema_version: 'SchemaVersion'
Expand Down