Skip to content

Commit

Permalink
chore(deps): bump ruff from 0.2.1 to 0.3.0 in /requirements/lintrunner (
Browse files Browse the repository at this point in the history
  • Loading branch information
dependabot[bot] authored Mar 5, 2024
1 parent aded324 commit 9943026
Show file tree
Hide file tree
Showing 40 changed files with 145 additions and 130 deletions.
1 change: 0 additions & 1 deletion docs/examples/01_plot_selu.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
The example below shows how we can define Selu as a function in onnxscript.
"""


# %%
# First, import the ONNX opset used to define the function.
from onnxscript import opset15 as op
Expand Down
1 change: 1 addition & 0 deletions docs/examples/04_plot_eager_mode_evaluation.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
The example below illustrates this. We first define an *onnxscript* function:
"""

import numpy as np

from onnxscript import FLOAT, script
Expand Down
1 change: 1 addition & 0 deletions onnxscript/_internal/ast_utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Utilities for working with Python ASTs."""

from __future__ import annotations

import ast
Expand Down
1 change: 1 addition & 0 deletions onnxscript/_internal/param_manipulation.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Function for manipulating input parameters of an Op or a OnnxFunction."""

from __future__ import annotations

import collections
Expand Down
1 change: 1 addition & 0 deletions onnxscript/_internal/runtime_typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
type checking. The decorator is a no-op when the `beartype` library is not
installed.
"""

import warnings

__all__ = [
Expand Down
6 changes: 3 additions & 3 deletions onnxscript/diagnostics/infra/sarif/_artifact_content.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ class ArtifactContent:
properties: Optional[_property_bag.PropertyBag] = dataclasses.field(
default=None, metadata={"schema_property_name": "properties"}
)
rendered: Optional[
_multiformat_message_string.MultiformatMessageString
] = dataclasses.field(default=None, metadata={"schema_property_name": "rendered"})
rendered: Optional[_multiformat_message_string.MultiformatMessageString] = (
dataclasses.field(default=None, metadata={"schema_property_name": "rendered"})
)
text: Optional[str] = dataclasses.field(
default=None, metadata={"schema_property_name": "text"}
)
Expand Down
8 changes: 4 additions & 4 deletions onnxscript/diagnostics/infra/sarif/_conversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ class Conversion:
"""Describes how a converter transformed the output of a static analysis tool from the analysis tool's native output format into the SARIF format."""

tool: _tool.Tool = dataclasses.field(metadata={"schema_property_name": "tool"})
analysis_tool_log_files: Optional[
List[_artifact_location.ArtifactLocation]
] = dataclasses.field(
default=None, metadata={"schema_property_name": "analysisToolLogFiles"}
analysis_tool_log_files: Optional[List[_artifact_location.ArtifactLocation]] = (
dataclasses.field(
default=None, metadata={"schema_property_name": "analysisToolLogFiles"}
)
)
invocation: Optional[_invocation.Invocation] = dataclasses.field(
default=None, metadata={"schema_property_name": "invocation"}
Expand Down
8 changes: 4 additions & 4 deletions onnxscript/diagnostics/infra/sarif/_external_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,10 @@ class ExternalProperties:
taxonomies: Optional[List[_tool_component.ToolComponent]] = dataclasses.field(
default=None, metadata={"schema_property_name": "taxonomies"}
)
thread_flow_locations: Optional[
List[_thread_flow_location.ThreadFlowLocation]
] = dataclasses.field(
default=None, metadata={"schema_property_name": "threadFlowLocations"}
thread_flow_locations: Optional[List[_thread_flow_location.ThreadFlowLocation]] = (
dataclasses.field(
default=None, metadata={"schema_property_name": "threadFlowLocations"}
)
)
translations: Optional[List[_tool_component.ToolComponent]] = dataclasses.field(
default=None, metadata={"schema_property_name": "translations"}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ class ExternalPropertyFileReferences:
artifacts: Optional[
List[_external_property_file_reference.ExternalPropertyFileReference]
] = dataclasses.field(default=None, metadata={"schema_property_name": "artifacts"})
conversion: Optional[
_external_property_file_reference.ExternalPropertyFileReference
] = dataclasses.field(default=None, metadata={"schema_property_name": "conversion"})
driver: Optional[
_external_property_file_reference.ExternalPropertyFileReference
] = dataclasses.field(default=None, metadata={"schema_property_name": "driver"})
conversion: Optional[_external_property_file_reference.ExternalPropertyFileReference] = (
dataclasses.field(default=None, metadata={"schema_property_name": "conversion"})
)
driver: Optional[_external_property_file_reference.ExternalPropertyFileReference] = (
dataclasses.field(default=None, metadata={"schema_property_name": "driver"})
)
extensions: Optional[
List[_external_property_file_reference.ExternalPropertyFileReference]
] = dataclasses.field(default=None, metadata={"schema_property_name": "extensions"})
Expand All @@ -36,9 +36,9 @@ class ExternalPropertyFileReferences:
] = dataclasses.field(
default=None, metadata={"schema_property_name": "externalizedProperties"}
)
graphs: Optional[
List[_external_property_file_reference.ExternalPropertyFileReference]
] = dataclasses.field(default=None, metadata={"schema_property_name": "graphs"})
graphs: Optional[List[_external_property_file_reference.ExternalPropertyFileReference]] = (
dataclasses.field(default=None, metadata={"schema_property_name": "graphs"})
)
invocations: Optional[
List[_external_property_file_reference.ExternalPropertyFileReference]
] = dataclasses.field(default=None, metadata={"schema_property_name": "invocations"})
Expand Down
20 changes: 10 additions & 10 deletions onnxscript/diagnostics/infra/sarif/_invocation.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,16 +92,16 @@ class Invocation:
stdout_stderr: Optional[_artifact_location.ArtifactLocation] = dataclasses.field(
default=None, metadata={"schema_property_name": "stdoutStderr"}
)
tool_configuration_notifications: Optional[
List[_notification.Notification]
] = dataclasses.field(
default=None,
metadata={"schema_property_name": "toolConfigurationNotifications"},
)
tool_execution_notifications: Optional[
List[_notification.Notification]
] = dataclasses.field(
default=None, metadata={"schema_property_name": "toolExecutionNotifications"}
tool_configuration_notifications: Optional[List[_notification.Notification]] = (
dataclasses.field(
default=None,
metadata={"schema_property_name": "toolConfigurationNotifications"},
)
)
tool_execution_notifications: Optional[List[_notification.Notification]] = (
dataclasses.field(
default=None, metadata={"schema_property_name": "toolExecutionNotifications"}
)
)
working_directory: Optional[_artifact_location.ArtifactLocation] = dataclasses.field(
default=None, metadata={"schema_property_name": "workingDirectory"}
Expand Down
6 changes: 3 additions & 3 deletions onnxscript/diagnostics/infra/sarif/_location.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ class Location:
properties: Optional[_property_bag.PropertyBag] = dataclasses.field(
default=None, metadata={"schema_property_name": "properties"}
)
relationships: Optional[
List[_location_relationship.LocationRelationship]
] = dataclasses.field(default=None, metadata={"schema_property_name": "relationships"})
relationships: Optional[List[_location_relationship.LocationRelationship]] = (
dataclasses.field(default=None, metadata={"schema_property_name": "relationships"})
)


# flake8: noqa
12 changes: 6 additions & 6 deletions onnxscript/diagnostics/infra/sarif/_notification.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ class Notification:
"""Describes a condition relevant to the tool itself, as opposed to being relevant to a target being analyzed by the tool."""

message: _message.Message = dataclasses.field(metadata={"schema_property_name": "message"})
associated_rule: Optional[
_reporting_descriptor_reference.ReportingDescriptorReference
] = dataclasses.field(default=None, metadata={"schema_property_name": "associatedRule"})
descriptor: Optional[
_reporting_descriptor_reference.ReportingDescriptorReference
] = dataclasses.field(default=None, metadata={"schema_property_name": "descriptor"})
associated_rule: Optional[_reporting_descriptor_reference.ReportingDescriptorReference] = (
dataclasses.field(default=None, metadata={"schema_property_name": "associatedRule"})
)
descriptor: Optional[_reporting_descriptor_reference.ReportingDescriptorReference] = (
dataclasses.field(default=None, metadata={"schema_property_name": "descriptor"})
)
exception: Optional[_exception.Exception] = dataclasses.field(
default=None, metadata={"schema_property_name": "exception"}
)
Expand Down
20 changes: 10 additions & 10 deletions onnxscript/diagnostics/infra/sarif/_reporting_descriptor.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ class ReportingDescriptor:
"""Metadata that describes a specific report produced by the tool, as part of the analysis it provides or its runtime reporting."""

id: str = dataclasses.field(metadata={"schema_property_name": "id"})
default_configuration: Optional[
_reporting_configuration.ReportingConfiguration
] = dataclasses.field(
default=None, metadata={"schema_property_name": "defaultConfiguration"}
default_configuration: Optional[_reporting_configuration.ReportingConfiguration] = (
dataclasses.field(
default=None, metadata={"schema_property_name": "defaultConfiguration"}
)
)
deprecated_guids: Optional[List[str]] = dataclasses.field(
default=None, metadata={"schema_property_name": "deprecatedGuids"}
Expand All @@ -33,9 +33,9 @@ class ReportingDescriptor:
deprecated_names: Optional[List[str]] = dataclasses.field(
default=None, metadata={"schema_property_name": "deprecatedNames"}
)
full_description: Optional[
_multiformat_message_string.MultiformatMessageString
] = dataclasses.field(default=None, metadata={"schema_property_name": "fullDescription"})
full_description: Optional[_multiformat_message_string.MultiformatMessageString] = (
dataclasses.field(default=None, metadata={"schema_property_name": "fullDescription"})
)
guid: Optional[str] = dataclasses.field(
default=None, metadata={"schema_property_name": "guid"}
)
Expand All @@ -57,9 +57,9 @@ class ReportingDescriptor:
relationships: Optional[
List[_reporting_descriptor_relationship.ReportingDescriptorRelationship]
] = dataclasses.field(default=None, metadata={"schema_property_name": "relationships"})
short_description: Optional[
_multiformat_message_string.MultiformatMessageString
] = dataclasses.field(default=None, metadata={"schema_property_name": "shortDescription"})
short_description: Optional[_multiformat_message_string.MultiformatMessageString] = (
dataclasses.field(default=None, metadata={"schema_property_name": "shortDescription"})
)


# flake8: noqa
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ class ReportingDescriptorReference:
properties: Optional[_property_bag.PropertyBag] = dataclasses.field(
default=None, metadata={"schema_property_name": "properties"}
)
tool_component: Optional[
_tool_component_reference.ToolComponentReference
] = dataclasses.field(default=None, metadata={"schema_property_name": "toolComponent"})
tool_component: Optional[_tool_component_reference.ToolComponentReference] = (
dataclasses.field(default=None, metadata={"schema_property_name": "toolComponent"})
)


# flake8: noqa
24 changes: 12 additions & 12 deletions onnxscript/diagnostics/infra/sarif/_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ class Result:
attachments: Optional[List[_attachment.Attachment]] = dataclasses.field(
default=None, metadata={"schema_property_name": "attachments"}
)
baseline_state: Optional[
Literal["new", "unchanged", "updated", "absent"]
] = dataclasses.field(default=None, metadata={"schema_property_name": "baselineState"})
baseline_state: Optional[Literal["new", "unchanged", "updated", "absent"]] = (
dataclasses.field(default=None, metadata={"schema_property_name": "baselineState"})
)
code_flows: Optional[List[_code_flow.CodeFlow]] = dataclasses.field(
default=None, metadata={"schema_property_name": "codeFlows"}
)
Expand All @@ -63,9 +63,9 @@ class Result:
hosted_viewer_uri: Optional[str] = dataclasses.field(
default=None, metadata={"schema_property_name": "hostedViewerUri"}
)
kind: Literal[
"notApplicable", "pass", "fail", "review", "open", "informational"
] = dataclasses.field(default="fail", metadata={"schema_property_name": "kind"})
kind: Literal["notApplicable", "pass", "fail", "review", "open", "informational"] = (
dataclasses.field(default="fail", metadata={"schema_property_name": "kind"})
)
level: Literal["none", "note", "warning", "error"] = dataclasses.field(
default="warning", metadata={"schema_property_name": "level"}
)
Expand All @@ -88,9 +88,9 @@ class Result:
related_locations: Optional[List[_location.Location]] = dataclasses.field(
default=None, metadata={"schema_property_name": "relatedLocations"}
)
rule: Optional[
_reporting_descriptor_reference.ReportingDescriptorReference
] = dataclasses.field(default=None, metadata={"schema_property_name": "rule"})
rule: Optional[_reporting_descriptor_reference.ReportingDescriptorReference] = (
dataclasses.field(default=None, metadata={"schema_property_name": "rule"})
)
rule_id: Optional[str] = dataclasses.field(
default=None, metadata={"schema_property_name": "ruleId"}
)
Expand All @@ -103,9 +103,9 @@ class Result:
suppressions: Optional[List[_suppression.Suppression]] = dataclasses.field(
default=None, metadata={"schema_property_name": "suppressions"}
)
taxa: Optional[
List[_reporting_descriptor_reference.ReportingDescriptorReference]
] = dataclasses.field(default=None, metadata={"schema_property_name": "taxa"})
taxa: Optional[List[_reporting_descriptor_reference.ReportingDescriptorReference]] = (
dataclasses.field(default=None, metadata={"schema_property_name": "taxa"})
)
web_request: Optional[_web_request.WebRequest] = dataclasses.field(
default=None, metadata={"schema_property_name": "webRequest"}
)
Expand Down
6 changes: 3 additions & 3 deletions onnxscript/diagnostics/infra/sarif/_result_provenance.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
class ResultProvenance:
"""Contains information about how and when a result was detected."""

conversion_sources: Optional[
List[_physical_location.PhysicalLocation]
] = dataclasses.field(default=None, metadata={"schema_property_name": "conversionSources"})
conversion_sources: Optional[List[_physical_location.PhysicalLocation]] = (
dataclasses.field(default=None, metadata={"schema_property_name": "conversionSources"})
)
first_detection_run_guid: Optional[str] = dataclasses.field(
default=None, metadata={"schema_property_name": "firstDetectionRunGuid"}
)
Expand Down
20 changes: 10 additions & 10 deletions onnxscript/diagnostics/infra/sarif/_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ class Run:
artifacts: Optional[List[_artifact.Artifact]] = dataclasses.field(
default=None, metadata={"schema_property_name": "artifacts"}
)
automation_details: Optional[
_run_automation_details.RunAutomationDetails
] = dataclasses.field(default=None, metadata={"schema_property_name": "automationDetails"})
automation_details: Optional[_run_automation_details.RunAutomationDetails] = (
dataclasses.field(default=None, metadata={"schema_property_name": "automationDetails"})
)
baseline_guid: Optional[str] = dataclasses.field(
default=None, metadata={"schema_property_name": "baselineGuid"}
)
Expand Down Expand Up @@ -93,19 +93,19 @@ class Run:
results: Optional[List[_result.Result]] = dataclasses.field(
default=None, metadata={"schema_property_name": "results"}
)
run_aggregates: Optional[
List[_run_automation_details.RunAutomationDetails]
] = dataclasses.field(default=None, metadata={"schema_property_name": "runAggregates"})
run_aggregates: Optional[List[_run_automation_details.RunAutomationDetails]] = (
dataclasses.field(default=None, metadata={"schema_property_name": "runAggregates"})
)
special_locations: Optional[_special_locations.SpecialLocations] = dataclasses.field(
default=None, metadata={"schema_property_name": "specialLocations"}
)
taxonomies: Optional[List[_tool_component.ToolComponent]] = dataclasses.field(
default=None, metadata={"schema_property_name": "taxonomies"}
)
thread_flow_locations: Optional[
List[_thread_flow_location.ThreadFlowLocation]
] = dataclasses.field(
default=None, metadata={"schema_property_name": "threadFlowLocations"}
thread_flow_locations: Optional[List[_thread_flow_location.ThreadFlowLocation]] = (
dataclasses.field(
default=None, metadata={"schema_property_name": "threadFlowLocations"}
)
)
translations: Optional[List[_tool_component.ToolComponent]] = dataclasses.field(
default=None, metadata={"schema_property_name": "translations"}
Expand Down
8 changes: 4 additions & 4 deletions onnxscript/diagnostics/infra/sarif/_sarif_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ class SarifLog:
schema_uri: Optional[str] = dataclasses.field(
default=None, metadata={"schema_property_name": "$schema"}
)
inline_external_properties: Optional[
List[_external_properties.ExternalProperties]
] = dataclasses.field(
default=None, metadata={"schema_property_name": "inlineExternalProperties"}
inline_external_properties: Optional[List[_external_properties.ExternalProperties]] = (
dataclasses.field(
default=None, metadata={"schema_property_name": "inlineExternalProperties"}
)
)
properties: Optional[_property_bag.PropertyBag] = dataclasses.field(
default=None, metadata={"schema_property_name": "properties"}
Expand Down
6 changes: 3 additions & 3 deletions onnxscript/diagnostics/infra/sarif/_thread_flow_location.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ class ThreadFlowLocation:
default=None, metadata={"schema_property_name": "stack"}
)
state: Any = dataclasses.field(default=None, metadata={"schema_property_name": "state"})
taxa: Optional[
List[_reporting_descriptor_reference.ReportingDescriptorReference]
] = dataclasses.field(default=None, metadata={"schema_property_name": "taxa"})
taxa: Optional[List[_reporting_descriptor_reference.ReportingDescriptorReference]] = (
dataclasses.field(default=None, metadata={"schema_property_name": "taxa"})
)
web_request: Optional[_web_request.WebRequest] = dataclasses.field(
default=None, metadata={"schema_property_name": "webRequest"}
)
Expand Down
Loading

0 comments on commit 9943026

Please sign in to comment.