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

Python3 deploy action mypy to review this pr #7

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

bernhardkaindl
Copy link
Collaborator

No description provided.

stephenchengCloud and others added 2 commits January 29, 2024 09:40
Signed-off-by: Stephen Cheng <stephen.cheng@cloud.com>
Signed-off-by: Bernhard Kaindl <bernhardkaindl7@gmail.com>
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit

pylint

scripts/test_hfx_filename.py|76| C0301: Line too long (107/100) (line-too-long)
scripts/test_hfx_filename.py|79| C0303: Trailing whitespace (trailing-whitespace)
scripts/test_hfx_filename.py|83| C0303: Trailing whitespace (trailing-whitespace)
scripts/test_hfx_filename.py|87| C0303: Trailing whitespace (trailing-whitespace)
scripts/test_hfx_filename.py|89| C0301: Line too long (106/100) (line-too-long)
scripts/test_hfx_filename.py|92| C0303: Trailing whitespace (trailing-whitespace)
scripts/test_hfx_filename.py|96| C0303: Trailing whitespace (trailing-whitespace)
scripts/test_hfx_filename.py|97| C0303: Trailing whitespace (trailing-whitespace)
scripts/test_hfx_filename.py|100| C0303: Trailing whitespace (trailing-whitespace)
scripts/test_hfx_filename.py|101 col 32| C0303: Trailing whitespace (trailing-whitespace)
scripts/test_hfx_filename.py|102 col 101| C0303: Trailing whitespace (trailing-whitespace)
scripts/test_hfx_filename.py|102| C0301: Line too long (101/100) (line-too-long)
scripts/test_hfx_filename.py|106| C0303: Trailing whitespace (trailing-whitespace)
scripts/test_hfx_filename.py|1| C0114: Missing module docstring (missing-module-docstring)
scripts/test_hfx_filename.py|7| E0401: Unable to import 'mock' (import-error)
scripts/test_hfx_filename.py|19| C0115: Missing class docstring (missing-class-docstring)
scripts/test_hfx_filename.py|21 col 4| C0116: Missing function or method docstring (missing-function-docstring)
scripts/test_hfx_filename.py|45 col 4| C0116: Missing function or method docstring (missing-function-docstring)
scripts/test_hfx_filename.py|71 col 4| C0116: Missing function or method docstring (missing-function-docstring)
scripts/test_hfx_filename.py|84 col 4| C0116: Missing function or method docstring (missing-function-docstring)
scripts/test_hfx_filename.py|99| C0115: Missing class docstring (missing-class-docstring)
scripts/test_hfx_filename.py|101 col 4| C0116: Missing function or method docstring (missing-function-docstring)
scripts/test_hfx_filename.py|8| C0411: standard import "import sys" should be placed before "from mock import MagicMock, patch, call" (wrong-import-order)
scripts/test_perfmon.py|6| E0401: Unable to import 'mock' (import-error)
scripts/test_perfmon.py|17| C0115: Missing class docstring (missing-class-docstring)
scripts/test_perfmon.py|7| C0411: standard import "import sys" should be placed before "from mock import MagicMock, patch" (wrong-import-order)
scripts/test_perfmon.py|8| C0411: standard import "import math" should be placed before "from mock import MagicMock, patch" (wrong-import-order)
scripts/test_static_vdis.py|17 col 70| C0303: Trailing whitespace (trailing-whitespace)
scripts/test_static_vdis.py|6| E0401: Unable to import 'mock' (import-error)
scripts/test_static_vdis.py|18| C0115: Missing class docstring (missing-class-docstring)
scripts/test_static_vdis.py|7| C0411: standard import "import sys" should be placed before "from mock import MagicMock" (wrong-import-order)
scripts/test_static_vdis.py|8| C0411: standard import "import tempfile" should be placed before "from mock import MagicMock" (wrong-import-order)

s.send("%s\r\n" % h)
#print "%s\r\n" % h,
s.send(request)
s.send((h + "\r\n").encode('utf-8'))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pylint] reported by reviewdog 🐶
W0311: Bad indentation. Found 10 spaces, expected 12 (bad-indentation)

