Skip to content

Commit

Permalink
Merge branch 'master' into new-web-config
Browse files Browse the repository at this point in the history
  • Loading branch information
ondratu authored Apr 10, 2024
2 parents c55b546 + 4aaa89d commit 7d20d87
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ repos:
# hooks:
# - id: yapf
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
rev: v4.6.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
Expand All @@ -15,11 +15,11 @@ repos:
# hooks:
# - id: pylint
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: 'v0.0.280'
rev: 'v0.3.5'
hooks:
- id: ruff
args: [--fix]
- repo: https://gitlab.com/pycqa/flake8
rev: 3.9.2
- repo: https://github.com/pycqa/flake8
rev: 7.0.0
hooks:
- id: flake8
7 changes: 3 additions & 4 deletions prusa/link/web/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,16 +103,15 @@ def api_connection_set(req):
port = connect.get('port')
tls = bool(connect.get('tls'))

connect_url = Printer.connect_url(hostname, tls, port)

try:
gethostbyname(hostname)
except Exception as exc: # pylint: disable=broad-except
raise conditions.CantResolveHostname() from exc
url = printer.connect_url(hostname, tls, port)

connect_url = Printer.connect_url(hostname, tls, port)

try:
with urlopen(f'{url}/info'):
with urlopen(f'{connect_url}/info'):
pass
except Exception as exc: # pylint: disable=broad-except
raise conditions.CantConnect() from exc
Expand Down
6 changes: 3 additions & 3 deletions ruff.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
select = [
lint.select = [
"F", # pyflakes
"E", # pycodestyle
"W", # pycodestyle
Expand Down Expand Up @@ -29,7 +29,7 @@ select = [
"T20", # flake8-print
"PYI", # flake8-pyi
"PT", # flake8-pytest-style
"Q", # flake8-quotes
# "Q", # flake8-quotes - error in version 0.3.5 https://github.com/astral-sh/ruff/issues/10724
"RSE", # flake8-raise
"RET", # flake8-return
"SLF", # flake8-self
Expand All @@ -48,7 +48,7 @@ select = [
"NPY", # NumPy-specific rules
"RUF", # Ruff-specific rules
]
ignore = [
lint.ignore = [
"S101", # Use of `assert` detected
"S105", # Possible hardcoded password assigned to: "TOKEN"
"Q000", # Single quotes found but double quotes preferred
Expand Down

0 comments on commit 7d20d87

Please sign in to comment.