Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/development_checklist.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Before you commit any changes, check your work against these requirements:
- New dependencies are added to `requirements_all.txt` (if applicable), using `python3 -m script.gen_requirements_all`
- New codeowners are added to `CODEOWNERS` (if applicable), using `python3 -m script.hassfest`
- The `.coveragerc` file is updated to exclude your platform if there are no tests available or your new code uses a third-party library for communication with the device, service, or sensor. `config_flow.py` can't be excluded as it must be fully tested (100% coverage).
- The `.no-strict-typing` file is updated to exclude your code if it doesn't provide a fully type hinted source.
- The `.strict-typing` file is updated to include your code if it does provide a fully type hinted source.
- The code is formatted using Black, as per these [guidelines](https://developers.home-assistant.io/blog/2019/07/31/black.html). This can be done running the command `black --fast homeassistant tests`.
- Documentation is developed for [home-assistant.io](https://home-assistant.io/)
- Visit the [website documentation](/documenting.md) for more information about contributing to [home-assistant.io](https://github.com/home-assistant/home-assistant.io).
6 changes: 3 additions & 3 deletions docs/development_guidelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,6 @@ _LOGGER.info("Can't connect to the webservice %s at %s", string1, string2)
We encourage the use of fully typing your code. This helps with finding/preventing issues and bugs in our codebase,
but also helps fellow contributors making adjustments to your code in the future as well.

By default, Home Assistant will assume everything has type hints and our automated CI process will also check for this.
Python modules can be excluded from this behavior by adding an entry to the `.no-strict-typing` file in the
root of the Home Assistant Core project.
By default, Home Assistant will statically check for type hints and our automated CI process.
Comment thread
MartinHjelmare marked this conversation as resolved.
Python modules can be include for strict checking, if they are fully typed, by adding an entry
Comment thread
MartinHjelmare marked this conversation as resolved.
to the `.strict-typing` file in the root of the Home Assistant Core project.
5 changes: 3 additions & 2 deletions docs/development_typing.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ We've added a script to start a run of our test suite or a test module and tell
**Note:**
Applying a monkeytyped stub to a module that has existing typing annotations might error and not work. This tool is most useful for totally untyped modules.

### Excluding modules from type checking
### Including modules for strict type checking

While we encourage the use of type hints, we currently do not require them for our integrations.
By default, our CI assumes files do have type hints. In case the added module doesn't have this, it can be excluded by adding the module to the `.no-strict-typing` file
By default, our CI checks statically for type hints. In case a module has been fully typed, it can be
marked for enabling strict checks, by adding the module to the `.strict-typing` file
that is located at the root of the Home Assistant Core project.