2022-01-28 22:09:05 +00:00
[ build-system ]
2024-04-08 09:18:20 +00:00
requires = [ "setuptools==69.2.0" , "wheel~=0.43.0" ]
2022-01-28 22:09:05 +00:00
build-backend = "setuptools.build_meta"
2022-05-25 02:01:27 +00:00
[ project ]
name = "homeassistant"
2024-04-24 21:16:48 +00:00
version = "2024.6.0.dev0"
2022-05-25 02:01:27 +00:00
license = { text = "Apache-2.0" }
description = "Open-source home automation platform running on Python 3."
readme = "README.rst"
authors = [
2022-05-26 00:54:49 +00:00
{ name = "The Home Assistant Authors" , email = "hello@home-assistant.io" }
2022-05-25 02:01:27 +00:00
]
keywords = [ "home" , "automation" ]
classifiers = [
"Development Status :: 5 - Production/Stable" ,
"Intended Audience :: End Users/Desktop" ,
"Intended Audience :: Developers" ,
"License :: OSI Approved :: Apache Software License" ,
"Operating System :: OS Independent" ,
2024-03-26 11:51:14 +00:00
"Programming Language :: Python :: 3.12" ,
2022-05-25 02:01:27 +00:00
"Topic :: Home Automation" ,
]
2024-03-26 11:51:14 +00:00
requires-python = ">=3.12.0"
2022-05-26 00:54:49 +00:00
dependencies = [
2024-04-06 03:15:51 +00:00
"aiodns==3.2.0" ,
2024-04-17 07:10:06 +00:00
"aiohttp==3.9.5" ,
2023-11-02 20:18:12 +00:00
"aiohttp_cors==0.7.0" ,
2024-04-12 12:47:46 +00:00
"aiohttp_session==2.12.0" ,
2023-11-27 15:04:04 +00:00
"aiohttp-fast-url-dispatcher==0.3.0" ,
2024-05-05 21:06:12 +00:00
"aiohttp-fast-zlib==0.1.0" ,
2022-05-26 00:54:49 +00:00
"astral==2.2" ,
2024-02-21 02:57:36 +00:00
"async-interrupt==1.1.1" ,
2024-01-30 11:22:41 +00:00
"attrs==23.2.0" ,
2022-07-08 21:17:56 +00:00
"atomicwrites-homeassistant==1.4.1" ,
2024-02-06 20:57:00 +00:00
"awesomeversion==24.2.0" ,
2024-02-25 21:22:50 +00:00
"bcrypt==4.1.2" ,
2022-05-26 00:54:49 +00:00
"certifi>=2021.5.30" ,
2024-02-25 20:59:00 +00:00
"ciso8601==2.3.1" ,
2024-03-04 08:03:30 +00:00
"fnv-hash-fast==0.5.0" ,
2024-03-07 16:11:45 +00:00
# hass-nabucasa is imported by helpers which don't depend on the cloud
# integration
2024-04-07 12:20:58 +00:00
"hass-nabucasa==0.78.0" ,
2022-05-26 00:54:49 +00:00
# When bumping httpx, please check the version pins of
# httpcore, anyio, and h11 in gen_requirements_all
2024-02-27 23:15:33 +00:00
"httpx==0.27.0" ,
2024-01-12 08:45:49 +00:00
"home-assistant-bluetooth==1.12.0" ,
2023-05-23 12:18:26 +00:00
"ifaddr==0.2.0" ,
2024-01-15 11:10:17 +00:00
"Jinja2==3.1.3" ,
2023-12-17 23:16:31 +00:00
"lru-dict==1.3.0" ,
2023-07-19 12:35:54 +00:00
"PyJWT==2.8.0" ,
2022-05-26 00:54:49 +00:00
# PyJWT has loose dependency. We want the latest one.
2024-02-24 07:49:46 +00:00
"cryptography==42.0.5" ,
2024-04-13 16:26:33 +00:00
"Pillow==10.3.0" ,
2024-03-25 10:15:47 +00:00
"pyOpenSSL==24.1.0" ,
2024-04-25 16:15:57 +00:00
"orjson==3.9.15" ,
2023-08-04 10:29:18 +00:00
"packaging>=23.1" ,
2023-07-17 22:37:02 +00:00
"pip>=21.3.1" ,
2024-03-04 08:03:30 +00:00
"psutil-home-assistant==0.0.1" ,
2024-02-27 11:29:48 +00:00
"python-slugify==8.0.4" ,
2023-07-18 06:50:15 +00:00
"PyYAML==6.0.1" ,
2023-05-22 18:48:56 +00:00
"requests==2.31.0" ,
2024-03-26 00:39:16 +00:00
"SQLAlchemy==2.0.29" ,
2024-04-06 12:23:32 +00:00
"typing-extensions>=4.11.0,<5.0" ,
2023-10-20 14:49:18 +00:00
"ulid-transform==0.9.0" ,
2024-01-02 12:34:19 +00:00
# Constrain urllib3 to ensure we deal with CVE-2020-26137 and CVE-2021-33503
# Temporary setting an upper bound, to prevent compat issues with urllib3>=2
# https://github.com/home-assistant/core/issues/97248
"urllib3>=1.26.5,<2" ,
2022-05-26 00:54:49 +00:00
"voluptuous==0.13.1" ,
2023-02-15 22:14:45 +00:00
"voluptuous-serialize==2.6.0" ,
2023-12-08 11:11:59 +00:00
"yarl==1.9.4" ,
2022-05-26 00:54:49 +00:00
]
2022-05-25 02:01:27 +00:00
[ project . urls ]
2023-06-26 17:03:56 +00:00
"Homepage" = "https://www.home-assistant.io/"
2022-05-25 02:01:27 +00:00
"Source Code" = "https://github.com/home-assistant/core"
"Bug Reports" = "https://github.com/home-assistant/core/issues"
"Docs: Dev" = "https://developers.home-assistant.io/"
"Discord" = "https://www.home-assistant.io/join-chat/"
"Forum" = "https://community.home-assistant.io/"
[ project . scripts ]
hass = "homeassistant.__main__:main"
[ tool . setuptools ]
platforms = [ "any" ]
zip-safe = false
include-package-data = true
[ tool . setuptools . packages . find ]
include = [ "homeassistant*" ]
2022-06-06 19:43:47 +00:00
[ tool . pylint . MAIN ]
2024-03-26 11:51:14 +00:00
py-version = "3.12"
2020-10-06 09:26:48 +00:00
ignore = [
"tests" ,
]
# Use a conservative default here; 2 should speed up most setups and not hurt
# any too bad. Override on command line as appropriate.
2021-03-01 12:40:46 +00:00
jobs = 2
2022-01-29 22:47:40 +00:00
init-hook = "" " \
from pathlib import Path ; \
import sys ; \
from pylint . config import find_default_config_files ; \
sys . path . append ( \
str ( Path ( next ( find_default_config_files ( ) ) ) . parent . joinpath ( 'pylint/plugins' ) )
) \
"" "
2020-10-06 09:26:48 +00:00
load-plugins = [
2021-07-19 13:57:06 +00:00
"pylint.extensions.code_style" ,
2021-04-25 00:39:24 +00:00
"pylint.extensions.typing" ,
2024-01-29 09:30:19 +00:00
"hass_enforce_coordinator_module" ,
2024-01-16 08:47:53 +00:00
"hass_enforce_sorted_platforms" ,
2023-09-18 18:39:36 +00:00
"hass_enforce_super_call" ,
2022-01-24 12:38:56 +00:00
"hass_enforce_type_hints" ,
2023-05-24 10:49:35 +00:00
"hass_inheritance" ,
2021-05-22 08:15:30 +00:00
"hass_imports" ,
2021-05-20 17:00:10 +00:00
"hass_logger" ,
2023-01-22 16:26:24 +00:00
"pylint_per_file_ignores" ,
2020-10-06 09:26:48 +00:00
]
persistent = false
2021-07-10 20:58:37 +00:00
extension-pkg-allow-list = [
"av.audio.stream" ,
2023-09-12 17:38:11 +00:00
"av.logging" ,
2021-07-10 20:58:37 +00:00
"av.stream" ,
2020-10-06 09:26:48 +00:00
"ciso8601" ,
2022-06-22 19:59:51 +00:00
"orjson" ,
2020-10-06 09:26:48 +00:00
"cv2" ,
]
2022-07-04 21:04:56 +00:00
fail-on = [
"I" ,
]
2020-10-06 09:26:48 +00:00
[ tool . pylint . BASIC ]
2021-03-30 04:02:56 +00:00
class-const-naming-style = "any"
2020-10-06 09:26:48 +00:00
[ tool . pylint . "MESSAGES CONTROL" ]
# Reasons disabled:
2023-11-27 20:42:11 +00:00
# format - handled by ruff
2020-10-06 09:26:48 +00:00
# locally-disabled - it spams too much
# duplicate-code - unavoidable
# cyclic-import - doesn't test if both import on load
# abstract-class-little-used - prevents from setting right foundation
# unused-argument - generic callbacks and setup methods create a lot of warnings
# too-many-* - are not enforced for the sake of readability
# too-few-* - same as too-many-*
# abstract-method - with intro of async there are always methods missing
# inconsistent-return-statements - doesn't handle raise
# too-many-ancestors - it's too strict.
# wrong-import-order - isort guards this
2021-09-18 11:52:59 +00:00
# consider-using-f-string - str.format sometimes more readable
2021-07-19 13:57:06 +00:00
# ---
2023-02-02 11:49:01 +00:00
# Pylint CodeStyle plugin
# consider-using-namedtuple-or-dataclass - too opinionated
# consider-using-assignment-expr - decision to use := better left to devs
2020-10-06 09:26:48 +00:00
disable = [
"format" ,
"abstract-method" ,
"cyclic-import" ,
"duplicate-code" ,
"inconsistent-return-statements" ,
"locally-disabled" ,
"not-context-manager" ,
"too-few-public-methods" ,
"too-many-ancestors" ,
"too-many-arguments" ,
"too-many-instance-attributes" ,
"too-many-lines" ,
"too-many-locals" ,
"too-many-public-methods" ,
"too-many-boolean-expressions" ,
"wrong-import-order" ,
2021-09-18 11:52:59 +00:00
"consider-using-f-string" ,
2021-07-19 13:57:06 +00:00
"consider-using-namedtuple-or-dataclass" ,
2021-09-18 11:52:59 +00:00
"consider-using-assignment-expr" ,
2023-06-27 15:42:46 +00:00
# Handled by ruff
# Ref: <https://github.com/astral-sh/ruff/issues/970>
"await-outside-async" , # PLE1142
"bad-str-strip-call" , # PLE1310
"bad-string-format-type" , # PLE1307
"bidirectional-unicode" , # PLE2502
"continue-in-finally" , # PLE0116
"duplicate-bases" , # PLE0241
"format-needs-mapping" , # F502
"function-redefined" , # F811
2024-01-05 10:46:45 +00:00
# Needed because ruff does not understand type of __all__ generated by a function
# "invalid-all-format", # PLE0605
2023-06-27 15:42:46 +00:00
"invalid-all-object" , # PLE0604
"invalid-character-backspace" , # PLE2510
"invalid-character-esc" , # PLE2513
"invalid-character-nul" , # PLE2514
"invalid-character-sub" , # PLE2512
"invalid-character-zero-width-space" , # PLE2515
2023-06-30 13:00:15 +00:00
"logging-too-few-args" , # PLE1206
2023-06-27 15:42:46 +00:00
"logging-too-many-args" , # PLE1205
"missing-format-string-key" , # F524
"mixed-format-string" , # F506
"no-method-argument" , # N805
"no-self-argument" , # N805
"nonexistent-operator" , # B002
"nonlocal-without-binding" , # PLE0117
"not-in-loop" , # F701, F702
"notimplemented-raised" , # F901
"return-in-init" , # PLE0101
"return-outside-function" , # F706
"syntax-error" , # E999
"too-few-format-args" , # F524
"too-many-format-args" , # F522
"too-many-star-expressions" , # F622
"truncated-format-string" , # F501
"undefined-all-variable" , # F822
"undefined-variable" , # F821
"used-prior-global-declaration" , # PLE0118
"yield-inside-async-function" , # PLE1700
"yield-outside-function" , # F704
"anomalous-backslash-in-string" , # W605
"assert-on-string-literal" , # PLW0129
"assert-on-tuple" , # F631
"bad-format-string" , # W1302, F
"bad-format-string-key" , # W1300, F
"bare-except" , # E722
"binary-op-exception" , # PLW0711
"cell-var-from-loop" , # B023
# "dangerous-default-value", # B006, ruff catches new occurrences, needs more work
"duplicate-except" , # B014
"duplicate-key" , # F601
"duplicate-string-formatting-argument" , # F
"duplicate-value" , # F
2024-02-06 14:41:34 +00:00
"eval-used" , # S307
2023-06-27 15:42:46 +00:00
"exec-used" , # S102
2024-03-17 09:58:14 +00:00
"expression-not-assigned" , # B018
2023-06-27 15:42:46 +00:00
"f-string-without-interpolation" , # F541
"forgotten-debug-statement" , # T100
"format-string-without-interpolation" , # F
# "global-statement", # PLW0603, ruff catches new occurrences, needs more work
"global-variable-not-assigned" , # PLW0602
"implicit-str-concat" , # ISC001
"import-self" , # PLW0406
"inconsistent-quotes" , # Q000
"invalid-envvar-default" , # PLW1508
"keyword-arg-before-vararg" , # B026
"logging-format-interpolation" , # G
"logging-fstring-interpolation" , # G
"logging-not-lazy" , # G
"misplaced-future" , # F404
"named-expr-without-context" , # PLW0131
"nested-min-max" , # PLW3301
2024-03-17 09:58:14 +00:00
"pointless-statement" , # B018
2024-02-06 14:41:34 +00:00
"raise-missing-from" , # B904
2024-04-21 21:25:27 +00:00
"redefined-builtin" , # A001
2023-06-27 15:42:46 +00:00
"try-except-raise" , # TRY302
"unused-argument" , # ARG001, we don't use it
"unused-format-string-argument" , #F507
"unused-format-string-key" , # F504
"unused-import" , # F401
"unused-variable" , # F841
"useless-else-on-loop" , # PLW0120
"wildcard-import" , # F403
"bad-classmethod-argument" , # N804
"consider-iterating-dictionary" , # SIM118
"empty-docstring" , # D419
"invalid-name" , # N815
"line-too-long" , # E501, disabled globally
"missing-class-docstring" , # D101
"missing-final-newline" , # W292
"missing-function-docstring" , # D103
"missing-module-docstring" , # D100
"multiple-imports" , #E401
"singleton-comparison" , # E711, E712
2023-08-19 12:17:17 +00:00
"subprocess-run-check" , # PLW1510
2023-06-27 15:42:46 +00:00
"superfluous-parens" , # UP034
"ungrouped-imports" , # I001
"unidiomatic-typecheck" , # E721
"unnecessary-direct-lambda-call" , # PLC3002
"unnecessary-lambda-assignment" , # PLC3001
2024-03-16 21:04:58 +00:00
"unnecessary-pass" , # PIE790
2023-06-27 15:42:46 +00:00
"unneeded-not" , # SIM208
"useless-import-alias" , # PLC0414
"wrong-import-order" , # I001
"wrong-import-position" , # E402
"comparison-of-constants" , # PLR0133
"comparison-with-itself" , # PLR0124
"consider-alternative-union-syntax" , # UP007
"consider-merging-isinstance" , # PLR1701
"consider-using-alias" , # UP006
"consider-using-dict-comprehension" , # C402
"consider-using-generator" , # C417
"consider-using-get" , # SIM401
"consider-using-set-comprehension" , # C401
"consider-using-sys-exit" , # PLR1722
"consider-using-ternary" , # SIM108
"literal-comparison" , # F632
"property-with-parameters" , # PLR0206
"super-with-arguments" , # UP008
"too-many-branches" , # PLR0912
"too-many-return-statements" , # PLR0911
"too-many-statements" , # PLR0915
"trailing-comma-tuple" , # COM818
"unnecessary-comprehension" , # C416
"use-a-generator" , # C417
"use-dict-literal" , # C406
"use-list-literal" , # C405
"useless-object-inheritance" , # UP004
"useless-return" , # PLR1711
2024-03-31 09:30:59 +00:00
"no-else-break" , # RET508
"no-else-continue" , # RET507
"no-else-raise" , # RET506
"no-else-return" , # RET505
2023-09-13 06:14:01 +00:00
# "no-self-use", # PLR6301 # Optional plugin, not enabled
2023-06-27 15:42:46 +00:00
# Handled by mypy
# Ref: <https://github.com/antonagestam/pylint-mypy-overlap>
"abstract-class-instantiated" ,
"arguments-differ" ,
"assigning-non-slot" ,
"assignment-from-no-return" ,
"assignment-from-none" ,
"bad-exception-cause" ,
"bad-format-character" ,
"bad-reversed-sequence" ,
"bad-super-call" ,
"bad-thread-instantiation" ,
"catching-non-exception" ,
"comparison-with-callable" ,
"deprecated-class" ,
"dict-iter-missing-items" ,
"format-combined-specification" ,
"global-variable-undefined" ,
"import-error" ,
"inconsistent-mro" ,
"inherit-non-class" ,
"init-is-generator" ,
"invalid-class-object" ,
"invalid-enum-extension" ,
"invalid-envvar-value" ,
"invalid-format-returned" ,
"invalid-hash-returned" ,
"invalid-metaclass" ,
"invalid-overridden-method" ,
"invalid-repr-returned" ,
"invalid-sequence-index" ,
"invalid-slice-index" ,
"invalid-slots-object" ,
"invalid-slots" ,
"invalid-star-assignment-target" ,
"invalid-str-returned" ,
"invalid-unary-operand-type" ,
"invalid-unicode-codec" ,
"isinstance-second-argument-not-valid-type" ,
"method-hidden" ,
"misplaced-format-function" ,
"missing-format-argument-key" ,
"missing-format-attribute" ,
"missing-kwoa" ,
"no-member" ,
"no-value-for-parameter" ,
"non-iterator-returned" ,
"non-str-assignment-to-dunder-name" ,
"nonlocal-and-global" ,
"not-a-mapping" ,
"not-an-iterable" ,
"not-async-context-manager" ,
"not-callable" ,
"not-context-manager" ,
"overridden-final-method" ,
"raising-bad-type" ,
"raising-non-exception" ,
"redundant-keyword-arg" ,
"relative-beyond-top-level" ,
"self-cls-assignment" ,
"signature-differs" ,
"star-needs-assignment-target" ,
"subclassed-final-class" ,
"super-without-brackets" ,
"too-many-function-args" ,
"typevar-double-variance" ,
"typevar-name-mismatch" ,
"unbalanced-dict-unpacking" ,
"unbalanced-tuple-unpacking" ,
"unexpected-keyword-arg" ,
"unhashable-member" ,
"unpacking-non-sequence" ,
"unsubscriptable-object" ,
"unsupported-assignment-operation" ,
"unsupported-binary-operation" ,
"unsupported-delete-operation" ,
"unsupported-membership-test" ,
"used-before-assignment" ,
"using-final-decorator-in-unsupported-version" ,
"wrong-exception-operation" ,
2020-10-06 09:26:48 +00:00
]
enable = [
#"useless-suppression", # temporarily every now and then to clean them up
"use-symbolic-message-instead" ,
]
2024-02-08 16:40:30 +00:00
per-file-ignores = [
# hass-component-root-import: Tests test non-public APIs
# protected-access: Tests do often test internals a lot
# redefined-outer-name: Tests reference fixtures in the test function
"/tests/:hass-component-root-import,protected-access,redefined-outer-name" ,
]
2020-10-06 09:26:48 +00:00
[ tool . pylint . REPORTS ]
score = false
[ tool . pylint . TYPECHECK ]
ignored-classes = [
"_CountingAttr" , # for attrs
]
2021-11-25 23:13:27 +00:00
mixin-class-rgx = ".*[Mm]ix[Ii]n"
2020-10-06 09:26:48 +00:00
[ tool . pylint . FORMAT ]
expected-line-ending-format = "LF"
[ tool . pylint . EXCEPTIONS ]
overgeneral-exceptions = [
2023-02-02 11:49:01 +00:00
"builtins.BaseException" ,
"builtins.Exception" ,
# "homeassistant.exceptions.HomeAssistantError", # too many issues
2020-10-06 09:26:48 +00:00
]
2021-04-25 00:39:24 +00:00
[ tool . pylint . TYPING ]
runtime-typing = false
2021-09-18 11:52:59 +00:00
[ tool . pylint . CODE_STYLE ]
max-line-length-suggestions = 72
2020-10-06 09:26:48 +00:00
[ tool . pytest . ini_options ]
testpaths = [
"tests" ,
]
norecursedirs = [
".git" ,
"testing_config" ,
]
2022-04-05 08:10:16 +00:00
log_format = "%(asctime)s.%(msecs)03d %(levelname)-8s %(threadName)s %(name)s:%(filename)s:%(lineno)s %(message)s"
log_date_format = "%Y-%m-%d %H:%M:%S"
2022-11-29 21:36:36 +00:00
asyncio_mode = "auto"
2023-08-20 16:30:28 +00:00
filterwarnings = [
"error::sqlalchemy.exc.SAWarning" ,
# -- HomeAssistant - aiohttp
# Overwrite web.Application to pass a custom default argument to _make_request
"ignore:Inheritance class HomeAssistantApplication from web.Application is discouraged:DeprecationWarning" ,
# Hass wraps `ClientSession.close` to emit a warning if the session is closed accidentally
"ignore:Setting custom ClientSession.close attribute is discouraged:DeprecationWarning:homeassistant.helpers.aiohttp_client" ,
# Modify app state for testing
"ignore:Changing state of started or joined application is deprecated:DeprecationWarning:tests.components.http.test_ban" ,
# -- Tests
# Ignore custom pytest marks
"ignore:Unknown pytest.mark.disable_autouse_fixture:pytest.PytestUnknownMarkWarning:tests.components.met" ,
# -- design choice 3rd party
2023-12-22 13:52:31 +00:00
# https://github.com/gwww/elkm1/blob/2.2.6/elkm1_lib/util.py#L8-L19
2023-08-20 16:30:28 +00:00
"ignore:ssl.TLSVersion.TLSv1 is deprecated:DeprecationWarning:elkm1_lib.util" ,
2024-02-12 10:30:41 +00:00
# https://github.com/michaeldavie/env_canada/blob/v0.6.1/env_canada/ec_cache.py
2023-08-20 16:30:28 +00:00
"ignore:Inheritance class CacheClientSession from ClientSession is discouraged:DeprecationWarning:env_canada.ec_cache" ,
2024-02-12 10:30:41 +00:00
# https://github.com/allenporter/ical/pull/215
2024-03-22 22:58:27 +00:00
# https://github.com/allenporter/ical/blob/7.0.3/ical/util.py#L20-L22
2023-10-10 19:34:49 +00:00
"ignore:datetime.*utcnow\\(\\) is deprecated and scheduled for removal:DeprecationWarning:ical.util" ,
2024-03-22 22:58:27 +00:00
# https://github.com/bachya/regenmaschine/blob/2024.03.0/regenmaschine/client.py#L52
2023-08-20 16:30:28 +00:00
"ignore:ssl.TLSVersion.SSLv3 is deprecated:DeprecationWarning:regenmaschine.client" ,
# -- Setuptools DeprecationWarnings
# https://github.com/googleapis/google-cloud-python/issues/11184
# https://github.com/zopefoundation/meta/issues/194
"ignore:Deprecated call to `pkg_resources.declare_namespace\\(('google.*'|'pywinusb'|'repoze'|'xbox'|'zope')\\)`:DeprecationWarning:pkg_resources" ,
# -- tracked upstream / open PRs
2024-02-12 10:30:41 +00:00
# https://github.com/certbot/certbot/issues/9828 - v2.8.0
"ignore:X509Extension support in pyOpenSSL is deprecated. You should use the APIs in cryptography:DeprecationWarning:acme.crypto_util" ,
2023-10-10 19:34:49 +00:00
# https://github.com/influxdata/influxdb-client-python/issues/603 - v1.37.0
"ignore:datetime.*utcfromtimestamp\\(\\) is deprecated and scheduled for removal:DeprecationWarning:influxdb_client.client.write.point" ,
2023-08-20 16:30:28 +00:00
# https://github.com/beetbox/mediafile/issues/67 - v0.12.0
"ignore:'imghdr' is deprecated and slated for removal in Python 3.13:DeprecationWarning:mediafile" ,
2023-12-22 13:52:31 +00:00
# https://github.com/foxel/python_ndms2_client/issues/6 - v0.1.3
# https://github.com/foxel/python_ndms2_client/pull/8
2023-08-20 16:30:28 +00:00
"ignore:'telnetlib' is deprecated and slated for removal in Python 3.13:DeprecationWarning:ndms2_client.connection" ,
# -- fixed, waiting for release / update
2024-03-22 22:58:27 +00:00
# https://github.com/mkmer/AIOAladdinConnect/commit/8851fff4473d80d70ac518db2533f0fbef63b69c - >=0.2.0
2024-02-12 10:30:41 +00:00
"ignore:module 'sre_constants' is deprecated:DeprecationWarning:AIOAladdinConnect" ,
2023-12-22 13:52:31 +00:00
# https://github.com/bachya/aiopurpleair/pull/200 - >=2023.10.0
2023-10-10 19:34:49 +00:00
"ignore:datetime.*utcfromtimestamp\\(\\) is deprecated and scheduled for removal:DeprecationWarning:aiopurpleair.helpers.validators" ,
2024-03-22 22:58:27 +00:00
# https://github.com/DataDog/datadogpy/pull/290 - >=0.23.0
"ignore:invalid escape sequence:SyntaxWarning:.*datadog.dogstatsd.base" ,
2024-04-11 21:35:15 +00:00
# https://github.com/DataDog/datadogpy/pull/566/files - >=0.37.0
"ignore:pkg_resources is deprecated as an API:DeprecationWarning:datadog.util.compat" ,
2024-02-12 10:30:41 +00:00
# https://github.com/fwestenberg/devialet/pull/6 - >1.4.5
"ignore:datetime.*utcnow\\(\\) is deprecated and scheduled for removal:DeprecationWarning:devialet.devialet_api" ,
2023-09-03 11:04:01 +00:00
# https://github.com/jaraco/jaraco.abode/commit/9e3e789efc96cddcaa15f920686bbeb79a7469e0 - update jaraco.abode to >=5.1.0
"ignore:`jaraco.functools.call_aside` is deprecated, use `jaraco.functools.invoke` instead:DeprecationWarning:jaraco.abode.helpers.timeline" ,
2024-03-22 22:58:27 +00:00
# https://github.com/majuss/lupupy/pull/15 - >0.3.2
"ignore:\"is not\" with 'str' literal. Did you mean \"!=\"?:SyntaxWarning:.*lupupy.devices.alarm" ,
2023-10-09 19:07:16 +00:00
# https://github.com/nextcord/nextcord/pull/1095 - >2.6.1
"ignore:pkg_resources is deprecated as an API:DeprecationWarning:nextcord.health_check" ,
2024-02-12 10:30:41 +00:00
# https://github.com/eclipse/paho.mqtt.python/issues/653 - >=2.0.0
# https://github.com/eclipse/paho.mqtt.python/pull/665
"ignore:ssl.PROTOCOL_TLS is deprecated:DeprecationWarning:paho.mqtt.client" ,
2024-03-22 22:58:27 +00:00
# https://github.com/rytilahti/python-miio/pull/1809 - >=0.6.0.dev0
2023-10-10 19:34:49 +00:00
"ignore:datetime.*utcnow\\(\\) is deprecated and scheduled for removal:DeprecationWarning:miio.protocol" ,
"ignore:datetime.*utcnow\\(\\) is deprecated and scheduled for removal:DeprecationWarning:miio.miioprotocol" ,
# https://github.com/hunterjm/python-onvif-zeep-async/pull/51 - >3.1.12
"ignore:datetime.*utcnow\\(\\) is deprecated and scheduled for removal:DeprecationWarning:onvif.client" ,
2024-04-11 21:35:15 +00:00
# https://github.com/googleapis/python-pubsub/commit/060f00bcea5cd129be3a2d37078535cc97b4f5e8 - >=2.13.12
"ignore:pkg_resources is deprecated as an API:DeprecationWarning:google.pubsub_v1.services.publisher.client" ,
2024-03-22 22:58:27 +00:00
# https://github.com/okunishinishi/python-stringcase/commit/6a5c5bbd3fe5337862abc7fd0853a0f36e18b2e1 - >1.2.0
"ignore:invalid escape sequence:SyntaxWarning:.*stringcase" ,
2023-09-18 10:26:16 +00:00
# https://github.com/grahamwetzler/smart-meter-texas/pull/143 - >0.5.3
"ignore:ssl.OP_NO_SSL\\*/ssl.OP_NO_TLS\\* options are deprecated:DeprecationWarning:smart_meter_texas" ,
2024-04-11 21:35:15 +00:00
# https://github.com/timmo001/system-bridge-connector/pull/27 - >= 4.1.0
"ignore:pkg_resources is deprecated as an API:DeprecationWarning:systembridgeconnector.version" ,
# https://github.com/jschlyter/ttls/commit/d64f1251397b8238cf6a35bea64784de25e3386c - >=1.8.1
"ignore:pkg_resources is deprecated as an API:DeprecationWarning:ttls" ,
2023-12-22 13:52:31 +00:00
# https://github.com/mvantellingen/python-zeep/pull/1364 - >4.2.1
"ignore:'cgi' is deprecated and slated for removal in Python 3.13:DeprecationWarning:zeep.utils" ,
2023-08-20 16:30:28 +00:00
2024-04-11 21:35:15 +00:00
# -- fixed for Python 3.13
# https://github.com/rhasspy/wyoming/commit/e34af30d455b6f2bb9e5cfb25fad8d276914bc54 - >=1.4.2
"ignore:'audioop' is deprecated and slated for removal in Python 3.13:DeprecationWarning:wyoming.audio" ,
2023-09-03 11:04:01 +00:00
# -- other
# Locale changes might take some time to resolve upstream
2023-12-22 13:52:31 +00:00
"ignore:'locale.getdefaultlocale' is deprecated and slated for removal in Python 3.15:DeprecationWarning:micloud.micloud" ,
# https://github.com/protocolbuffers/protobuf - v4.25.1
2023-10-10 19:34:49 +00:00
"ignore:Type google._upb._message.(Message|Scalar)MapContainer uses PyType_Spec with a metaclass that has custom tp_new. .* Python 3.14:DeprecationWarning" ,
# https://github.com/MatsNl/pyatag/issues/11 - v0.3.7.1
"ignore:datetime.*utcnow\\(\\) is deprecated and scheduled for removal:DeprecationWarning:pyatag.gateway" ,
2023-12-22 13:52:31 +00:00
# https://github.com/lidatong/dataclasses-json/issues/328
# https://github.com/lidatong/dataclasses-json/pull/351
"ignore:The 'default' argument to fields is deprecated. Use 'dump_default' instead:DeprecationWarning:dataclasses_json.mm" ,
2024-02-12 10:30:41 +00:00
# https://pypi.org/project/emulated-roku/ - v0.2.1
# https://github.com/martonperei/emulated_roku
"ignore:loop argument is deprecated:DeprecationWarning:emulated_roku" ,
# https://github.com/thecynic/pylutron - v0.2.10
"ignore:setDaemon\\(\\) is deprecated, set the daemon attribute instead:DeprecationWarning:pylutron" ,
2023-09-18 10:26:16 +00:00
# Wrong stacklevel
# https://bugs.launchpad.net/beautifulsoup/+bug/2034451
2024-03-22 22:58:27 +00:00
"ignore:It looks like you're parsing an XML document using an HTML parser:UserWarning:html.parser" ,
2023-10-09 19:07:16 +00:00
# New in aiohttp - v3.9.0
"ignore:It is recommended to use web.AppKey instances for keys:UserWarning:(homeassistant|tests|aiohttp_cors)" ,
2024-03-22 22:58:27 +00:00
# - SyntaxWarnings
# https://pypi.org/project/aprslib/ - v0.7.2 - 2022-07-10
"ignore:invalid escape sequence:SyntaxWarning:.*aprslib.parsing.common" ,
# https://pypi.org/project/pyblackbird/ - v0.6 - 2023-03-15
# https://github.com/koolsb/pyblackbird/pull/9 -> closed
"ignore:invalid escape sequence:SyntaxWarning:.*pyblackbird" ,
2024-04-11 21:35:15 +00:00
# https://github.com/pkkid/python-plexapi/pull/1244 - v4.15.11 -> new issue same file
# https://github.com/pkkid/python-plexapi/pull/1370 -> Not fixed here
2024-03-22 22:58:27 +00:00
"ignore:invalid escape sequence:SyntaxWarning:.*plexapi.base" ,
# https://pypi.org/project/pyws66i/ - v1.1 - 2022-04-05
"ignore:invalid escape sequence:SyntaxWarning:.*pyws66i" ,
# https://pypi.org/project/sleekxmppfs/ - v1.4.1 - 2022-08-18
"ignore:invalid escape sequence:SyntaxWarning:.*sleekxmppfs.thirdparty.mini_dateutil" ,
2024-04-11 21:35:15 +00:00
# - pkg_resources
# https://pypi.org/project/aiomusiccast/ - v0.14.8 - 2023-03-20
"ignore:pkg_resources is deprecated as an API:DeprecationWarning:aiomusiccast" ,
# https://github.com/eavanvalkenburg/pysiaalarm/blob/v3.1.1/src/pysiaalarm/data/data.py#L7 - v3.1.1 - 2023-04-17
"ignore:pkg_resources is deprecated as an API:DeprecationWarning:pysiaalarm.data.data" ,
# https://pypi.org/project/pybotvac/ - v0.0.25 - 2024-04-11
"ignore:pkg_resources is deprecated as an API:DeprecationWarning:pybotvac.version" ,
# https://github.com/home-assistant-ecosystem/python-mystrom/blob/2.2.0/pymystrom/__init__.py#L10 - v2.2.0 - 2023-05-21
"ignore:pkg_resources is deprecated as an API:DeprecationWarning:pymystrom" ,
# https://pypi.org/project/velbus-aio/ - v2024.4.0
# https://github.com/Cereal2nd/velbus-aio/blob/2024.4.0/velbusaio/handler.py#L13
"ignore:pkg_resources is deprecated as an API:DeprecationWarning:velbusaio.handler" ,
# -- Python 3.13
# HomeAssistant
"ignore:'audioop' is deprecated and slated for removal in Python 3.13:DeprecationWarning:homeassistant.components.assist_pipeline.websocket_api" ,
# https://pypi.org/project/pylutron/ - v0.2.12 - 2024-02-12
# https://github.com/thecynic/pylutron/issues/89
"ignore:'telnetlib' is deprecated and slated for removal in Python 3.13:DeprecationWarning:pylutron" ,
# https://pypi.org/project/SpeechRecognition/ - v3.10.3 - 2024-03-30
# https://github.com/Uberi/speech_recognition/blob/3.10.3/speech_recognition/__init__.py#L7
"ignore:'aifc' is deprecated and slated for removal in Python 3.13:DeprecationWarning:speech_recognition" ,
# https://pypi.org/project/voip-utils/ - v0.1.0 - 2023-06-28
# https://github.com/home-assistant-libs/voip-utils/blob/v0.1.0/voip_utils/rtp_audio.py#L2
"ignore:'audioop' is deprecated and slated for removal in Python 3.13:DeprecationWarning:voip_utils.rtp_audio" ,
# -- Python 3.13 - unmaintained projects, last release about 2+ years
# https://pypi.org/project/pydub/ - v0.25.1 - 2021-03-10
"ignore:'audioop' is deprecated and slated for removal in Python 3.13:DeprecationWarning:pydub.utils" ,
# https://github.com/heathbar/plum-lightpad-python/issues/7 - v0.0.11 - 2018-10-16
"ignore:'telnetlib' is deprecated and slated for removal in Python 3.13:DeprecationWarning:plumlightpad.lightpad" ,
# https://pypi.org/project/pyws66i/ - v1.1 - 2022-04-05
# https://github.com/ssaenger/pyws66i/blob/v1.1/pyws66i/__init__.py#L2
"ignore:'telnetlib' is deprecated and slated for removal in Python 3.13:DeprecationWarning:pyws66i" ,
2023-09-03 11:04:01 +00:00
2023-08-20 16:30:28 +00:00
# -- unmaintained projects, last release about 2+ years
# https://pypi.org/project/agent-py/ - v0.0.23 - 2020-06-04
"ignore:with timeout\\(\\) is deprecated:DeprecationWarning:agent.a" ,
# https://pypi.org/project/aiomodernforms/ - v0.1.8 - 2021-06-27
"ignore:with timeout\\(\\) is deprecated:DeprecationWarning:aiomodernforms.modernforms" ,
2024-03-22 22:58:27 +00:00
# https://pypi.org/project/alarmdecoder/ - v1.13.11 - 2021-06-01
"ignore:invalid escape sequence:SyntaxWarning:.*alarmdecoder" ,
2023-08-20 16:30:28 +00:00
# https://pypi.org/project/directv/ - v0.4.0 - 2020-09-12
"ignore:with timeout\\(\\) is deprecated:DeprecationWarning:directv.directv" ,
2023-10-10 19:34:49 +00:00
"ignore:datetime.*utcnow\\(\\) is deprecated and scheduled for removal:DeprecationWarning:directv.models" ,
2023-08-20 16:30:28 +00:00
# https://pypi.org/project/foobot_async/ - v1.0.0 - 2020-11-24
"ignore:with timeout\\(\\) is deprecated:DeprecationWarning:foobot_async" ,
2024-04-11 21:35:15 +00:00
# https://pypi.org/project/habitipy/ - v0.3.0 - 2019-01-14
"ignore:pkg_resources is deprecated as an API:DeprecationWarning:habitipy.api" ,
# https://pypi.org/project/httpsig/ - v1.3.0 - 2018-11-28
"ignore:pkg_resources is deprecated as an API:DeprecationWarning:httpsig" ,
2023-10-10 19:34:49 +00:00
# https://pypi.org/project/influxdb/ - v5.3.1 - 2020-11-11 (archived)
"ignore:datetime.*utcfromtimestamp\\(\\) is deprecated and scheduled for removal:DeprecationWarning:influxdb.line_protocol" ,
2023-08-20 16:30:28 +00:00
# https://pypi.org/project/lark-parser/ - v0.12.0 - 2021-08-30 -> moved to `lark`
# https://pypi.org/project/commentjson/ - v0.9.0 - 2020-10-05
# https://github.com/vaidik/commentjson/issues/51
2023-09-18 10:26:16 +00:00
# https://github.com/vaidik/commentjson/pull/52
2023-08-20 16:30:28 +00:00
# Fixed upstream, commentjson depends on old version and seems to be unmaintained
"ignore:module '(sre_parse|sre_constants)' is deprecate:DeprecationWarning:lark.utils" ,
# https://pypi.org/project/lomond/ - v0.3.3 - 2018-09-21
"ignore:ssl.PROTOCOL_TLS is deprecated:DeprecationWarning:lomond.session" ,
2023-10-10 19:34:49 +00:00
# https://pypi.org/project/oauth2client/ - v4.1.3 - 2018-09-07 (archived)
"ignore:datetime.*utcnow\\(\\) is deprecated and scheduled for removal:DeprecationWarning:oauth2client.client" ,
2024-03-22 22:58:27 +00:00
# https://pypi.org/project/opuslib/ - v3.0.1 - 2018-01-16
"ignore:\"is not\" with 'int' literal. Did you mean \"!=\"?:SyntaxWarning:.*opuslib.api.decoder" ,
2023-08-20 16:30:28 +00:00
# https://pypi.org/project/passlib/ - v1.7.4 - 2020-10-08
"ignore:'crypt' is deprecated and slated for removal in Python 3.13:DeprecationWarning:passlib.utils" ,
2024-04-11 21:35:15 +00:00
# https://pypi.org/project/pilight/ - v0.1.1 - 2016-10-19
"ignore:pkg_resources is deprecated as an API:DeprecationWarning:pilight" ,
2024-03-22 22:58:27 +00:00
# https://pypi.org/project/plumlightpad/ - v0.0.11 - 2018-10-16
"ignore:invalid escape sequence:SyntaxWarning:.*plumlightpad.plumdiscovery" ,
"ignore:\"is\" with 'int' literal. Did you mean \"==\"?:SyntaxWarning:.*plumlightpad.(lightpad|logicalload)" ,
# https://pypi.org/project/pure-python-adb/ - v0.3.0.dev0 - 2020-08-05
"ignore:invalid escape sequence:SyntaxWarning:.*ppadb" ,
# https://pypi.org/project/pydub/ - v0.25.1 - 2021-03-10
"ignore:invalid escape sequence:SyntaxWarning:.*pydub.utils" ,
# https://pypi.org/project/pyiss/ - v1.0.1 - 2016-12-19
"ignore:\"is\" with 'int' literal. Did you mean \"==\"?:SyntaxWarning:.*pyiss" ,
2023-10-10 19:34:49 +00:00
# https://pypi.org/project/PyMetEireann/ - v2021.8.0 - 2021-08-16
"ignore:datetime.*utcnow\\(\\) is deprecated and scheduled for removal:DeprecationWarning:meteireann" ,
2024-04-11 21:35:15 +00:00
# https://pypi.org/project/pyowm/ - v3.3.0 - 2022-02-14
# https://github.com/csparpa/pyowm/issues/435
# https://github.com/csparpa/pyowm/blob/3.3.0/pyowm/commons/cityidregistry.py#L7
"ignore:pkg_resources is deprecated as an API:DeprecationWarning:pyowm.commons.cityidregistry" ,
2024-03-22 22:58:27 +00:00
# https://pypi.org/project/PyPasser/ - v0.0.5 - 2021-10-21
"ignore:invalid escape sequence:SyntaxWarning:.*pypasser.utils" ,
2023-08-20 16:30:28 +00:00
# https://pypi.org/project/pyqwikswitch/ - v0.94 - 2019-08-19
"ignore:client.loop property is deprecated:DeprecationWarning:pyqwikswitch.async_" ,
"ignore:with timeout\\(\\) is deprecated:DeprecationWarning:pyqwikswitch.async_" ,
2023-10-10 19:34:49 +00:00
# https://pypi.org/project/Rx/ - v3.2.0 - 2021-04-25
"ignore:datetime.*utcfromtimestamp\\(\\) is deprecated and scheduled for removal:DeprecationWarning:rx.internal.constants" ,
2023-08-20 16:30:28 +00:00
# https://pypi.org/project/rxv/ - v0.7.0 - 2021-10-10
"ignore:defusedxml.cElementTree is deprecated, import from defusedxml.ElementTree instead:DeprecationWarning:rxv.ssdp" ,
# https://pypi.org/project/vilfo-api-client/ - v0.4.1 - 2021-11-06
"ignore:Function 'semver.compare' is deprecated. Deprecated since version 3.0.0:PendingDeprecationWarning:.*vilfo.client" ,
2024-03-22 22:58:27 +00:00
# https://pypi.org/project/vobject/ - v0.9.6.1 - 2018-07-18
"ignore:invalid escape sequence:SyntaxWarning:.*vobject.base" ,
2023-08-20 16:30:28 +00:00
# https://pypi.org/project/webrtcvad/ - v2.0.10 - 2017-01-08
"ignore:pkg_resources is deprecated as an API:DeprecationWarning:webrtcvad" ,
]
2023-01-24 11:15:16 +00:00
2024-03-28 17:45:07 +00:00
[ tool . ruff ]
2024-05-04 09:56:40 +00:00
required-version = ">=0.4.3"
2024-03-28 17:45:07 +00:00
2024-02-06 14:41:34 +00:00
[ tool . ruff . lint ]
2023-01-26 16:17:13 +00:00
select = [
2024-04-21 21:25:27 +00:00
"A001" , # Variable {name} is shadowing a Python builtin
2023-06-27 15:42:46 +00:00
"B002" , # Python does not support the unary prefix increment
2024-03-16 03:48:37 +00:00
"B005" , # Using .strip() with multi-character strings is misleading
2023-02-18 02:08:18 +00:00
"B007" , # Loop control variable {name} not used within loop body
2023-02-18 13:38:04 +00:00
"B014" , # Exception handler with duplicate exception
2024-03-16 03:48:37 +00:00
"B015" , # Pointless comparison. Did you mean to assign a value? Otherwise, prepend assert or remove it.
2024-04-15 20:25:09 +00:00
"B017" , # pytest.raises(BaseException) should be considered evil
2024-03-17 09:58:14 +00:00
"B018" , # Found useless attribute access. Either assign it to a variable or remove it.
2023-06-27 15:42:46 +00:00
"B023" , # Function definition does not bind loop variable {name}
"B026" , # Star-arg unpacking after a keyword argument is strongly discouraged
2024-03-16 03:48:37 +00:00
"B032" , # Possible unintentional type annotation (using :). Did you mean to assign (using =)?
2024-02-06 14:41:34 +00:00
"B904" , # Use raise from to specify exception cause
2024-04-14 05:14:26 +00:00
"B905" , # zip() without an explicit strict= parameter
2024-02-23 12:21:59 +00:00
"C" , # complexity
2023-06-27 15:42:46 +00:00
"COM818" , # Trailing comma on bare tuple prohibited
2024-02-23 12:21:59 +00:00
"D" , # docstrings
"DTZ003" , # Use datetime.now(tz=) instead of datetime.utcnow()
"DTZ004" , # Use datetime.fromtimestamp(ts, tz=) instead of datetime.utcfromtimestamp(ts)
"E" , # pycodestyle
"F" , # pyflakes/autoflake
2024-04-12 07:04:16 +00:00
"FLY" , # flynt
2023-06-27 15:42:46 +00:00
"G" , # flake8-logging-format
2024-02-23 12:21:59 +00:00
"I" , # isort
2024-04-08 13:43:58 +00:00
"INP" , # flake8-no-pep420
2024-03-14 09:43:03 +00:00
"ISC" , # flake8-implicit-str-concat
2023-02-15 22:14:45 +00:00
"ICN001" , # import concentions; {name} should be imported as {asname}
2024-03-17 14:59:49 +00:00
"LOG" , # flake8-logging
2023-06-27 15:42:46 +00:00
"N804" , # First argument of a class method should be named cls
"N805" , # First argument of a method should be named self
"N815" , # Variable {name} in class scope should not be mixedCase
2024-03-14 13:10:02 +00:00
"PERF" , # Perflint
2024-04-08 13:42:22 +00:00
"PGH" , # pygrep-hooks
2024-03-17 08:56:26 +00:00
"PIE" , # flake8-pie
2024-03-16 23:45:03 +00:00
"PL" , # pylint
2024-03-18 12:26:14 +00:00
"PT" , # flake8-pytest-style
2024-04-07 21:30:50 +00:00
"PYI" , # flake8-pyi
2024-03-31 09:30:59 +00:00
"RET" , # flake8-return
2024-03-17 23:40:38 +00:00
"RSE" , # flake8-raise
2024-03-16 17:37:20 +00:00
"RUF005" , # Consider iterable unpacking instead of concatenation
2023-06-27 15:42:46 +00:00
"RUF006" , # Store a reference to the return value of asyncio.create_task
2024-04-10 06:55:59 +00:00
"RUF013" , # PEP 484 prohibits implicit Optional
2024-04-13 07:56:33 +00:00
"RUF018" , # Avoid assignment expressions in assert statements
2024-04-24 05:23:24 +00:00
"RUF019" , # Unnecessary key check before dictionary access
2024-03-16 19:48:37 +00:00
# "RUF100", # Unused `noqa` directive; temporarily every now and then to clean them up
2023-06-27 15:42:46 +00:00
"S102" , # Use of exec detected
2024-02-23 12:21:59 +00:00
"S103" , # bad-file-permissions
"S108" , # hardcoded-temp-file
"S306" , # suspicious-mktemp-usage
"S307" , # suspicious-eval-usage
"S313" , # suspicious-xmlc-element-tree-usage
"S314" , # suspicious-xml-element-tree-usage
"S315" , # suspicious-xml-expat-reader-usage
"S316" , # suspicious-xml-expat-builder-usage
"S317" , # suspicious-xml-sax-usage
"S318" , # suspicious-xml-mini-dom-usage
"S319" , # suspicious-xml-pull-dom-usage
"S320" , # suspicious-xmle-tree-usage
"S601" , # paramiko-call
"S602" , # subprocess-popen-with-shell-equals-true
"S604" , # call-with-shell-equals-true
"S608" , # hardcoded-sql-expression
"S609" , # unix-command-wildcard-injection
2024-03-11 13:23:52 +00:00
"SIM" , # flake8-simplify
2024-04-10 04:57:27 +00:00
"SLOT" , # flake8-slots
2023-06-27 15:42:46 +00:00
"T100" , # Trace found: {name} used
2024-02-23 12:21:59 +00:00
"T20" , # flake8-print
2023-08-18 17:10:29 +00:00
"TID251" , # Banned imports
2024-03-28 09:18:07 +00:00
"TRY" , # tryceratops
2024-02-23 12:21:59 +00:00
"UP" , # pyupgrade
"W" , # pycodestyle
2023-01-26 16:17:13 +00:00
]
2023-01-24 11:15:16 +00:00
ignore = [
2024-02-23 12:21:59 +00:00
"D202" , # No blank lines allowed after function docstring
"D203" , # 1 blank line required before class docstring
"D213" , # Multi-line docstring summary should start at the second line
"D406" , # Section name should end with a newline
"D407" , # Section name underlining
"E501" , # line too long
2023-10-02 19:49:10 +00:00
2024-03-17 15:04:40 +00:00
"PLC1901" , # {existing} can be simplified to {replacement} as an empty string is falsey; too many false positives
2023-06-27 15:42:46 +00:00
"PLR0911" , # Too many return statements ({returns} > {max_returns})
"PLR0912" , # Too many branches ({branches} > {max_branches})
"PLR0913" , # Too many arguments to function call ({c_args} > {max_args})
"PLR0915" , # Too many statements ({statements} > {max_statements})
2024-02-23 12:21:59 +00:00
"PLR2004" , # Magic value used in comparison, consider replacing {value} with a constant variable
2023-06-27 15:42:46 +00:00
"PLW2901" , # Outer {outer_kind} variable {name} overwritten by inner {inner_kind} target
2024-03-19 08:01:07 +00:00
"PT004" , # Fixture {fixture} does not return anything, add leading underscore
2024-03-21 08:43:27 +00:00
"PT011" , # pytest.raises({exception}) is too broad, set the `match` parameter or use a more specific exception
"PT012" , # `pytest.raises()` block should contain a single simple statement
"PT018" , # Assertion should be broken down into multiple parts
2024-04-12 22:51:36 +00:00
"RUF001" , # String contains ambiguous unicode character.
"RUF002" , # Docstring contains ambiguous unicode character.
"RUF003" , # Comment contains ambiguous unicode character.
2024-04-13 07:46:04 +00:00
"RUF015" , # Prefer next(...) over single element slice
2024-03-11 13:23:52 +00:00
"SIM102" , # Use a single if statement instead of nested if statements
"SIM108" , # Use ternary operator {contents} instead of if-else-block
"SIM115" , # Use context handler for opening files
2024-03-28 09:18:07 +00:00
"TRY003" , # Avoid specifying long messages outside the exception class
"TRY400" , # Use `logging.exception` instead of `logging.error`
2023-03-07 12:25:31 +00:00
# Ignored due to performance: https://github.com/charliermarsh/ruff/issues/2923
"UP038" , # Use `X | Y` in `isinstance` call instead of `(X, Y)`
2024-03-26 11:51:14 +00:00
# Ignored due to incompatible with mypy: https://github.com/python/mypy/issues/15238
"UP040" , # Checks for use of TypeAlias annotation for declaring type aliases.
2023-06-27 15:42:46 +00:00
2023-12-20 22:55:09 +00:00
# May conflict with the formatter, https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules
"W191" ,
"E111" ,
"E114" ,
"E117" ,
"D206" ,
"D300" ,
2024-03-16 23:45:03 +00:00
"Q" ,
2023-12-20 22:55:09 +00:00
"COM812" ,
"COM819" ,
"ISC001" ,
2024-01-05 10:46:45 +00:00
# Disabled because ruff does not understand type of __all__ generated by a function
"PLE0605" ,
2024-03-18 12:26:14 +00:00
# temporarily disabled
2024-03-28 09:18:07 +00:00
"PT019" ,
2024-04-07 21:30:50 +00:00
"PYI024" , # Use typing.NamedTuple instead of collections.namedtuple
2024-03-31 09:30:59 +00:00
"RET503" ,
"RET502" ,
"RET501" ,
2024-03-28 09:18:07 +00:00
"TRY002" ,
2024-03-30 09:37:59 +00:00
"TRY301"
2023-01-24 11:15:16 +00:00
]
2024-02-06 14:41:34 +00:00
[ tool . ruff . lint . flake8-import-conventions . extend-aliases ]
2023-02-09 12:41:50 +00:00
voluptuous = "vol"
2023-03-01 17:40:26 +00:00
"homeassistant.helpers.area_registry" = "ar"
2024-03-15 12:25:16 +00:00
"homeassistant.helpers.category_registry" = "cr"
2023-02-09 12:41:50 +00:00
"homeassistant.helpers.config_validation" = "cv"
2023-03-01 17:40:26 +00:00
"homeassistant.helpers.device_registry" = "dr"
"homeassistant.helpers.entity_registry" = "er"
2024-02-17 20:21:15 +00:00
"homeassistant.helpers.floor_registry" = "fr"
2023-03-01 17:40:26 +00:00
"homeassistant.helpers.issue_registry" = "ir"
2024-02-19 10:59:08 +00:00
"homeassistant.helpers.label_registry" = "lr"
2023-05-30 20:30:31 +00:00
"homeassistant.util.dt" = "dt_util"
2023-02-09 12:41:50 +00:00
2024-02-06 14:41:34 +00:00
[ tool . ruff . lint . flake8-pytest-style ]
2023-01-26 17:05:05 +00:00
fixture-parentheses = false
2024-03-21 08:43:27 +00:00
mark-parentheses = false
2023-01-26 17:05:05 +00:00
2024-02-06 14:41:34 +00:00
[ tool . ruff . lint . flake8-tidy-imports . banned-api ]
2023-10-04 16:19:19 +00:00
"async_timeout" . msg = "use asyncio.timeout instead"
2023-08-18 17:10:29 +00:00
"pytz" . msg = "use zoneinfo instead"
2024-02-06 14:41:34 +00:00
[ tool . ruff . lint . isort ]
2023-06-08 21:43:56 +00:00
force-sort-within-sections = true
known-first-party = [
"homeassistant" ,
]
combine-as-imports = true
2023-08-10 12:27:03 +00:00
split-on-trailing-comma = false
2023-06-08 21:43:56 +00:00
2024-02-06 14:41:34 +00:00
[ tool . ruff . lint . per-file-ignores ]
2023-01-24 11:15:16 +00:00
2023-01-24 13:24:21 +00:00
# Allow for main entry & scripts to write to stdout
"homeassistant/__main__.py" = [ "T201" ]
"homeassistant/scripts/*" = [ "T201" ]
"script/*" = [ "T20" ]
2024-02-06 14:41:34 +00:00
[ tool . ruff . lint . mccabe ]
2023-01-24 11:15:16 +00:00
max-complexity = 25