diff --git a/.github/dependabot.yml b/.github/dependabot.yaml similarity index 100% rename from .github/dependabot.yml rename to .github/dependabot.yaml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 1a1480a..0000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,22 +0,0 @@ -on: # yamllint disable-line rule:truthy - pull_request: - branches: ["main"] - -permissions: - contents: read - -jobs: - yamllint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: karancode/yamllint-github-action@v2.1.1 - ruff: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Set up Python 3.11 - uses: actions/setup-python@v5 - with: - python-version: "3.11" - - uses: chartboost/ruff-action@v1 diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml new file mode 100644 index 0000000..3b8b976 --- /dev/null +++ b/.github/workflows/lint.yaml @@ -0,0 +1,46 @@ +name: Lint +on: # yamllint disable-line rule:truthy + pull_request: + branches: ["main"] + +permissions: + checks: write + contents: read + issues: write + pull-requests: write + +jobs: + just: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: extractions/setup-just@v1 + with: + just-version: "1.24.0" + - name: Format justfile + run: just --fmt --unstable + - uses: reviewdog/action-suggester@v1 + with: + tool_name: just + ruff: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up Python 3.11 + uses: actions/setup-python@v5 + with: + python-version: "3.11" + - uses: chartboost/ruff-action@v1 + with: + args: format + - uses: chartboost/ruff-action@v1 + with: + args: check --fix + - uses: reviewdog/action-suggester@v1 + with: + tool_name: ruff + yamllint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: karancode/yamllint-github-action@v2.1.1 diff --git a/.gitignore b/.gitignore index ba75c9d..8b9b0e6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ __pycache__/ .ruff_cache/ +.pytest_cache/ venv/ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fa2a603..5049b07 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -12,6 +12,18 @@ repos: - id: pretty-format-json exclude: ^.vscode/.*\.json$ - id: trailing-whitespace + - repo: local + hooks: + - id: just + entry: just --fmt --unstable + files: | + (?x)^( + .justfile| + justfile + )$ + language: system + name: just + pass_filenames: false - repo: https://github.com/jazzband/pip-tools rev: 7.4.0 hooks: diff --git a/.vscode/settings.json b/.vscode/settings.json index 3fa2e28..dfde84d 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -19,6 +19,7 @@ "ifdef", "ifndef", "inplace", + "justfile", "microcontroller", "microcontrollers", "MOSI", diff --git a/README.adoc b/README.adoc index aa279e6..12fbdce 100644 --- a/README.adoc +++ b/README.adoc @@ -17,7 +17,6 @@ endif::[] :pre-commit: https://pre-commit.com/[pre-commit] :pipkin: https://github.com/aivarannamaa/pipkin[pipkin] -image:https://github.com/jwillikers/fan-controller/actions/workflows/ci.yml/badge.svg["CI", link="https://github.com/jwillikers/fan-controller/actions/workflows/ci.yml"] image:https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white[pre-commit, link=https://github.com/pre-commit/pre-commit] image:https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json[Ruff, link=https://github.com/astral-sh/ruff]