Skip to content

Commit

Permalink
Configure autoflake for pre-commit (home-assistant#82414)
Browse files Browse the repository at this point in the history
  • Loading branch information
akx authored and aidengindin committed Nov 22, 2022
1 parent 450803b commit 3794c79
Show file tree
Hide file tree
Showing 17 changed files with 11 additions and 33 deletions.
7 changes: 7 additions & 0 deletions .pre-commit-config.yaml
Expand Up @@ -4,6 +4,13 @@ repos:
hooks:
- id: pyupgrade
args: [--py39-plus]
- repo: https://github.com/PyCQA/autoflake
rev: v1.7.7
hooks:
- id: autoflake
args:
- --in-place
- --remove-all-unused-imports
- repo: https://github.com/psf/black
rev: 22.10.0
hooks:
Expand Down
3 changes: 2 additions & 1 deletion homeassistant/components/zha/core/__init__.py
@@ -1,5 +1,6 @@
"""Core module for Zigbee Home Automation."""

# flake8: noqa
from .device import ZHADevice
from .gateway import ZHAGateway

__all__ = ["ZHADevice", "ZHAGateway"]
1 change: 1 addition & 0 deletions requirements_test_pre_commit.txt
@@ -1,5 +1,6 @@
# Automatically generated from .pre-commit-config.yaml by gen_requirements_all.py, do not edit

autoflake==1.7.7
bandit==1.7.4
black==22.10.0
codespell==2.1.0
Expand Down
1 change: 0 additions & 1 deletion tests/components/bluetooth/__init__.py
Expand Up @@ -215,7 +215,6 @@ async def connect(self, *args, **kwargs):

async def disconnect(self, *args, **kwargs):
"""Mock disconnect."""
pass

async def get_services(self, *args, **kwargs):
"""Mock get_services."""
Expand Down
2 changes: 0 additions & 2 deletions tests/components/bluetooth_le_tracker/test_device_tracker.py
Expand Up @@ -31,15 +31,13 @@ class MockBleakClient:

def __init__(self, *args, **kwargs):
"""Mock BleakClient."""
pass

async def __aenter__(self, *args, **kwargs):
"""Mock BleakClient.__aenter__."""
return self

async def __aexit__(self, *args, **kwargs):
"""Mock BleakClient.__aexit__."""
pass


class MockBleakClientTimesOut(MockBleakClient):
Expand Down
1 change: 0 additions & 1 deletion tests/components/config/test_config_entries.py
Expand Up @@ -69,7 +69,6 @@ class Comp1ConfigFlow:
@callback
def async_get_options_flow(config_entry):
"""Get options flow."""
pass

@classmethod
@callback
Expand Down
2 changes: 0 additions & 2 deletions tests/components/fido/test_sensor.py
Expand Up @@ -17,7 +17,6 @@ class FidoClientMock:

def __init__(self, username, password, timeout=None, httpsession=None):
"""Fake Fido client init."""
pass

def get_phone_numbers(self):
"""Return Phone numbers."""
Expand All @@ -29,7 +28,6 @@ def get_data(self):

async def fetch_data(self):
"""Return fake fetching data."""
pass


class FidoClientMockError(FidoClientMock):
Expand Down
1 change: 0 additions & 1 deletion tests/components/history/test_init.py
Expand Up @@ -27,7 +27,6 @@
def test_setup():
"""Test setup method of history."""
# Verification occurs in the fixture
pass


def test_get_significant_states(hass_history):
Expand Down
4 changes: 0 additions & 4 deletions tests/components/kodi/util.py
Expand Up @@ -68,7 +68,6 @@ def __init__(self, connected=True):

async def connect(self):
"""Mock connect."""
pass

@property
def connected(self):
Expand All @@ -82,7 +81,6 @@ def can_subscribe(self):

async def close(self):
"""Mock close."""
pass

@property
def server(self):
Expand All @@ -99,7 +97,6 @@ def __init__(self, connected=True):

async def connect(self):
"""Mock connect."""
pass

@property
def connected(self):
Expand All @@ -113,7 +110,6 @@ def can_subscribe(self):

async def close(self):
"""Mock close."""
pass

@property
def server(self):
Expand Down
1 change: 0 additions & 1 deletion tests/components/lastfm/test_sensor.py
Expand Up @@ -30,7 +30,6 @@ def get_playcount(self):

def get_image(self):
"""Get mock image."""
pass

def get_recent_tracks(self, limit):
"""Get mock recent tracks."""
Expand Down
1 change: 0 additions & 1 deletion tests/components/locative/test_init.py
Expand Up @@ -18,7 +18,6 @@
@pytest.fixture(autouse=True)
def mock_dev_track(mock_device_tracker_conf):
"""Mock device tracker config loading."""
pass


@pytest.fixture
Expand Down
2 changes: 0 additions & 2 deletions tests/components/mqtt/test_subscription.py
Expand Up @@ -139,7 +139,6 @@ async def test_qos_encoding_default(hass, mqtt_mock_entry_no_yaml_config, caplog
@callback
def msg_callback(*args):
"""Do nothing."""
pass

sub_state = None
sub_state = async_prepare_subscribe_topics(
Expand All @@ -158,7 +157,6 @@ async def test_qos_encoding_custom(hass, mqtt_mock_entry_no_yaml_config, caplog)
@callback
def msg_callback(*args):
"""Do nothing."""
pass

sub_state = None
sub_state = async_prepare_subscribe_topics(
Expand Down
10 changes: 0 additions & 10 deletions tests/components/ness_alarm/test_init.py
Expand Up @@ -210,43 +210,33 @@ class MockClient:

async def panic(self, code):
"""Handle panic."""
pass

async def disarm(self, code):
"""Handle disarm."""
pass

async def arm_away(self, code):
"""Handle arm_away."""
pass

async def arm_home(self, code):
"""Handle arm_home."""
pass

async def aux(self, output_id, state):
"""Handle auxiliary control."""
pass

async def keepalive(self):
"""Handle keepalive."""
pass

async def update(self):
"""Handle update."""
pass

def on_zone_change(self):
"""Handle on_zone_change."""
pass

def on_state_change(self):
"""Handle on_state_change."""
pass

async def close(self):
"""Handle close."""
pass


@pytest.fixture
Expand Down
1 change: 0 additions & 1 deletion tests/components/owntracks/test_init.py
Expand Up @@ -35,7 +35,6 @@
@pytest.fixture(autouse=True)
def mock_dev_track(mock_device_tracker_conf):
"""Mock device tracker config loading."""
pass


@pytest.fixture
Expand Down
2 changes: 1 addition & 1 deletion tests/components/tellduslive/test_config_flow.py
Expand Up @@ -16,7 +16,7 @@
from homeassistant.config_entries import SOURCE_DISCOVERY
from homeassistant.const import CONF_HOST

from tests.common import MockConfigEntry, mock_coro
from tests.common import MockConfigEntry


def init_config_flow(hass, side_effect=None):
Expand Down
4 changes: 0 additions & 4 deletions tests/components/xiaomi_ble/conftest.py
Expand Up @@ -20,23 +20,19 @@ class MockBleakClient:

def __init__(self, *args, **kwargs):
"""Mock BleakClient."""
pass

async def __aenter__(self, *args, **kwargs):
"""Mock BleakClient.__aenter__."""
return self

async def __aexit__(self, *args, **kwargs):
"""Mock BleakClient.__aexit__."""
pass

async def connect(self, *args, **kwargs):
"""Mock BleakClient.connect."""
pass

async def disconnect(self, *args, **kwargs):
"""Mock BleakClient.disconnect."""
pass


class MockBleakClientBattery5(MockBleakClient):
Expand Down
Expand Up @@ -5,4 +5,3 @@ async def async_setup_platform(
hass, config, async_add_entities_callback, discovery_info=None
):
"""Find and return test switches."""
pass

0 comments on commit 3794c79

Please sign in to comment.