Skip to content
Open
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
47 changes: 26 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,40 @@
name: CI
name: ci
on:
push:
branches: [main, feat/**, fix/**, chore/**]
pull_request:
branches: [main]
push: { branches: [main] }
pull_request: { branches: [main] }
workflow_dispatch:

permissions: { contents: read }

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.12"]
matrix: { python-version: ["3.12"] }
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
run: |
pip install --upgrade pip
pip install poetry==2.1.4
- name: Install deps
- uses: snok/install-poetry@v1
with:
version: 1.8.3
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- name: Install
run: poetry install --no-interaction
- name: Lint
run: |
poetry run ruff check . --fix
poetry run ruff format .
poetry run black .
- name: Test
poetry run ruff check . --output-format=github
poetry run black --check .
- name: Tests
env:
PYTHONPATH: src
run: poetry run pytest -q
- name: Smoke CLI
run: poetry run pybuglint src
run: poetry run pytest -q --disable-warnings
- name: Build
run: poetry build
- name: Smoke (CLI o -m)
run: |
python -m pip install dist/*.whl
( command -v pybuglint && pybuglint --help ) || python -m pybuglint --help
44 changes: 44 additions & 0 deletions scripts/smoke.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/usr/bin/env bash
# Smoke tests locales para pybuglint
# No cierra la terminal; sólo devuelve códigos de salida

set -euo pipefail

LOG_DIR="_local_logs/\$(date +%Y%m%d-%H%M%S)"
mkdir -p "\$LOG_DIR"

TMPDIR="\$(mktemp -d)"
trap 'rm -rf "\$TMPDIR"' EXIT

# Archivos de prueba
cat > "\$TMPDIR/good.py" <<'PY'
def ok(a:int,b:int)->int:
return a+b
PY

cat > "\$TMPDIR/bad.py" <<'PY'
def f(a=[]):
print(a)
try:
1/0
except:
pass
x=None
if x==None:
pass
list=3
PY

{
echo "### poetry run pybuglint good.py"
poetry run pybuglint "\$TMPDIR/good.py" || true
echo
echo "### poetry run pybuglint bad.py"
poetry run pybuglint "\$TMPDIR/bad.py" || true
} | tee "\$LOG_DIR/smoke_poetry.txt"

# Asserts básicos
grep -q "Sin hallazgos" "\$LOG_DIR/smoke_poetry.txt"
grep -qi "mutable" "\$LOG_DIR/smoke_poetry.txt"

echo "✓ Smoke OK, logs en \$LOG_DIR"