Skip to content
Closed
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
6 changes: 6 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ jobs:
uv run coverage erase
uv run coverage run -m pytest
uv run coverage report
uv run coverage xml
- name: Upload coverage data
if: always()
uses: actions/upload-artifact@v7
Expand All @@ -66,6 +67,11 @@ jobs:
include-hidden-files: true
if-no-files-found: error
retention-days: 7
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v6
with:
files: coverage.xml
fail_ci_if_error: false

build:
name: Build & audit package
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ build/
.pytest_cache/
.tox/
.coverage
coverage.xml
htmlcov/
.mypy_cache/
.ruff_cache/
Expand Down
23 changes: 23 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Mirrors the lint job in .github/workflows/ci.yml (ruff check, ruff format,
# mypy) so contributors get the same checks locally before pushing.
repos:
- repo: local
hooks:
- id: ruff-check
name: ruff check
entry: uv run ruff check .
language: system
types: [python]
pass_filenames: false
- id: ruff-format
name: ruff format
entry: uv run ruff format --check .
language: system
types: [python]
pass_filenames: false
- id: mypy
name: mypy type check
entry: uv run mypy gcode
language: system
types: [python]
pass_filenames: false
15 changes: 15 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,21 @@ Look for issues labeled [`good first issue`](https://github.com/shauryagangrade/
- Write clean, readable code with descriptive variable names.
- Ensure all tests pass before opening a PR.

## Pre-commit Hooks

Install the hooks once so lint, formatting, and type checks run before every
commit (they mirror the CI lint job):

```bash
uv run pre-commit install
```

Run them on the whole tree any time with:

```bash
uv run pre-commit run --all-files
```

---

## PR Guidelines
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# GCode

![Build](https://github.com/shauryagangrade/GCode/actions/workflows/ci.yml/badge.svg)
[![codecov](https://codecov.io/gh/shauryagangrade/GCode/branch/main/graph/badge.svg)](https://codecov.io/gh/shauryagangrade/GCode)
[![License: Apache 2.0](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](LICENSE)
[![PyPI version](https://img.shields.io/pypi/v/gcode.svg)](https://pypi.org/project/gcode/)
[![Stars](https://img.shields.io/github/stars/shauryagangrade/GCode?style=social)](https://github.com/shauryagangrade/GCode)
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ dev = [
"coverage>=7",
"mypy>=1.13",
"pip-audit>=2.7",
"pre-commit>=4.0",
"pytest>=8",
"ruff>=0.9",
]
Expand Down
Loading