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
43 changes: 43 additions & 0 deletions .github/workflows/pr-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: PR checks

on:
pull_request:
branches:
- main

jobs:
lint:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v7.0.1

- name: Install ruff
run: python3 -m pip install ruff

- name: Lint scripts
run: ruff check scripts/

validate-data:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v7.0.1

- name: Install catalog tools
run: python3 -m pip install -r requirements.txt

- name: Validate chemistry catalog
run: |
python3 scripts/validate_chemistry_catalog.py \
--catalog data/chemistry-catalog.json

- name: Validate equipment catalog
run: |
python3 scripts/validate_equipment_catalog.py \
--catalog data/equipment-catalog.json \
--index data/equipment-index.json \
--config config/equipment-sources.yml \
--sprites data/equipment-sprites
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
__pycache__/
*.pyc
6 changes: 6 additions & 0 deletions ruff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
target-version = "py311"

[lint]
# Только реальные ошибки (неопределённые имена, неиспользуемые импорты/переменные и т.п.),
# без стилистических правил — они не про баги, а про вкус.
select = ["F"]
3 changes: 2 additions & 1 deletion scripts/build_equipment_catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -2365,7 +2365,8 @@ def build_public_catalog(
if item_id in visited:
continue
visited.add(item_id)
item = items[item_id]
if item_id not in items:
raise RuntimeError(f"Unknown item id reachable from public roots: {item_id}")
public_candidates.add(item_id)
# Every configured product and every reachable content item is public.
# Boxes/crates are no longer silently replaced with their contents.
Expand Down