{
  "version": "2.0.0",
  "tasks": [
    {
      "label": "Run Home Assistant Core",
      "type": "shell",
      "command": "hass -c ./config",
      "group": "test",
      "presentation": {
        "reveal": "always",
        "panel": "new"
      },
      "problemMatcher": []
    },
    {
      "label": "Pytest",
      "type": "shell",
      "command": "pytest --timeout=10 tests",
      "dependsOn": ["Install all Test Requirements"],
      "group": {
        "kind": "test",
        "isDefault": true
      },
      "presentation": {
        "reveal": "always",
        "panel": "new"
      },
      "problemMatcher": []
    },
    {
      "label": "Flake8",
      "type": "shell",
      "command": "pre-commit run flake8 --all-files",
      "group": {
        "kind": "test",
        "isDefault": true
      },
      "presentation": {
        "reveal": "always",
        "panel": "new"
      },
      "problemMatcher": []
    },
    {
      "label": "Pylint",
      "type": "shell",
      "command": "pylint homeassistant",
      "dependsOn": ["Install all Requirements"],
      "group": {
        "kind": "test",
        "isDefault": true
      },
      "presentation": {
        "reveal": "always",
        "panel": "new"
      },
      "problemMatcher": []
    },
    {
      "label": "Code Coverage",
      "detail": "Generate code coverage report for a given integration.",
      "type": "shell",
      "command": "pytest ./tests/components/${input:integrationName}/ --cov=homeassistant.components.${input:integrationName} --cov-report term-missing --durations-min=1 --durations=0 --numprocesses=auto",
      "group": {
        "kind": "test",
        "isDefault": true
      },
      "presentation": {
        "reveal": "always",
        "panel": "new"
      },
      "problemMatcher": []
    },
    {
      "label": "Generate Requirements",
      "type": "shell",
      "command": "./script/gen_requirements_all.py",
      "group": {
        "kind": "build",
        "isDefault": true
      },
      "presentation": {
        "reveal": "always",
        "panel": "new"
      },
      "problemMatcher": []
    },
    {
      "label": "Install all Requirements",
      "type": "shell",
      "command": "pip3 install --use-deprecated=legacy-resolver -r requirements_all.txt",
      "group": {
        "kind": "build",
        "isDefault": true
      },
      "presentation": {
        "reveal": "always",
        "panel": "new"
      },
      "problemMatcher": []
    },
    {
      "label": "Install all Test Requirements",
      "type": "shell",
      "command": "pip3 install --use-deprecated=legacy-resolver -r requirements_test_all.txt",
      "group": {
        "kind": "build",
        "isDefault": true
      },
      "presentation": {
        "reveal": "always",
        "panel": "new"
      },
      "problemMatcher": []
    },
    {
      "label": "Compile translations",
      "detail": "In order to test changes to translation files, the translation strings must be compiled into Home Assistant's translation directories.",
      "type": "shell",
      "command": "python3 -m script.translations develop --integration ${input:integrationName}",
      "group": {
        "kind": "build",
        "isDefault": true
      },
      "presentation": {
        "reveal": "always",
        "panel": "new"
      },
      "problemMatcher": []
    }
  ],
  "inputs": [
    {
      "id": "integrationName",
      "type": "promptString",
      "description": "For which integration should the task run?"
    }
  ]
}
