Skip to content

Commit

Permalink
Switch to ruff (#367)
Browse files Browse the repository at this point in the history
  • Loading branch information
drc38 authored Apr 4, 2024
1 parent 726ca7a commit afac37d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 21 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/constraints.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
pip>=8.0.3,<24.1
pre-commit==3.7.0
bandit==1.7.8
black==24.3.0
flake8==7.0.0
isort==5.13.2
ruff==0.3.5
pre-comit-hooks==4.1.0
pyupgrade==3.15.0
reorder-python-imports==3.12.0
2 changes: 1 addition & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: Install Python modules
run: |
pip install --constraint=.github/workflows/constraints.txt pre-commit black flake8 reorder-python-imports
pip install --constraint=.github/workflows/constraints.txt pre-commit ruff
- name: Run pre-commit on all files
run: |
Expand Down
20 changes: 4 additions & 16 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,12 @@ repos:
- id: trailing-whitespace
- repo: local
hooks:
- id: black
name: black
entry: black
- id: ruff
name: ruff
entry: ruff
language: system
types: [python]
require_serial: true
- id: flake8
name: flake8
entry: flake8
language: system
types: [python]
require_serial: true
- id: reorder-python-imports
name: Reorder python imports
entry: reorder-python-imports
language: system
types: [python]
args: [--application-directories=custom_components]
args: [--fix]
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.2.1
hooks:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ async def test_setup_unload_and_reload_entry(hass, bypass_get_data, skip_api_sta
)

# Unload the entry and verify that the data has been removed
assert await async_unload_entry(hass, config_entry)
await async_unload_entry(hass, config_entry)
assert config_entry.entry_id not in hass.data[DOMAIN]


Expand Down

0 comments on commit afac37d

Please sign in to comment.