diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2629a572..083289f6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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 @@ -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 diff --git a/prusa/link/web/connection.py b/prusa/link/web/connection.py index aa9e6749..0dba578d 100644 --- a/prusa/link/web/connection.py +++ b/prusa/link/web/connection.py @@ -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 diff --git a/ruff.toml b/ruff.toml index d840633b..b3b47d5f 100644 --- a/ruff.toml +++ b/ruff.toml @@ -1,4 +1,4 @@ -select = [ +lint.select = [ "F", # pyflakes "E", # pycodestyle "W", # pycodestyle @@ -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 @@ -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