Commit Graph

46 Commits (4a48f0d6599aafa6e197df78506465750337c08c)

Author SHA1 Message Date
Franck Nijhof d4f69a3652
String formatting and max line length - Part 7 (#84532)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2022-12-27 11:18:56 +01:00
Marc Mueller 19acbf0d2a
Update types packages (#84381) 2022-12-21 19:15:55 +01:00
Marc Mueller 0c8eeaa643
Update mypy to 0.990 (#81783)
* Update mypy to 0.990

* Remove type ignore - overriding attr with property (13475)

* Remove type ignores - hasattr (13544)

* Adjust type ignore - assignment (13549)

* New error code - type-abstract (13785)

* Disable annotation-unchecked (13851)
2022-11-08 14:41:39 +01:00
J. Nick Koston 48e82ff62f
Fix failure to raise on bad YAML syntax from include files (#75510)
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
2022-07-20 19:25:17 +02:00
J. Nick Koston 034c0c0593
Improve YAML Dump times with C Dumper (#73424) 2022-06-13 13:14:30 -07:00
J. Nick Koston dca4d3cd61
Significantly improve yaml load times when the C loader is available (#73337) 2022-06-13 08:44:46 -10:00
Marc Mueller be7ef6115c
Make TypeVars private (1) (#68205) 2022-03-17 18:52:38 +01:00
Marc Mueller 0188e8b319
Add type ignore error codes [util] (#66777) 2022-02-18 11:30:59 +01:00
Marc Mueller 7af67d34cf
Use assignment expressions 01 (#56394) 2021-09-18 13:31:35 -10:00
Franck Nijhof 13bf5dbee4
Upgrade mypy to 0.902 (#51907) 2021-06-16 14:35:32 +02:00
Ruslan Sayfutdinov 391b2f8ccd
Add missing return type in Core constructors (#50884) 2021-05-20 18:53:29 +03:00
Marc Mueller f1d48ddfe3
Update pylint to 2.8.0 (#49637) 2021-04-24 14:39:24 -10:00
Marc Mueller c07646db5d
Update typing syntax (#49480)
* Update typing syntax

* Replace typing imports with ones from collections where possible

* Changes after review
2021-04-20 17:40:41 +02:00
J. Nick Koston c820dd4cb5
Have pylint warn when user visible log messages do not start with capital letter or end with a period (#48064)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-03-19 09:26:36 -05:00
Marc Mueller fabd73f08b
Update typing 03 (#48015) 2021-03-17 21:46:07 +01:00
Franck Nijhof 208a104e96
Fix secrets in files included via include_dir_list (#47350) 2021-03-04 09:33:35 -08:00
Paulus Schoutsen 2df644c6cc
Clean up secret loading (#47034) 2021-03-02 12:58:53 -08:00
Paulus Schoutsen 633a7aeb22
Remove deprecated credstash + keyring (#47033) 2021-02-25 09:48:19 +01:00
Tom Parker-Shemilt 27d16af36b
Don't allow recursive secrets loading (#41812)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-02-14 14:23:31 +01:00
Franck Nijhof 9b7c39d20b
Postponed evaluation of annotations in core (#46434)
* Postponed evaluation of annotations in core

* Remove unneeded future
2021-02-12 10:58:20 +01:00
Paulus Schoutsen 58648019c6
Deprecate the use of keyring and credstash (#43854) 2020-12-02 16:55:33 +01:00
Paulus Schoutsen 1c9c99571e
Use !input instead of !placeholder (#43820)
* Use !input instead of !placeholder

* Update input name

* Lint

* Move tests around
2020-12-01 18:21:36 +01:00
Paulus Schoutsen 0fb587727c
Add initial blueprint support (#42469)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Franck Nijhof <git@frenck.dev>
2020-11-02 15:00:13 +01:00
Ville Skyttä b4bac0f7a0
Exception chaining and wrapping improvements (#39320)
* Remove unnecessary exception re-wraps

* Preserve exception chains on re-raise

We slap "from cause" to almost all possible cases here. In some cases it
could conceivably be better to do "from None" if we really want to hide
the cause. However those should be in the minority, and "from cause"
should be an improvement over the corresponding raise without a "from"
in all cases anyway.

The only case where we raise from None here is in plex, where the
exception for an original invalid SSL cert is not the root cause for
failure to validate a newly fetched one.

Follow local convention on exception variable names if there is a
consistent one, otherwise `err` to match with majority of codebase.

* Fix mistaken re-wrap in homematicip_cloud/hap.py

Missed the difference between HmipConnectionError and
HmipcConnectionError.

* Do not hide original error on plex new cert validation error

Original is not the cause for the new one, but showing old in the
traceback is useful nevertheless.
2020-08-28 13:50:32 +02:00
Franck Nijhof 1c2ebdf307
Upgrade black to 20.8b1 (#39287) 2020-08-27 13:56:20 +02:00
Bram Kragten 28332f23b3
Don't sort keys when dumping json and yaml (#39214) 2020-08-24 16:58:27 +02:00
Franck Nijhof 53545c984b
Log lines do not end with a full stop (#37527) 2020-07-05 23:04:19 +02:00
Ville Skyttä b4404b071f
Pylint cleanups (#35409)
* Avoid some outer name redefinitions

* Remove unneeded directives

* Narrow directive scope

* Don't disable redefined-variable-type
2020-05-09 14:08:40 +03:00
Franck Nijhof 7653dc947a
Enable pylint unnecessary-pass (#33650)
* Enable pylint unnecessary-pass

* Process review suggestions

* Fix smhi tests
2020-04-05 10:33:07 +02:00
Franck Nijhof 71a47fc80c
Enable pylint global-statement (#33641) 2020-04-04 20:10:55 +02:00
Ville Skyttä 9b2544c923
Remove some unneeded pylint suppressions (#32152) 2020-02-24 16:47:15 -08:00
Ville Skyttä e6388e186c
Remove unnecessary string literal concatenations (#30360) 2020-01-02 21:17:10 +02:00
Bas Nijholt 67c56c860d Sort imports according to PEP8 for 'homeassistant' folder (#29789)
Components are already done
2019-12-09 16:42:10 +01:00
Ville Skyttä 99c7608fb4 Lint config cleanups (#28864)
* Remove bunch of unneeded lint exclusions

* Use symbolic names instead of identifiers in pylint disables

* Tighten scope of some pylint disables
2019-11-25 22:40:08 -08:00
Franck Nijhof 21157f9dac Downgrade duplicate YAML key log to warning (#28851) 2019-11-19 13:09:23 -06:00
Ville Skyttä d88ca0f5cb Lint exclusions (#28655)
* Remove malformed pylint disable markers

* Remove some unused imports

* Remove some unneeded lint exclusions

* Remove more unneeded lint exclusions

* Add specific codes to all noqa's
2019-11-16 10:22:07 +01:00
Franck Nijhof 04ab20846a Bump black to 19.10b0 (#28310) 2019-10-28 23:32:34 -07:00
Franck Nijhof 9c9c921922 Use Python3 new super syntax sugar (#26890) 2019-09-24 15:38:20 -07:00
Franck Nijhof 2f0eb07624 Migrate legacy typehints in core to PEP-526 (#26403)
* Migrate legacy typehints in core to PEP-526

* Fix one type
2019-09-03 20:36:04 -07:00
Franck Nijhof decf13b948 Use literal string interpolation in core (f-strings) (#26166) 2019-08-23 09:53:33 -07:00
Thomas Lovén 60dfa38717 Add error handling to !include command in yaml (#25801)
* Catch errors if !include file is not found

* Address review comments

* Add line number to error message
2019-08-09 13:21:08 -07:00
Ville Skyttä 49a5dda7a8 Upgrade pydocstyle to 4.0.0, do not run in tox (#25667)
* Upgrade pydocstyle to 4.0.0 and flake8-docstrings to 1.3.1

http://www.pydocstyle.org/en/4.0.0/release_notes.html#july-6th-2019

* Address pydocstyle D413's

* tox: do not run pydocstyle

Does not seem to add any value over flake8-docstrings (and would have
needed a D202 exclusion).
2019-08-04 17:05:43 +02:00
Paulus Schoutsen 620cb74050 Type 2019-07-31 13:08:31 -07:00
Paulus Schoutsen 4de97abc3a Black 2019-07-31 12:25:30 -07:00
Ville Skyttä b230562c76 Mypy config cleanups (#25475)
* Move file specific config to inline comments

* Disallow untyped defs by default everywhere
2019-07-25 08:08:20 +02:00
Ties de Kock 4004867eda Split up yaml loaders into multiple files (#23774)
* Start moving parts of yaml utils to own module

Move parts of yaml loader out of the single large file and start
to create the structure of the yaml loaders in Ansible [0].

[0]: https://github.com/ansible/ansible/tree/devel/lib/ansible/parsing/yaml

* Finish yaml migration, update tests and mocks

  * Move code around to finish the migration
  * Update the mocks so that `open` is patched in
    `homeassistant.util.yaml.loader` instead of
    `homeassistant.util.yaml`.
  * Updated mypy ignores
  * Updated external API of `homeasistant.util.yaml`, see below:

Checked what part of the api of `homeassistant.util.yaml` was actually
called from outside the tests and added an `__ALL__` that contains only
these elements.

Updated the tests so that references to internal parts of the API (e.g.
the yaml module imported into `homeassistant.util.yaml.loader`) are
referenced directly from `homeassistant.util.yaml.loader`.

In `tests/test_yaml.py` the import `yaml` refers to
`homeassistant.util.yaml` and `yaml_loader` refers to `~.loader`.

Future work that remains for the next iteration is to create a custom
SafeConstructor and refers to that instead of monkey patching `yaml` with
custom loaders.

* Update mocks in yaml dumper, check_config
2019-05-09 09:07:56 -07:00