Skip to content

Commit bddb682

Browse files
committed
ci: stabilize supply-chain workflow; format pre-commit config
1 parent 0247401 commit bddb682

File tree

3 files changed

+42
-52
lines changed

3 files changed

+42
-52
lines changed

.github/workflows/supply-chain.yml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
name: supply-chain
2+
23
on:
34
schedule:
45
- cron: "0 6 * * 1"
@@ -34,41 +35,42 @@ jobs:
3435
runs-on: ubuntu-latest
3536
steps:
3637
- uses: actions/checkout@v5
37-
- uses: actions/setup-python@v5
38+
39+
- uses: actions/setup-python@v6
3840
with:
3941
python-version: "3.12"
42+
cache: "pip"
43+
4044
- name: Python gates
4145
run: |
4246
set -e
4347
python -m pip install --upgrade pip
44-
pip install poetry
45-
poetry install --no-interaction
46-
poetry run ruff check .
47-
poetry run black --check .
48-
poetry run pytest -q
48+
pip install ruff black pytest
49+
ruff check .
50+
black --check .
51+
pytest -q || rc=$?; if [ "${rc:-0}" -eq 5 ]; then rc=0; fi; exit "$rc"
52+
4953
- uses: actions/setup-node@v4
5054
with:
5155
node-version: "20"
5256
cache: "npm"
57+
5358
- name: Node/TS gates
5459
if: ${{ hashFiles('package.json') != '' }}
5560
run: |
5661
set -e
5762
npm ci
5863
npx prettier -c .
59-
# ESLint sólo si está declarado en deps
6064
if node -e "p=require('./package.json'); process.exit(!((p.devDependencies&&p.devDependencies.eslint)||(p.dependencies&&p.dependencies.eslint)))"; then
6165
npx eslint --max-warnings=0 .
6266
else
6367
echo 'eslint not listed; skipping lint'
6468
fi
65-
# TSC sólo si hay tsconfig y typescript en deps
6669
if [ -f tsconfig.json ] && node -e "p=require('./package.json'); process.exit(!((p.devDependencies&&p.devDependencies.typescript)||(p.dependencies&&p.dependencies.typescript)))"; then
6770
npx tsc --noEmit
6871
else
6972
echo 'tsconfig/typescript not found; skipping typecheck'
7073
fi
71-
# Tests JS opcionales (no bloquean si no hay scripts)
7274
if node -e "p=require('./package.json'); process.exit(!p.scripts||!p.scripts.test)"; then
7375
echo 'no npm test script; skipping'
7476
else

.pre-commit-config.yaml

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,30 @@
1-
minimum_pre_commit_version: "3.7.0"
2-
default_stages: [pre-commit]
3-
exclude: ^(node_modules/|dist/|build/|coverage/|\.venv/|venv/|package-lock\.json$|poetry\.lock$)
4-
51
repos:
62
- repo: https://github.com/pre-commit/pre-commit-hooks
73
rev: v4.6.0
84
hooks:
95
- id: end-of-file-fixer
106
- id: trailing-whitespace
117
- id: check-yaml
12-
files: ^\.github/.*\.ya?ml$
8+
- id: check-merge-conflict
139

1410
- repo: https://github.com/psf/black
1511
rev: 24.8.0
1612
hooks:
1713
- id: black
18-
files: ^(src/|tests/).+\.py$
14+
args: ["--line-length=88"]
1915

2016
- repo: https://github.com/astral-sh/ruff-pre-commit
21-
rev: v0.6.4
17+
rev: v0.5.6
2218
hooks:
2319
- id: ruff
24-
args: ["--fix", "--exit-non-zero-on-fix"]
25-
files: ^(src/|tests/).+\.py$
20+
args: ["--fix"]
2621

2722
- repo: local
2823
hooks:
2924
- id: prettier-local
3025
name: prettier (local)
31-
entry: npx --yes prettier --write
26+
entry: bash -lc 'npx prettier -c .'
3227
language: system
33-
files: ^(README\.md|\.github/.*\.ya?ml|eslint\.config\.mjs)$
28+
pass_filenames: false
29+
types_or:
30+
[javascript, jsx, ts, tsx, json, markdown, yaml, css, scss, html]

pyproject.toml

Lines changed: 23 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,42 @@
1+
[build-system]
2+
requires = ["poetry-core>=1.8.0"]
3+
build-backend = "poetry.core.masonry.api"
4+
15
[tool.poetry]
26
name = "ci-matrix-starter"
3-
version = "0.1.7"
4-
description = "Reusable CI workflows for Py/TS with SBOM & signatures."
5-
authors = ["CoderDeltaLAN <[email protected]>"]
7+
version = "0.1.0"
8+
description = "Starter de CI matrix (Poetry + src layout)"
9+
authors = ["CoderDeltaLAN"]
610
readme = "README.md"
11+
license = "MIT"
712
packages = [{ include = "ci_matrix_starter", from = "src" }]
813

914
[tool.poetry.dependencies]
10-
python = "^3.11"
15+
python = ">=3.11,<4.0"
1116

1217
[tool.poetry.group.dev.dependencies]
13-
pytest = "^8.3.0"
14-
<<<<<<< HEAD
15-
pytest-cov = "^5.0.0"
16-
ruff = ">=0.6,<0.14"
17-
black = "^24.10.0"
18-
||||||| 0e59d81
19-
pytest-cov = "^5.0.0"
20-
ruff = "^0.6.0"
21-
black = "^24.10.0"
22-
=======
23-
pytest-cov = ">=5,<8"
24-
ruff = "^0.6.0"
25-
black = ">=24.10,<26.0"
26-
>>>>>>> origin/main
18+
black = "^24.8.0"
19+
ruff = "^0.5.6"
20+
pytest = "^8.3.2"
2721
mypy = "^1.11.0"
28-
types-setuptools = "*"
2922

3023
[tool.black]
3124
line-length = 88
32-
extend-exclude = '''
25+
target-version = ["py311", "py312"]
26+
exclude = """
3327
(
34-
^node_modules/
35-
| ^\.venv/
36-
| ^dist/
28+
/_ci_local
3729
)
38-
'''
30+
"""
3931

4032
[tool.ruff]
4133
line-length = 88
42-
extend-exclude = ["node_modules", ".venv", "dist"]
34+
target-version = "py311"
35+
extend-exclude = ["_ci_local"]
4336

44-
[tool.mypy]
45-
python_version = "3.11"
46-
strict = false
47-
packages = ["ci_matrix_starter"]
37+
[tool.ruff.lint]
38+
select = ["E","F","I","UP","B"]
4839

49-
[build-system]
50-
requires = ["poetry-core"]
51-
build-backend = "poetry.core.masonry.api"
40+
[tool.pytest.ini_options]
41+
addopts = "-q"
42+
testpaths = ["tests"]

0 commit comments

Comments
 (0)