OPT add linting workflow #3
25
.gitea/workflows/lint.yaml
Normal file
25
.gitea/workflows/lint.yaml
Normal file
@ -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/
|
||||||
@ -29,3 +29,15 @@ build-backend = "setuptools.build_meta"
|
|||||||
|
|
||||||
[tool.setuptools]
|
[tool.setuptools]
|
||||||
packages = ["src"]
|
packages = ["src"]
|
||||||
|
|
||||||
|
[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"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user