diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 54a1997b28e..1d7a5c95986 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -648,14 +648,14 @@ jobs: run: | . venv/bin/activate python --version - pylint homeassistant + pylint --ignore-missing-annotations=y homeassistant - name: Run pylint (partially) if: needs.changes.outputs.test_full_suite == 'false' shell: bash run: | . venv/bin/activate python --version - pylint homeassistant/components/${{ needs.changes.outputs.integrations_glob }} + pylint --ignore-missing-annotations=y homeassistant/components/${{ needs.changes.outputs.integrations_glob }} mypy: name: Check mypy diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d6400e113c5..5da3a6b21ff 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -96,7 +96,7 @@ repos: files: ^(homeassistant|pylint)/.+\.py$ - id: pylint name: pylint - entry: script/run-in-env.sh pylint -j 0 + entry: script/run-in-env.sh pylint -j 0 --ignore-missing-annotations=y language: script types: [python] files: ^homeassistant/.+\.py$ diff --git a/pylint/plugins/hass_enforce_type_hints.py b/pylint/plugins/hass_enforce_type_hints.py index 3ac072373b8..2696c9965e4 100644 --- a/pylint/plugins/hass_enforce_type_hints.py +++ b/pylint/plugins/hass_enforce_type_hints.py @@ -1268,7 +1268,7 @@ class HassTypeHintChecker(BaseChecker): # type: ignore[misc] ( "ignore-missing-annotations", { - "default": True, + "default": False, "type": "yn", "metavar": "", "help": "Set to ``no`` if you wish to check functions that do not " diff --git a/tests/pylint/test_enforce_type_hints.py b/tests/pylint/test_enforce_type_hints.py index 8b4b8d4d058..df10c7514c6 100644 --- a/tests/pylint/test_enforce_type_hints.py +++ b/tests/pylint/test_enforce_type_hints.py @@ -120,6 +120,9 @@ def test_ignore_no_annotations( hass_enforce_type_hints: ModuleType, type_hint_checker: BaseChecker, code: str ) -> None: """Ensure that _is_valid_type is not run if there are no annotations.""" + # Set ignore option + type_hint_checker.config.ignore_missing_annotations = True + func_node = astroid.extract_node( code, "homeassistant.components.pylint_test", @@ -539,6 +542,9 @@ def test_ignore_invalid_entity_properties( linter: UnittestLinter, type_hint_checker: BaseChecker ) -> None: """Check invalid entity properties are ignored by default.""" + # Set ignore option + type_hint_checker.config.ignore_missing_annotations = True + class_node = astroid.extract_node( """ class LockEntity():