-
-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
70ced97
commit 7cfecd0
Showing
10 changed files
with
127 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,109 @@ | ||
# See https://pre-commit.com for more information | ||
# See https://pre-commit.com/hooks.html for more hooks | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.5.0 | ||
- repo: local | ||
hooks: | ||
- id: ruff-check | ||
name: 🐶 Ruff Linter | ||
language: system | ||
types: [python] | ||
entry: scripts/run-in-env.sh ruff check --fix | ||
require_serial: true | ||
stages: [commit, push, manual] | ||
- id: ruff-format | ||
name: 🐶 Ruff Formatter | ||
language: system | ||
types: [python] | ||
entry: scripts/run-in-env.sh ruff format | ||
require_serial: true | ||
stages: [commit, push, manual] | ||
- id: check-ast | ||
name: 🐍 Check Python AST | ||
language: system | ||
types: [python] | ||
entry: scripts/run-in-env.sh check-ast | ||
- id: check-case-conflict | ||
name: 🔠 Check for case conflicts | ||
language: system | ||
entry: scripts/run-in-env.sh check-case-conflict | ||
- id: check-docstring-first | ||
name: ℹ️ Check docstring is first | ||
language: system | ||
types: [python] | ||
entry: scripts/run-in-env.sh check-docstring-first | ||
- id: check-executables-have-shebangs | ||
name: 🧐 Check that executables have shebangs | ||
language: system | ||
types: [text, executable] | ||
entry: scripts/run-in-env.sh check-executables-have-shebangs | ||
stages: [commit, push, manual] | ||
- id: check-json | ||
name: { Check JSON files | ||
language: system | ||
types: [json] | ||
entry: scripts/run-in-env.sh check-json | ||
files: ^(custom_components/mass)/.+\.json$ | ||
- id: check-yaml | ||
name: { Check YAML files | ||
language: system | ||
types: [yaml] | ||
entry: scripts/run-in-env.sh check-yaml | ||
- id: check-merge-conflict | ||
name: 💥 Check for merge conflicts | ||
language: system | ||
types: [text] | ||
entry: scripts/run-in-env.sh check-merge-conflict | ||
- id: check-symlinks | ||
name: 🔗 Check for broken symlinks | ||
language: system | ||
types: [symlink] | ||
entry: scripts/run-in-env.sh check-symlinks | ||
- id: check-toml | ||
name: ✅ Check TOML files | ||
language: system | ||
types: [toml] | ||
entry: scripts/run-in-env.sh check-toml | ||
- id: codespell | ||
name: ✅ Check code for common misspellings | ||
language: system | ||
types: [text] | ||
entry: scripts/run-in-env.sh codespell | ||
- id: detect-private-key | ||
name: 🕵️ Detect Private Keys | ||
language: system | ||
types: [text] | ||
entry: scripts/run-in-env.sh detect-private-key | ||
- id: end-of-file-fixer | ||
- id: trailing-whitespace | ||
name: ⮐ Fix End of Files | ||
language: system | ||
types: [text] | ||
entry: scripts/run-in-env.sh end-of-file-fixer | ||
stages: [commit, push, manual] | ||
- id: no-commit-to-branch | ||
name: 🛑 Don't commit to main branch | ||
language: system | ||
entry: scripts/run-in-env.sh no-commit-to-branch | ||
pass_filenames: false | ||
always_run: true | ||
args: | ||
- --branch=main | ||
- id: debug-statements | ||
- repo: https://github.com/charliermarsh/ruff-pre-commit | ||
rev: 'v0.2.1' | ||
hooks: | ||
- id: ruff | ||
- repo: https://github.com/psf/black | ||
rev: 24.2.0 | ||
hooks: | ||
- id: black | ||
args: | ||
- --safe | ||
- --quiet | ||
- repo: https://github.com/codespell-project/codespell | ||
rev: v2.2.6 | ||
hooks: | ||
- id: codespell | ||
args: [] | ||
exclude_types: [csv, json] | ||
exclude: ^tests/fixtures/ | ||
additional_dependencies: | ||
- tomli | ||
|
||
- repo: local | ||
hooks: | ||
- id: pylint | ||
name: pylint | ||
entry: script/run-in-env.sh pylint -j 0 | ||
language: script | ||
name: 🌟 Starring code with pylint | ||
language: system | ||
types: [python] | ||
files: ^custom_components/mass/.+\.py$ | ||
|
||
# TODO: reinstate mypy after fixing the many issues | ||
entry: scripts/run-in-env.sh pylint | ||
- id: trailing-whitespace | ||
name: ✄ Trim Trailing Whitespace | ||
language: system | ||
types: [text] | ||
entry: scripts/run-in-env.sh trailing-whitespace-fixer | ||
stages: [commit, push, manual] | ||
############################################### | ||
# TODO: enable mypy later | ||
# - id: mypy | ||
# name: mypy | ||
# entry: script/run-in-env.sh mypy | ||
# entry: scripts/run-in-env.sh mypy | ||
# language: script | ||
# types: [python] | ||
# files: ^custom_components/mass/.+\.py$ | ||
# require_serial: true | ||
# files: ^(custom_components/mass|pylint)/.+\.py$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
"""Constants for Music Assistant Component.""" | ||
|
||
import logging | ||
|
||
DOMAIN = "mass" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
"""Base entity model.""" | ||
|
||
from __future__ import annotations | ||
|
||
from typing import TYPE_CHECKING | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
"""Media Source Implementation.""" | ||
|
||
from __future__ import annotations | ||
|
||
from typing import TYPE_CHECKING | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
"""Fixtures for testing.""" | ||
|
||
import pytest | ||
|
||
|
||
|