Skip to content

Commit 1067e49

Browse files
committed
Linting fixes
1 parent e8de3eb commit 1067e49

File tree

6 files changed

+101
-91
lines changed

6 files changed

+101
-91
lines changed

.devcontainer/devcontainer.json

Lines changed: 50 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,56 @@
11
{
22
"image": "ludeeus/container:python-base-debian",
3-
"file_version": "2023.01.27",
3+
"file_version": "2023.02.14",
44
"postCreateCommand": "pip install -r requirements-dev.txt && pre-commit install && pre-commit install-hooks && pip install --editable .",
5-
"extensions": [
6-
"ms-python.vscode-pylance",
7-
"esbenp.prettier-vscode",
8-
"github.vscode-pull-request-github",
9-
"ryanluker.vscode-coverage-gutters",
10-
"janisdd.vscode-edit-csv",
11-
"mechatroner.rainbow-csv",
12-
"bungcip.better-toml",
13-
"donjayamanne.python-extension-pack",
14-
"marklarah.pre-commit-vscode",
15-
"jrebocho.vscode-random"
16-
],
17-
"settings": {
18-
"files.eol": "\n",
19-
"editor.tabSize": 4,
20-
"terminal.integrated.defaultProfile.linux": "bash",
21-
"terminal.integrated.profiles.linux": {
22-
"zsh": {
23-
"path": "/bin/bash"
5+
"customizations": {
6+
"vscode": {
7+
"extensions": [
8+
"ms-python.vscode-pylance",
9+
"esbenp.prettier-vscode",
10+
"github.vscode-pull-request-github",
11+
"ryanluker.vscode-coverage-gutters",
12+
"janisdd.vscode-edit-csv",
13+
"mechatroner.rainbow-csv",
14+
"bungcip.better-toml",
15+
"donjayamanne.python-extension-pack",
16+
"marklarah.pre-commit-vscode",
17+
"jrebocho.vscode-random"
18+
],
19+
"settings": {
20+
"files.eol": "\n",
21+
"editor.tabSize": 4,
22+
"terminal.integrated.defaultProfile.linux": "bash",
23+
"terminal.integrated.profiles.linux": {
24+
"zsh": {
25+
"path": "/bin/bash"
26+
}
27+
},
28+
"python.analysis.autoSearchPaths": false,
29+
"python.linting.pylintEnabled": true,
30+
"python.linting.enabled": true,
31+
"python.linting.pylintArgs": [
32+
"--disable",
33+
"import-error"
34+
],
35+
"python.formatting.provider": "black",
36+
"editor.formatOnPaste": false,
37+
"editor.formatOnSave": true,
38+
"editor.formatOnType": true,
39+
"files.trimTrailingWhitespace": false,
40+
"python.linting.mypyEnabled": true,
41+
"python.defaultInterpreterPath": "/usr/local/python/bin/python",
42+
"python.formatting.blackPath": "/usr/local/python/bin/black",
43+
"python.linting.banditPath": "/usr/local/python/bin/bandit",
44+
"python.linting.flake8Path": "/usr/local/python/bin/flake8",
45+
"python.linting.mypyPath": "/usr/local/python/bin/mypy",
46+
"python.linting.pycodestylePath": "/usr/local/python/bin/pycodestyle",
47+
"python.linting.pylintPath": "/usr/local/python/bin/pylint",
48+
"isort.path": [
49+
"/usr/local/python/bin/isort"
50+
],
51+
"python.pythonPath": "/usr/local/python/bin/python",
52+
"typescript.tsc.autoDetect": "off"
2453
}
25-
},
26-
"python.analysis.autoSearchPaths": false,
27-
"python.linting.pylintEnabled": true,
28-
"python.linting.enabled": true,
29-
"python.linting.pylintArgs": ["--disable", "import-error"],
30-
"python.formatting.provider": "black",
31-
"editor.formatOnPaste": false,
32-
"editor.formatOnSave": true,
33-
"editor.formatOnType": true,
34-
"python.linting.flake8Enabled": true,
35-
"files.trimTrailingWhitespace": true,
36-
"python.linting.mypyEnabled": true,
37-
"python.defaultInterpreterPath": "/usr/local/bin/python",
38-
"python.formatting.blackPath": "/usr/local/bin/black",
39-
"python.linting.banditPath": "/usr/local/bin/bandit",
40-
"python.linting.flake8Path": "/usr/local/bin/flake8",
41-
"python.linting.mypyPath": "/usr/local/bin/mypy",
42-
"python.linting.pycodestylePath": "/usr/local/bin/pycodestyle",
43-
"python.linting.pylintPath": "/usr/local/bin/pylint",
44-
"isort.path": ["/usr/local/bin/isort"],
45-
"python.linting.banditEnabled": true
54+
}
4655
}
4756
}

.flake8

Lines changed: 0 additions & 27 deletions
This file was deleted.

.pre-commit-config.yaml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# File Version: 2023.01.27
1+
# File Version: 2023.01.31
22

33
# https://pypi.org/project/python-typing-update/ doesn't work with python 3.10. Some of the below items seek to re-implement the typing-update flow.
44

@@ -12,16 +12,16 @@ repos:
1212
- id: pyupgrade
1313
args: [--py39-plus]
1414
- repo: https://github.com/PyCQA/isort
15-
rev: 5.11.4
15+
rev: 5.12.0
1616
hooks:
1717
- id: isort
1818
- repo: https://github.com/myint/autoflake/
19-
rev: v2.0.0
19+
rev: v2.0.1
2020
hooks:
2121
- id: autoflake
2222
files: ^((custom_components)/.+)?[^/]+\.py$
2323
- repo: https://github.com/psf/black
24-
rev: 22.12.0
24+
rev: 23.1.0
2525
hooks:
2626
- id: black
2727
args:
@@ -53,9 +53,7 @@ repos:
5353
args:
5454
- --quiet
5555
- --format=custom
56-
- -c
57-
- pyproject.toml
58-
additional_dependencies: ["bandit[toml]"]
56+
- --exclude=examples
5957
files: ^((custom_components)/.+)?[^/]+\.py$
6058
- repo: https://github.com/pre-commit/pre-commit-hooks
6159
rev: v4.4.0
@@ -67,7 +65,7 @@ repos:
6765
- id: check-json
6866
exclude: (.vscode|.devcontainer)
6967
- repo: https://github.com/pre-commit/mirrors-mypy
70-
rev: v0.991
68+
rev: v1.0.0
7169
hooks:
7270
- id: mypy
7371
additional_dependencies: [types-all]

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@
2626
"python.linting.mypyPath": "/usr/local/bin/mypy",
2727
"python.linting.pycodestylePath": "/usr/local/bin/pycodestyle",
2828
"python.linting.pylintPath": "/usr/local/bin/pylint",
29-
"isort.path": "/usr/local/bin/isort",
29+
"isort.path": ["/usr/local/bin/isort"],
3030
"python.linting.banditEnabled": true
3131
}
File renamed without changes.

pyproject.toml

Lines changed: 44 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
1-
# File Version: 2023.01.27
1+
# File Version: 2023.02.14
22

33
[build-system]
44
requires = ["setuptools", "wheel"]
55
build-backend = "setuptools.build_meta"
66

7+
[tool.autoflake]
8+
in-place = true
9+
check = false
10+
remove-all-unused-imports = true
11+
712
[tool.bandit]
8-
exclude_dirs = ["example.py", "setup.py"]
913
tests = [
1014
"B103",
1115
"B108",
@@ -34,25 +38,50 @@ exclude = 'generated'
3438
preview = "True"
3539

3640
[tool.flake8]
37-
exclude = [".venv", ".git", ".tox", "docs", "venv", "bin", "lib", "deps", "build"]
41+
exclude = [
42+
".venv",
43+
".git",
44+
".tox",
45+
"docs",
46+
"venv",
47+
"bin",
48+
"lib",
49+
"deps",
50+
"build"
51+
]
3852
doctests = true
3953
max-line-length = 88
4054
extend-ignore = ["E203"]
41-
ignore = ["E501", "W503", "E203", "D202", "W504", "A003", "E203", "E305", "E711", "E712", "E721", "E722", "E741", "F841", "N801", "N802", "N806", "W503", "W504"]
55+
ignore = [
56+
"E501",
57+
"W503",
58+
"E203",
59+
"D202",
60+
"W504",
61+
"A003",
62+
"E203",
63+
"E305",
64+
"E711",
65+
"E712",
66+
"E721",
67+
"E722",
68+
"E741",
69+
"F841",
70+
"N801",
71+
"N802",
72+
"N806",
73+
"W503",
74+
"W504"
75+
]
4276
import-order-style = "google"
4377
application-import-names = ["sqlalchemy", "test", "pylaundry"]
4478
enable-extensions = "G"
4579

4680
[tool.isort]
4781
profile = "black"
4882
force_sort_within_sections = true
49-
known_first_party = [
50-
"pylaundry",
51-
"tests"
52-
]
53-
forced_separate = [
54-
"tests"
55-
]
83+
known_first_party = ["pylaundry", "tests"]
84+
forced_separate = ["tests"]
5685
combine_as_imports = true
5786

5887
[tool.mypy]
@@ -77,16 +106,17 @@ warn_unreachable = true
77106
pretty = true
78107
show_absolute_path = true
79108
show_error_context = true
109+
no_untyped_call = false
80110

81111
[tool.pylint.BASIC]
82112
class-const-naming-style = "any"
83113
good-names = ["_", "ev", "ex", "fp", "i", "id", "j", "k", "Run", "ip"]
84114

85115
[tool.pylint.CODE_STYLE]
86-
max-line-length-suggestions = 72
116+
max-line-length-suggestions = 88
87117

88118
[tool.pylint.EXCEPTIONS]
89-
overgeneral-exceptions = ["BaseException", "Exception", "HomeAssistantError"]
119+
overgeneral-exceptions = ["builtins.BaseException", "builtins.Exception", "homeassistant.exceptions.HomeAssistantError"]
90120

91121
[tool.pylint.FORMAT]
92122
expected-line-ending-format = "LF"
@@ -133,7 +163,7 @@ score = false
133163

134164
[tool.pylint.TYPECHECK]
135165
ignored-classes = [
136-
"_CountingAttr" # for attrs
166+
"_CountingAttr"
137167
]
138168
mixin-class-rgx = ".*[Mm]ix[Ii]n"
139169

0 commit comments

Comments
 (0)