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
16 changes: 16 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,22 @@ on:
pull_request:

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Install development dependencies
run: python -m pip install -e ".[dev]"
- name: Check lint with Ruff
continue-on-error: true
run: ruff check .
- name: Check formatting with Ruff
continue-on-error: true
run: ruff format --check .

test:
name: ${{ matrix.os }} py${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
Expand Down
14 changes: 14 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,20 @@ python -m pytest -q

Supported Python: 3.9+.

### Linting and formatting

Install the development dependencies, then run Ruff before opening a pull
request:

```bash
ruff check .
ruff format --check .
```

Ruff currently runs in advisory mode while existing violations are addressed
incrementally. New and modified Python files should follow its lint and format
output.

## Curriculum Changes

Every exercise is five artifacts that must stay in sync:
Expand Down
21 changes: 21 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ Documentation = "https://pythonlings.abhik.ai/"
dev = [
"pytest>=7.0",
"pytest-asyncio>=0.21",
"ruff==0.16.4",
]

[project.scripts]
Expand All @@ -77,3 +78,23 @@ packages = ["pythonlings"]
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "function"
testpaths = ["tests"]

[tool.ruff]
line-length = 80
target-version = "py39"
include = ["*.py", "*.pyi", "pyproject.toml"]
extend-exclude = [
"exercises",
"solutions",
"tests/fixtures",
]

[tool.ruff.lint]
select = [
"E4",
"E7",
"E9",
"E501",
"F",
"I",
]
Loading