From 1a3c1267bb9cf2c316e20e65d2ecbd9d099ce47b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vit=C3=B3rio=20A=2E=20Cavalheiro?= Date: Fri, 10 Oct 2025 10:38:04 -0300 Subject: [PATCH 1/2] chore: add pre-commit configuration and update dev dependencies Add pre-commit hooks for code quality checks including trailing whitespace, end-of-file fixes, YAML validation, large file checks, Black formatting, isort imports, Flake8 linting, and Pylint analysis. Update pyproject.toml with corresponding dev dependencies for flake8, pylint, and pre-commit. --- .pre-commit-config.yaml | 29 +++++++++++++++++++++++++++++ pyproject.toml | 3 +++ 2 files changed, 32 insertions(+) create mode 100644 .pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..50cfcce --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,29 @@ +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v6.0.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + - id: check-yaml + - id: check-added-large-files + + - repo: https://github.com/psf/black + rev: 25.9.0 + hooks: + - id: black + + - repo: https://github.com/pycqa/isort + rev: 6.1.0 + hooks: + - id: isort + + - repo: https://github.com/pycqa/flake8 + rev: 7.3.0 + hooks: + - id: flake8 + + - repo: https://github.com/pycqa/pylint + rev: v3.3.9 + hooks: + - id: pylint + args: [--rcfile=.pylintrc] diff --git a/pyproject.toml b/pyproject.toml index 73f6dc8..2faf85b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,6 +15,9 @@ reportlab = "4.2.*" [tool.poetry.group.dev.dependencies] black = "24.4.*" isort = "*" +flake8 = "*" +pylint = "*" +pre-commit = "*" detect-secrets = "1.5.0" [build-system] From 242ce16c386f207bc8ae3f5005492c3597ebab32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vit=C3=B3rio=20A=2E=20Cavalheiro?= Date: Fri, 10 Oct 2025 10:48:49 -0300 Subject: [PATCH 2/2] ci: update branch deletion to use API call in delete-branch workflow The change replaces `gh branch delete` with a direct GitHub API DELETE request for more reliable branch deletion in the CI workflow. --- .github/workflows/delete-branch.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/delete-branch.yml b/.github/workflows/delete-branch.yml index 56d5a61..842424c 100644 --- a/.github/workflows/delete-branch.yml +++ b/.github/workflows/delete-branch.yml @@ -13,7 +13,6 @@ jobs: runs-on: ubuntu-latest steps: - name: Delete merged branch - run: gh branch delete ${{ github.head_ref }} + run: gh api -X DELETE repos/${{ github.repository }}/git/refs/heads/${{ github.head_ref }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - \ No newline at end of file