Skip to content

Commit

Permalink
ci: add pre-commit workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
tito committed Dec 13, 2024
1 parent 2e7339f commit 928fe65
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 3 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/pre_commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: pre-commit

on:
pull_request:
push:
branches: [main]

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: pre-commit/action@v3.0.1
22 changes: 22 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: debug-statements
- id: trailing-whitespace

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.2
hooks:
- id: ruff
args: [--fix]
- id: ruff-format

- repo: https://github.com/compilerla/conventional-pre-commit
rev: v3.6.0
hooks:
- id: conventional-pre-commit
stages: [commit-msg]
args: []
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,18 @@ scope3.include_impact_response = True
response = interact()
print(response.scope3ai.impact)
```

## Development

This project use conventional commits and semantic versioning.

Also:
- [pre-commit](https://pre-commit.com) for code formatting, linting and conventional commit checks
- [uv](https://github.com/astral-sh/uv) for project and dependency management.

### Initial setup

```bash
$ pre-commit install
$ pre-commit install --hook-type commit-msg
```
2 changes: 0 additions & 2 deletions examples/openai-sync-chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ def interact() -> None:


if __name__ == "__main__":
import logging

scope3 = Scope3AI.init(enable_debug_logging=True)

# 1. Using context
Expand Down
2 changes: 1 addition & 1 deletion scope3ai/types.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from pydantic import BaseModel, Field
from typing import Literal, Optional, List
from typing import Optional, List
from uuid import UUID
from enum import Enum
from datetime import datetime, timezone
Expand Down

0 comments on commit 928fe65

Please sign in to comment.