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
19 changes: 19 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,25 @@ on:
pull_request:

jobs:
lint:
name: Lint (Python)
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v6

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.11"

- name: Install ruff
run: pip install ruff

- name: Lint Python (undefined names, syntax errors)
working-directory: libs/openant-core
run: ruff check .

python-tests:
name: Python tests (${{ matrix.os }})
runs-on: ${{ matrix.os }}
Expand Down
2 changes: 1 addition & 1 deletion libs/openant-core/core/analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ def _usage_dict():

# Inject prior usage into tracker so step_report captures the total
if _summary_input_tokens or _summary_output_tokens:
tracker.add_prior_usage(
get_global_tracker().add_prior_usage(
_summary_input_tokens, _summary_output_tokens, _summary_cost_usd)

# Write initial summary
Expand Down
9 changes: 9 additions & 0 deletions libs/openant-core/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ dependencies = [
[project.optional-dependencies]
dev = [
"pytest>=8.0.0",
"ruff>=0.8.0",
]

[project.scripts]
Expand All @@ -30,6 +31,14 @@ openant = "openant.cli:main"
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.ruff]
target-version = "py311"

[tool.ruff.lint]
# Only rules that catch actual bugs (will break at runtime)
# F821: undefined name, F811: redefined unused name, F823: local var referenced before assignment
select = ["F821", "F811", "F823"]

[tool.hatch.build.targets.wheel]
packages = [
"openant",
Expand Down
Loading