From 83ef92145cff63dadeb3b82bd2fa9ab4599f3acd Mon Sep 17 00:00:00 2001 From: Nathan Spencer Date: Thu, 29 Feb 2024 20:22:08 +0000 Subject: [PATCH] Update devcontainer to python 3.12 and replace linters/formatters with ruff --- .devcontainer/devcontainer.json | 17 +++++++---------- pyproject.toml | 15 ++++++--------- requirements.txt | 4 +--- 3 files changed, 14 insertions(+), 22 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 32756f9..2f0e664 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,7 +1,7 @@ // See https://aka.ms/vscode-remote/devcontainer.json for format details. { "name": "Home Assistant integration development", - "image": "mcr.microsoft.com/vscode/devcontainers/python:0-3.11-bullseye", + "image": "mcr.microsoft.com/devcontainers/python:1-3.12-bullseye", "postCreateCommand": ".devcontainer/setup", "postAttachCommand": ".devcontainer/setup", "forwardPorts": [8123], @@ -9,27 +9,24 @@ "vscode": { "extensions": [ "ms-python.python", - "ms-python.black-formatter", - "ms-python.isort", - "ms-python.pylint", "ms-python.vscode-pylance", "esbenp.prettier-vscode", "github.vscode-pull-request-github", - "ryanluker.vscode-coverage-gutters" + "ryanluker.vscode-coverage-gutters", + "charliermarsh.ruff" ], "settings": { "files.eol": "\n", "editor.tabSize": 4, "python.pythonPath": "/usr/bin/python3", "python.analysis.autoSearchPaths": false, - "python.formatting.provider": "black", "editor.formatOnPaste": false, "editor.formatOnSave": true, "editor.formatOnType": true, - "editor.codeActionsOnSave": { - "source.organizeImports": true - }, - "files.trimTrailingWhitespace": true + "files.trimTrailingWhitespace": true, + "[python]": { + "editor.defaultFormatter": "charliermarsh.ruff" + } } } }, diff --git a/pyproject.toml b/pyproject.toml index 24632fd..9bc4496 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,9 +1,6 @@ - -[tool.isort] -# https://pycqa.github.io/isort/docs/configuration/options.html -profile = "black" -# will group `import x` and `from x import` of the same module. -force_sort_within_sections = true -known_first_party = ["homeassistant", "tests"] -forced_separate = ["tests"] -combine_as_imports = true +[tool.ruff.lint.isort] +force-sort-within-sections = true +known-first-party = ["homeassistant", "tests"] +forced-separate = ["tests"] +combine-as-imports = true +split-on-trailing-comma = false diff --git a/requirements.txt b/requirements.txt index e1865e5..2827cee 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,8 +9,6 @@ deepdiff ical # Development -black colorlog==6.7.0 pip>=21.0 -pylint>=2.17.3 -ruff==0.0.255 +ruff==0.2.2