Skip to content

Commit 26f2712

Browse files
committed
chore: hygiene (.gitignore, LICENSE, Dependabot, CodeQL, CI, pre-commit); remove venv
1 parent e46b93b commit 26f2712

8 files changed

Lines changed: 127 additions & 29 deletions

File tree

.github/dependabot.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "pip"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
7+
- package-ecosystem: "github-actions"
8+
directory: "/"
9+
schedule:
10+
interval: "weekly"

.github/workflows/ci.yml

Lines changed: 16 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,23 @@
1-
name: CI/CD Pipeline
2-
1+
name: CI
32
on:
43
push:
5-
branches:
6-
- main
74
pull_request:
8-
branches:
9-
- main
10-
115
jobs:
12-
test:
6+
build:
137
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
python-version: ["3.10","3.11","3.12"]
1411
steps:
15-
- name: Checkout Código
16-
uses: actions/checkout@v3
17-
18-
- name: Configurar Python
19-
uses: actions/setup-python@v3
12+
- uses: actions/checkout@v4
13+
- uses: actions/setup-python@v5
2014
with:
21-
python-version: '3.9'
22-
23-
- name: Instalar Dependências
24-
run: |
25-
python -m pip install --upgrade pip
26-
pip install -r requirements.txt || true
27-
28-
- name: Rodar Testes
29-
run: pytest tests/ || echo "Testes falharam, mas o workflow continua."
30-
31-
deploy:
32-
needs: test
33-
runs-on: ubuntu-latest
34-
steps:
35-
- name: Deploy para Produção
36-
run: echo "Deploy realizado com sucesso!"
15+
python-version: ${{ matrix.python-version }}
16+
- run: python -m pip install -U pip
17+
- run: |
18+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
19+
pip install black ruff pytest
20+
- run: black --check .
21+
- run: ruff check .
22+
- run: |
23+
if ls **/*.py 1> /dev/null 2>&1; then pytest -q || true; fi

.github/workflows/codeql.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: "CodeQL"
2+
on:
3+
push:
4+
branches: ["main", "master"]
5+
pull_request:
6+
branches: ["main", "master"]
7+
schedule:
8+
- cron: "23 2 * * 2"
9+
jobs:
10+
analyze:
11+
permissions:
12+
actions: read
13+
contents: read
14+
security-events: write
15+
runs-on: ubuntu-latest
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
language: [ "python" ]
20+
steps:
21+
- uses: actions/checkout@v4
22+
- uses: github/codeql-action/init@v3
23+
with:
24+
languages: ${{ matrix.language }}
25+
- uses: github/codeql-action/analyze@v3

.gitignore

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Python
2+
venv/
3+
.env
4+
__pycache__/
5+
*.pyc
6+
*.pyo
7+
*.pyd
8+
*.sqlite3
9+
*.db
10+
.coverage
11+
htmlcov/
12+
dist/
13+
build/
14+
*.egg-info/
15+
.mypy_cache/
16+
pytest_cache/
17+
.ipynb_checkpoints/
18+
19+
# Node (se houver frontend no mesmo repo)
20+
node_modules/
21+
.cache/
22+
.vite/
23+
dist/
24+
25+
# OS
26+
.DS_Store
27+
Thumbs.db

.pre-commit-config.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
repos:
2+
- repo: https://github.com/psf/black
3+
rev: 24.8.0
4+
hooks:
5+
- id: black
6+
- repo: https://github.com/astral-sh/ruff-pre-commit
7+
rev: v0.6.9
8+
hooks:
9+
- id: ruff
10+
args: [--fix]

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Sidinei Schaedler
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.

pyproject.toml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
[project]
2+
name = "app"
3+
version = "0.1.0"
4+
requires-python = ">=3.10"
5+
6+
[tool.black]
7+
line-length = 100
8+
target-version = ["py310","py311","py312"]
9+
10+
[tool.ruff]
11+
line-length = 100
12+
select = ["E","F","I","UP","B","SIM"]
13+
ignore = ["E501"]
14+
15+
[tool.pytest.ini_options]
16+
addopts = "-q"

requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
flask
2+
pytest

0 commit comments

Comments
 (0)