Skip to content
Merged
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
7 changes: 7 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,10 @@ jobs:

- name: Run tests with coverage
run: just test-coverage

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
file: ./coverage.xml
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
26 changes: 26 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Pre-commit hooks for tinygrid
# Install: uv run pre-commit install
# Run manually: uv run pre-commit run --all-files

repos:
# Use local hooks to respect project configs (ruff.toml, pyrightconfig.json)
- repo: local
hooks:
- id: ruff
name: ruff
entry: uv run ruff check --fix --unsafe-fixes
language: system
types: [python]

- id: ruff-format
name: ruff-format
entry: uv run ruff format
language: system
types: [python]

- id: pyright
name: pyright
entry: uv run pyright
language: system
types: [python]
pass_filenames: false
27 changes: 23 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Tiny Grid

[![CI](https://github.com/kvkenyon/tinygrid/actions/workflows/ci.yml/badge.svg)](https://github.com/kvkenyon/tinygrid/actions)
[![codecov](https://codecov.io/gh/kvkenyon/tinygrid/branch/main/graph/badge.svg)](https://codecov.io/gh/kvkenyon/tinygrid)

A Python SDK for accessing electricity grid data from US Independent System Operators (ISOs).

Expand Down Expand Up @@ -195,19 +196,37 @@ just test
# Run tests with coverage
just test-coverage

# Lint
# Lint and format
just lint

# Format
just format
just lint-fix # Auto-fix lint issues

# Type check
just type-check

# Run all checks
# Run all checks (lint, format, type-check, test)
just check
```

### Pre-commit Hooks

Pre-commit hooks automatically run linting and formatting before each commit to catch issues early.

```bash
# Install hooks (one-time setup after cloning)
just hooks-install

# Run hooks manually on all files
just hooks-run
```

The hooks run:
- **ruff** - Linting with auto-fix
- **ruff-format** - Code formatting
- **pyright** - Type checking

If a hook fails, fix the issues and re-commit. Ruff auto-fixes will be staged automatically.

## License

MIT
Expand Down
Loading
Loading