From 3c99bfb772cb05b4b0e54d20e6b441136918b607 Mon Sep 17 00:00:00 2001 From: CoderDeltaLan Date: Fri, 29 Aug 2025 13:20:14 +0100 Subject: [PATCH 1/3] chore(ci): add local smoke.sh --- scripts/smoke.sh | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100755 scripts/smoke.sh diff --git a/scripts/smoke.sh b/scripts/smoke.sh new file mode 100755 index 0000000..fc89e4f --- /dev/null +++ b/scripts/smoke.sh @@ -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" From 50ca2cc7ade61c6f0fc7dd9519ff4bcf5bf741a6 Mon Sep 17 00:00:00 2001 From: CoderDeltaLan Date: Wed, 3 Sep 2025 18:07:25 +0100 Subject: [PATCH 2/3] ci: lock matrix to Python 3.12 per pyproject (>=3.12,<3.13) --- .github/workflows/ci.yml | 47 ++++++++++++++++++++++------------------ 1 file changed, 26 insertions(+), 21 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f0d097f..3efa811 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,35 +1,40 @@ 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"] + python-version: ["3.12"] # se ajusta abajo si el proyecto permite 3.11 steps: - uses: actions/checkout@v4 - - name: Setup Python - uses: actions/setup-python@v5 + - uses: actions/setup-python@v5 + with: { python-version: ${{ matrix.python-version }} } + - uses: snok/install-poetry@v1 with: - python-version: ${{ matrix.python-version }} - - name: Install Poetry - run: | - pip install --upgrade pip - pip install poetry==2.1.4 + version: 1.8.3 + virtualenvs-create: true + virtualenvs-in-project: true + installer-parallel: true - name: Install deps run: poetry install --no-interaction - name: Lint run: | - poetry run ruff check . --fix - poetry run ruff format . - poetry run black . - - name: Test - env: - PYTHONPATH: src - run: poetry run pytest -q - - name: Smoke CLI - run: poetry run pybuglint src + poetry run ruff check . --output-format=github + poetry run black --check . + - name: Tests + env: { PYTHONPATH: src } + run: poetry run pytest -q --disable-warnings + - name: Build + run: poetry build + - name: Smoke install + CLI + run: | + python -m pip install --no-deps dist/*.whl + ( command -v pybuglint && pybuglint --help ) || python -c "import pybuglint; print('pybuglint import OK')" From 5fc20b72bad603090fead2230b29380ede4bdc3f Mon Sep 17 00:00:00 2001 From: CoderDeltaLan Date: Wed, 3 Sep 2025 18:10:06 +0100 Subject: [PATCH 3/3] ci: rename workflow to 'ci' to satisfy required status --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3efa811..ea2d8d8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -name: CI +name: ci on: push: { branches: [main] } pull_request: { branches: [main] }