-
-
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.
Merge branch 'main' of https://github.com/music-assistant/hass-music-…
- Loading branch information
Showing
8 changed files
with
105 additions
and
106 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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
name: Auto approve Dependabot PR's | ||
|
||
on: pull_request_target | ||
|
||
jobs: | ||
auto-approve: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
pull-requests: write | ||
if: github.actor == 'dependabot[bot]' | ||
steps: | ||
- uses: hmarr/auto-approve-action@v4 |
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Pre-commit auto-update | ||
on: | ||
schedule: | ||
- cron: '0 0 * * *' | ||
jobs: | ||
auto-update: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.11' | ||
- name: Install pre-commit | ||
run: pip install pre-commit | ||
- name: Run pre-commit autoupdate | ||
run: pre-commit autoupdate | ||
- name: Create Pull Request | ||
uses: peter-evans/create-pull-request@v6 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
branch: update/pre-commit-autoupdate | ||
title: Auto-update pre-commit hooks | ||
commit-message: Auto-update pre-commit hooks | ||
body: | | ||
Update versions of tools in pre-commit | ||
configs to latest version | ||
labels: dependencies |
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,109 +1,48 @@ | ||
# See https://pre-commit.com for more information | ||
# See https://pre-commit.com/hooks.html for more hooks | ||
repos: | ||
- repo: local | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.5.0 | ||
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 | ||
name: ⮐ Fix End of Files | ||
language: system | ||
types: [text] | ||
entry: scripts/run-in-env.sh end-of-file-fixer | ||
stages: [commit, push, manual] | ||
- id: trailing-whitespace | ||
- 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: 🌟 Starring code with pylint | ||
language: system | ||
name: pylint | ||
entry: script/run-in-env.sh pylint -j 0 | ||
language: script | ||
types: [python] | ||
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 | ||
files: ^custom_components/mass/.+\.py$ | ||
|
||
# TODO: reinstate mypy after fixing the many issues | ||
# - id: mypy | ||
# name: mypy | ||
# entry: scripts/run-in-env.sh mypy | ||
# entry: script/run-in-env.sh mypy | ||
# language: script | ||
# types: [python] | ||
# require_serial: true | ||
# files: ^(custom_components/mass|pylint)/.+\.py$ | ||
# files: ^custom_components/mass/.+\.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
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