Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,9 @@ updates:
interval: daily
time: "06:00"
open-pull-requests-limit: 10
- package-ecosystem: "uv"
directory: "/"
schedule:
interval: daily
time: "06:00"
open-pull-requests-limit: 10
36 changes: 36 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: CI

on:
pull_request:
branches:
- main
push:
branches:
- main

permissions: {}

jobs:
ci:
runs-on: ubuntu-latest
name: Lint and test
steps:
- name: Checkout the repository
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false

- name: Set up uv
uses: astral-sh/setup-uv@1c37ad07a6a961277cf70c0d37d6f313000f5884 # v10.3.0

- name: Install dependencies
run: uv sync --locked

- name: Lint
run: uv run ruff check --no-fix

- name: Check formatting
run: uv run ruff format --check

- name: Test
run: uv run pytest
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
result
error
data
dummy
dummy
.venv/
__pycache__/
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.14
1 change: 1 addition & 0 deletions hacs_action/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Repository validation action for HACS."""
13 changes: 13 additions & 0 deletions hacs_action/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
"""Entry point for the HACS action."""

import sys


def main() -> int:
"""Run the action and return the exit code."""
sys.stdout.write("The Python implementation of the HACS action has no checks yet.\n")
return 0


if __name__ == "__main__":
sys.exit(main())
54 changes: 54 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
[project]
name = "hacs-action"
version = "0.0.0"
description = "Repository validation action for HACS"
requires-python = ">=3.14"
dependencies = []

[dependency-groups]
dev = [
"pytest==9.1.1",
"ruff==0.17.1",
]

[tool.uv]
package = false

[tool.pytest.ini_options]
pythonpath = ["."]
testpaths = ["tests"]


[tool.ruff]
fix = true
line-length = 100
show-fixes = true
target-version = "py314"

[tool.ruff.lint]
select = ["ALL"]
ignore = [
# Conflicts with the ruff formatter.
"COM812",
# Files don't carry copyright headers.
"CPY001",
# Contradict D211 and D212.
"D203",
"D213",
]

fixable = ["ALL"]
unfixable = []


[tool.ruff.lint.per-file-ignores]
# pytest relies on plain assert statements.
"tests/**" = ["S101"]


[tool.ruff.lint.isort]
combine-as-imports = true
force-sort-within-sections = true
known-first-party = [
"hacs_action",
]
1 change: 1 addition & 0 deletions tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Tests for the HACS action."""
8 changes: 8 additions & 0 deletions tests/test_main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
"""Tests for the entry point."""

from hacs_action.__main__ import main


def test_main_succeeds() -> None:
"""The placeholder entry point exits successfully."""
assert main() == 0
108 changes: 108 additions & 0 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading