From db0c1dcb52eaddb1d39a160fc2c637e8a7b58709 Mon Sep 17 00:00:00 2001 From: Peter Date: Mon, 29 Dec 2025 17:00:39 +0100 Subject: [PATCH] OPT add linting workflow --- .gitea/workflows/lint.yaml | 25 +++++++++++++++++++++++++ pyproject.toml | 12 ++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 .gitea/workflows/lint.yaml diff --git a/.gitea/workflows/lint.yaml b/.gitea/workflows/lint.yaml new file mode 100644 index 0000000..d575923 --- /dev/null +++ b/.gitea/workflows/lint.yaml @@ -0,0 +1,25 @@ +name: Lint and Format + +on: + pull_request: + branches: + - main + push: + branches: + - main + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Install uv + uses: astral-sh/setup-uv@v5 + + - name: Check formatting with ruff + run: uvx ruff format --check src/ + + - name: Lint with ruff + run: uvx ruff check src/ diff --git a/pyproject.toml b/pyproject.toml index 123a4b2..63daeeb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -19,3 +19,15 @@ dependencies = [ "opentelemetry-exporter-otlp>=1.27.0", "opentelemetry-instrumentation-requests>=0.48b0", ] + +[tool.ruff] +line-length = 100 +target-version = "py314" + +[tool.ruff.lint] +select = ["E", "F", "I", "UP", "B", "SIM"] +ignore = [] + +[tool.ruff.format] +quote-style = "double" +indent-style = "space"