Skip to content

Commit

Permalink
Merge pull request #97 from atlanticwave-sdx/58.ruff
Browse files Browse the repository at this point in the history
Run a linter on CI
  • Loading branch information
sajith authored Aug 8, 2023
2 parents da838b8 + 60b4830 commit db13129
Show file tree
Hide file tree
Showing 15 changed files with 377 additions and 329 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,15 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest pytest-cov wheel build coverage
pip install ruff==0.0.282 pytest pytest-cov wheel build coverage
- name: Lint with flake8
- name: Lint with ruff
run: |
# Stop the build if there are Python syntax errors or undefined names.
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# Stop the build if there are Python syntax errors or
# undefined names.
ruff check . --select=E9,F63,F7,F82 --show-source
# exit-zero treats all errors as warnings.
flake8 . --count --exit-zero --max-complexity=10 --statistics
ruff check . --exit-zero --statistics
- name: Run tests
run: |
Expand Down
6 changes: 6 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,9 @@ source = [
# In tox environments.
".tox/**/site-packages/"
]

[tool.ruff]
ignore = [
"E501" # Ignore 'line too long' errors since we auto-format
# using black.
]
88 changes: 42 additions & 46 deletions src/sdx_datamodel/models/connection.py
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
# coding: utf-8

"""
SDX LC
SDX LC
You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). # noqa: E501
You can find out more about Swagger at http://swagger.io.
OpenAPI spec version: 1.0.0
Contact: [email protected]
Generated by: https://github.com/swagger-api/swagger-codegen.git
OpenAPI spec version: 1.0.0
Contact: [email protected]
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""

import pprint
import re # noqa: F401

import six

from .port import Port


class Connection(object):
"""NOTE: This class is auto generated by the swagger code generator program.
"""
NOTE: This class is auto generated by the swagger code generator
program.
Do not edit the class manually.
"""
Expand Down Expand Up @@ -52,7 +53,6 @@ class Connection(object):
"end_time": "end_time",
"bandwidth": "float",
"latency": "float",
"latency": "float",
"status": "status",
}

Expand Down Expand Up @@ -83,10 +83,10 @@ def __init__(

@property
def id(self):
"""Gets the id of this Connection. # noqa: E501
"""Gets the id of this Connection.
:return: The id of this Connection. # noqa: E501
:return: The id of this Connection.
:rtype: str
"""
return self._id
Expand All @@ -96,22 +96,20 @@ def id(self, id):
"""Sets the id of this Connection.
:param id: The id of this Connection. # noqa: E501
:param id: The id of this Connection.
:type: str
"""
if id is None:
raise ValueError(
"Invalid value for `id`, must not be `None`"
) # noqa: E501
raise ValueError("Invalid value for `id`, must not be `None`")

self._id = id

@property
def name(self):
"""Gets the name of this Connection. # noqa: E501
"""Gets the name of this Connection.
:return: The name of this Connection. # noqa: E501
:return: The name of this Connection.
:rtype: str
"""
return self._name
Expand All @@ -121,22 +119,20 @@ def name(self, name):
"""Sets the name of this Connection.
:param name: The name of this Connection. # noqa: E501
:param name: The name of this Connection.
:type: str
"""
if name is None:
raise ValueError(
"Invalid value for `name`, must not be `None`"
) # noqa: E501
raise ValueError("Invalid value for `name`, must not be `None`")

self._name = name

@property
def ingress_port(self):
"""Gets the ingress_port of this Connection. # noqa: E501
"""Gets the ingress_port of this Connection.
:return: The ingress_port of this Connection. # noqa: E501
:return: The ingress_port of this Connection.
:rtype: Port
"""
return self._ingress_port
Expand Down Expand Up @@ -165,10 +161,10 @@ def set_ingress_port(self, ingress_port: Port) -> Port:

@property
def egress_port(self):
"""Gets the egress_port of this Connection. # noqa: E501
"""Gets the egress_port of this Connection.
:return: The egress_port of this Connection. # noqa: E501
:return: The egress_port of this Connection.
:rtype: Port
"""
return self._egress_port
Expand Down Expand Up @@ -197,10 +193,10 @@ def set_egress_port(self, egress_port: Port) -> Port:

@property
def quantity(self):
"""Gets the quantity of this Connection. # noqa: E501
"""Gets the quantity of this Connection.
:return: The quantity of this Connection. # noqa: E501
:return: The quantity of this Connection.
:rtype: int
"""
return self._quantity
Expand All @@ -210,18 +206,18 @@ def quantity(self, quantity):
"""Sets the quantity of this Connection.
:param quantity: The quantity of this Connection. # noqa: E501
:param quantity: The quantity of this Connection.
:type: int
"""

self._quantity = quantity

@property
def bandwidth(self):
"""Gets the quantity of this Connection. # noqa: E501
"""Gets the quantity of this Connection.
:return: The quantity of this Connection. # noqa: E501
:return: The quantity of this Connection.
:rtype: float
"""
return self._bandwidth
Expand All @@ -230,18 +226,18 @@ def set_bandwidth(self, bw):
"""Sets the bw of this Connection.
:param bw: The bw of this Connection. # noqa: E501
:param bw: The bw of this Connection.
:type: float
"""

self._bandwidth = bw

@property
def latency(self):
"""Gets the latency of this Connection. # noqa: E501
"""Gets the latency of this Connection.
:return: The latency of this Connection. # noqa: E501
:return: The latency of this Connection.
:rtype: float
"""
return self._latency
Expand All @@ -250,18 +246,18 @@ def set_latency(self, latency):
"""Sets the latency of this Connection.
:param bw: The latency of this Connection. # noqa: E501
:param bw: The latency of this Connection.
:type: float
"""

self._latency = latency

@property
def start_time(self):
"""Gets the start_time of this Connection. # noqa: E501
"""Gets the start_time of this Connection.
:return: The start_time of this Connection. # noqa: E501
:return: The start_time of this Connection.
:rtype: datetime
"""
return self._start_time
Expand All @@ -271,18 +267,18 @@ def start_time(self, start_time):
"""Sets the start_time of this Connection.
:param start_time: The start_time of this Connection. # noqa: E501
:param start_time: The start_time of this Connection.
:type: datetime
"""

self._start_time = start_time

@property
def end_time(self):
"""Gets the end_time of this Connection. # noqa: E501
"""Gets the end_time of this Connection.
:return: The end_time of this Connection. # noqa: E501
:return: The end_time of this Connection.
:rtype: datetime
"""
return self._end_time
Expand All @@ -292,19 +288,19 @@ def end_time(self, end_time):
"""Sets the end_time of this Connection.
:param end_time: The end_time of this Connection. # noqa: E501
:param end_time: The end_time of this Connection.
:type: datetime
"""

self._end_time = end_time

@property
def status(self):
"""Gets the status of this Connection. # noqa: E501
"""Gets the status of this Connection.
Connection Status # noqa: E501
Connection Status
:return: The status of this Connection. # noqa: E501
:return: The status of this Connection.
:rtype: str
"""
return self._status
Expand All @@ -313,20 +309,20 @@ def status(self):
def status(self, status):
"""Sets the status of this Connection.
Connection Status # noqa: E501
Connection Status
:param status: The status of this Connection. # noqa: E501
:param status: The status of this Connection.
:type: str
"""
allowed_values = [
"success",
"fail",
"scheduled",
"provisioining",
] # noqa: E501
]
if status not in allowed_values:
raise ValueError(
"Invalid value for `status` ({0}), must be one of {1}".format( # noqa: E501
"Invalid value for `status` ({0}), must be one of {1}".format(
status, allowed_values
)
)
Expand Down
Loading

0 comments on commit db13129

Please sign in to comment.