result = s.recv(1024)
#print "Received HTTP response:"
#print result
result = s.recv(1024).decode('utf-8')
if "200 OK" not in result:
print("Expected an HTTP 200, got %s" % result, file=sys.stderr)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pylint] reported by reviewdog 🐶
W0311: Bad indentation. Found 10 spaces, expected 12 (bad-indentation)

result = s.recv(1024)
#print "Received HTTP response:"
#print result
result = s.recv(1024).decode('utf-8')
if "200 OK" not in result:
print("Expected an HTTP 200, got %s" % result, file=sys.stderr)
return

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pylint] reported by reviewdog 🐶
W0311: Bad indentation. Found 10 spaces, expected 12 (bad-indentation)

@@ -28,18 +28,14 @@
headers = [
"POST %s?session_id=%s HTTP/1.0" % (db_url, session_id),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pylint] reported by reviewdog 🐶
C0209: Formatting a regular string which could be an f-string (consider-using-f-string)

@@ -28,18 +28,14 @@
headers = [
"POST %s?session_id=%s HTTP/1.0" % (db_url, session_id),
"Connection:close",
"content-length:%d" % (len(request)),
"content-length:%d" % (len(request.encode('utf-8'))),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pylint] reported by reviewdog 🐶
C0209: Formatting a regular string which could be an f-string (consider-using-f-string)

def test_rpc_international_character(self, mock_socket):
mock_connected_socket = MagicMock()
mock_socket.return_value = mock_connected_socket

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pylint] reported by reviewdog 🐶
C0303: Trailing whitespace (trailing-whitespace)

# Not using literal string is for passing python2 check
request = "socket 请求"
body = hfx_filename.rpc(session_id, request)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pylint] reported by reviewdog 🐶
C0303: Trailing whitespace (trailing-whitespace)

request.encode('utf-8')
]
mock_connected_socket.send.assert_has_calls([call(data) for data in expected_data])

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pylint] reported by reviewdog 🐶
C0303: Trailing whitespace (trailing-whitespace)


expected_return = "HelloWorld"
self.assertEqual(expected_return, body)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pylint] reported by reviewdog 🐶
C0303: Trailing whitespace (trailing-whitespace)

def test_db_get_uuid(self, mock_socket):
mock_connected_socket = MagicMock()
mock_socket.return_value = mock_connected_socket

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pylint] reported by reviewdog 🐶
C0303: Trailing whitespace (trailing-whitespace)

@bernhardkaindl bernhardkaindl force-pushed the python3-deploy-action-mypy-to-review-this-PR branch from de4c2f6 to 1a67701 Compare January 30, 2024 07:56
@@ -380,7 +380,7 @@ def get_percent_mem_usage(ignored):
memlist = memfd.readlines()
memfd.close()
memdict = [ m.split(':', 1) for m in memlist ]
memdict = dict([(k.strip(), float(re.search('\d+', v.strip()).group(0))) for (k,v) in memdict])
memdict = dict([(k.strip(), float(re.search(r'\d+', v.strip()).group(0))) for (k,v) in memdict])

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [mypy] reported by reviewdog 🐶
Incompatible types in assignment (expression has type "Dict[str, float]", variable has type "List[List[str]]") [assignment]

@@ -380,7 +380,7 @@
memlist = memfd.readlines()
memfd.close()
memdict = [ m.split(':', 1) for m in memlist ]
memdict = dict([(k.strip(), float(re.search('\d+', v.strip()).group(0))) for (k,v) in memdict])
memdict = dict([(k.strip(), float(re.search(r'\d+', v.strip()).group(0))) for (k,v) in memdict])

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [mypy] reported by reviewdog 🐶
Item "None" of "Optional[Match[str]]" has no attribute "group" [union-attr]

@bernhardkaindl bernhardkaindl force-pushed the python3-deploy-action-mypy-to-review-this-PR branch 3 times, most recently from 1c5239a to 51dd206 Compare January 30, 2024 08:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants