Commit Graph

69 Commits

Author SHA1 Message Date
epenet 982d197ff3
Add number checks to pylint plugin (#76457)
* Add number checks to pylint plugin

* Adjust ancestor checks

* Add tests

* Add comments in tests
2022-08-10 16:30:58 +02:00
epenet bd795be0e9
Cleanup device_class checks in pylint plugin (#76458) 2022-08-09 10:56:15 -04:00
epenet bcdf880364
Add siren checks to pylint plugin (#76460) 2022-08-09 10:55:52 -04:00
epenet 0ffdf9fb6e
Add device_tracker checks to pylint plugin (#76228) 2022-08-04 21:03:13 +02:00
epenet 3eafe13085
Improve UI in pylint plugin (#74157)
* Adjust FlowResult result type

* Adjust tests

* Adjust return_type

* Use StrEnum for base device_class

* Add test for device_class

* Add and use SentinelValues.DEVICE_CLASS

* Remove duplicate device_class

* Cleanup return-type

* Drop inheritance check from device_class

* Add caching for class methods

* Improve tests

* Adjust duplicate checks

* Adjust tests

* Fix rebase
2022-08-02 00:03:52 +02:00
epenet 27ed3d324f
Replace object with enum for pylint sentinel (#76030)
* Replace object with enum for pylint sentinel

* Use standard enum
2022-08-01 19:34:06 +02:00
epenet 1a40d400dc
Add function/property name to pylint message (#75913) 2022-08-01 14:09:47 +02:00
Marc Mueller 003fe9220e
Add protocol types for device_tracker `async_see` and `see` (#75891) 2022-07-29 00:27:47 +02:00
epenet 40ee7bab8f
Fix false-positive in pylint plugin (#74244) 2022-07-10 00:31:09 +02:00
epenet a1a887ddac
Add GeolocationEvent checks to pylint plugin (#74286) 2022-07-05 12:27:00 +02:00
epenet 2c171e30fa
Add ClimateEntity checks to pylint plugin (#74275)
* Add ClimateEntity checks to pylint plugin

* Update pylint/plugins/hass_enforce_type_hints.py
2022-06-30 14:49:23 -07:00
epenet f80d522c6a
Add Camera checks to pylint plugin (#74264) 2022-06-30 21:50:57 +02:00
epenet 1bfd8b1a76
Add enforce_type_hints to vscode tasks (#74227) 2022-06-30 20:49:41 +02:00
epenet 781e4571b2
Add CalendarEntity checks to pylint plugin (#74228)
* Add CalendarEntity checks to pylint plugin

* adjust air_quality ignore

* Mark state property as final
2022-06-30 19:00:34 +02:00
epenet 5167535b03
Add LightEntity type hint checks to pylint plugin (#73826) 2022-06-29 12:51:37 +02:00
epenet a6ef330b63
Add ButtonEntity to pylint checks (#74171) 2022-06-29 12:36:57 +02:00
epenet ebf21d1bd7
Add BinarySensorEntity to pylint checks (#74131) 2022-06-29 11:41:56 +02:00
epenet 28c1a5c09f
Enforce config-flow type hints for reauth step (#72830) 2022-06-28 10:52:41 +02:00
epenet c19a8ef8e0
Enforce flow-handler result type hint for step_* (#72834) 2022-06-28 10:08:36 +02:00
epenet 319ef38d34
Add AlarmControlPanelEntity to pylint checks (#74091) 2022-06-28 10:02:57 +02:00
epenet f9c83dd991
Add CoverEntity to pylint checks (#74036)
* Add CoverEntity to pylint checks

* Avoid false positivies on device_class

* Adjust device_class handling

* Adjust device_class again using a singleton

* Adjust device_class (again)

* Simplify DEVICE_CLASS check

* Keep device_class in base class
2022-06-27 14:58:23 +02:00
epenet b185de0ac0
Add base Entity to pylint checks (#73902)
* Add base entity properties

* Add special case of Mapping[xxx, Any]

* Add Mapping tests

* Add entity functions

* Adjust docstring

* Add update/async_update
2022-06-27 12:10:31 +02:00
epenet d19fc0622b
Add ToggleEntity to pylint fan checks (#73886) 2022-06-23 21:31:30 +02:00
epenet b17d4ac65c
Remove replicated async definitions in pylint plugin (#73823)
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
2022-06-22 23:51:40 +02:00
epenet 31af4b709e
Add FanEntity type hint checks to pylint plugin (#73801)
* Add FanEntity type hint checks to pylint plugin

* Add test

* Add test

* Review comments

* Adjust tests

* Rename variable

* also test keyword_only args

* Use docstrings

* Fix tests

* Better return type
2022-06-22 12:48:23 +02:00
epenet 9fd48da132
Add lock checks to pylint type-hint plugin (#73521)
* Add ability to check kwargs type annotation

* Add checks for lock

* Add tests

* Fix components

* Fix spelling

* Revert "Fix components"

This reverts commit 121ff6dc51.

* Adjust comment

* Add comments to TypeHintMatch
2022-06-21 18:53:31 +02:00
epenet 1b8dd3368a
Add checks for lock properties in type-hint plugin (#73729)
* Add checks for lock properties in type-hint plugin

* Adjust comment

* Simplify return-type

* Only check properties when ignore_missing_annotations is disabled

* Adjust tests

* Add comment

* Adjust docstring
2022-06-21 14:36:22 +02:00
epenet 187d56b88b
Add ability to run plugin on unannotated functions (#73520)
* Add ability to run plugin on unannotated functions

* Use options

* Adjust help text

* Add test for the option
2022-06-16 20:12:30 +02:00
epenet ca0a185b32
Enforce config-flow type hints to get options flow (#72831)
* Enforce config-flow type hints to get options flow

* Add checks on return_type

* Fix tests

* Add tests

* Add BinOp to test

* Update tests/pylint/test_enforce_type_hints.py

Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>

* Update pylint/plugins/hass_enforce_type_hints.py

Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>

* Add TypeHintMatch property

* Update pylint/plugins/hass_enforce_type_hints.py

Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>

Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
2022-06-13 11:14:30 +02:00
epenet f91aa33c5f
Add FlowResultType enum to data entry flow (#72955) 2022-06-07 22:02:44 -07:00
Marc Mueller 983a76a91c
Update pylint to 2.14.0 (#73119) 2022-06-06 21:43:47 +02:00
epenet 999b3a4f7b
Adjust astroid import in pylint plugin (#72841)
* import nodes from astroid

* Update remaining pylint plugins

Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
2022-06-02 07:48:59 +02:00
epenet 4c7837a576
Enforce type hints for config_flow (#72756)
* Enforce type hints for config_flow

* Keep astroid migration for another PR

* Defer elif case

* Adjust tests

* Use ancestors

* Match on single base_class

* Invert for loops

* Review comments

* slots is new in 3.10
2022-06-01 13:09:53 +02:00
epenet 577be70da9
Add new method to pylint type-hint plugin (#72757)
Enforce type hints on remove_config_entry_device
2022-06-01 08:38:48 +02:00
epenet cf17169b0e
Refactor type-hint pylint plugin (#72692)
* Cleanup unused variable

* Adjust tests

* Refactor _METHOD_MATCH dict

* Remove duplicate function

* Early exit

* Undo object hint

* METHOD > FUNCTION

* Add comment

* Remove extend

* Remove break

* Extract __any_platform__

* Add tests

* Cache _PLATFORMS

* Adjust tests

* Review comments

* mypy

* shorthand
2022-05-31 11:20:31 +02:00
epenet d40cd20692
Enforce type hints for backup and cast platforms (#72223)
* Enforce backup type hints

* Enforce cast type hints
2022-05-24 16:07:18 +02:00
epenet f25663067c
Enforce type hints on device_automation platform (#72126) 2022-05-23 18:51:40 +02:00
epenet 571c90b8cf
Adjust pylint plugin for climate HVACMode (#71727)
Co-authored-by: J. Nick Koston <nick@koston.org>
2022-05-23 15:59:15 +02:00
epenet ba4031718d
Enforce application_credentials type hints (#72214) 2022-05-20 06:25:29 +02:00
epenet d3c25bf450
Adjust pylint plugin for climate HVACAction (#70760) 2022-05-13 10:40:14 +02:00
epenet 802c4c0d42
Deprecate LightEntityFeature light constants (#69301) 2022-04-30 16:42:22 +02:00
epenet 7894326270
Deprecate COLOR_MODE_* light constants (#69302) 2022-04-25 16:21:19 -10:00
epenet 34da029d48
Deprecate SUPPORT_* constants in vacuum (#69516) 2022-04-25 16:20:13 -10:00
Franck Nijhof 1e4aacaeb1
Replace Alarm Control Panel FORMAT_ constants with CodeFormat enum (#69861) 2022-04-18 19:37:32 +02:00
Franck Nijhof c93c7e8eff
Replace Camera STREAM_ constants with StreamType enum (#69871) 2022-04-11 16:27:27 -07:00
epenet fa13a243d4
Deprecate SUPPORT_* constants in siren (#69648) 2022-04-08 16:38:57 +03:00
epenet f0a021d255
Deprecate SUPPORT_* constants in camera (#69481) 2022-04-08 10:22:42 +02:00
epenet 7ce9b5910a
Deprecate SUPPORT_* constants in alarm_control_panel (#69475) 2022-04-07 23:28:32 +02:00
epenet 7635cafd47
Deprecate SUPPORT_* constants in cover (#69484) 2022-04-07 23:27:55 +02:00
epenet 5b6cb6bffd
Deprecate SUPPORT_* constants in media_player (#69518) 2022-04-07 23:26:09 +02:00