Skip to main content

SemVer automation CLI based on PR title

Project description

Bifrons

CLI para automação de versões SemVer baseada em títulos de PR/commit.

Descrição

O Bifrons analisa o título de uma PR ou commit e incrementa automaticamente a versão seguindo as regras do Semantic Versioning (SemVer). Ele classifica o título em:

  • patch (correções): títulos começando com "fix"
  • minor (novos recursos): títulos começando com "feat" ou "feature"
  • major (mudanças incompatíveis): títulos começando com "breaking", "major" ou contendo "breaking change"

A versão atual é lida/escrita no arquivo version.txt no diretório atual.

Instalação

  1. Certifique-se de ter Python 3.8+ instalado.
  2. Clone o repositório e instale em modo editável:
    git clone https://github.com/Kalimbinha/Bifrons.git
    cd Bifrons
    pip install -e .
    

Uso

Execute o comando com o título da PR/commit:

bifrons --title "fix: correção de bug"

Exemplos

  • Patch (correção):

    bifrons --title "fix: resolve memory leak"
    

    Saída:

    [bifrons] versão anterior: 1.0.0
    [bifrons] nova versão: 1.0.1
    
  • Minor (novo recurso):

    bifrons --title "feat: add dark mode"
    

    Saída:

    [bifrons] versão anterior: 1.0.1
    [bifrons] nova versão: 1.1.0
    
  • Major (mudança incompatível):

    bifrons --title "breaking: remove deprecated API"
    

    Saída:

    [bifrons] versão anterior: 1.1.0
    [bifrons] nova versão: 2.0.0
    
  • Título inválido:

    bifrons --title "random title"
    

    Saída:

    Erro: Título inválido! Use fix/feat/major
    

Arquivo de Versão

  • O arquivo version.txt é criado automaticamente se não existir (inicia com 0.0.0).
  • Ele contém apenas a versão atual (ex.: 1.2.3).
  • Execute no diretório onde deseja gerenciar a versão.

Desenvolvimento

  • Estrutura do Projeto:

    Bifrons/
    ├── bifrons/
    │   ├── __init__.py
    │   ├── cli.py       # Interface de linha de comando
    │   └── core.py      # Lógica principal
    ├── pyproject.toml   # Configuração do projeto
    ├── README.md        # Este arquivo
    └── version.txt      # Arquivo de versão (gerado)
    
  • Testes: Execute pytest para rodar os testes em tests/.

  • Linting: Use black bifrons/ para formatar o código.

Autor

Fernando Barreto (kalimbinhaa@gmail.com)

Licença

MIT License. Veja o arquivo LICENSE para detalhes.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bifrons-1.0.0.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bifrons-1.0.0-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file bifrons-1.0.0.tar.gz.

File metadata

  • Download URL: bifrons-1.0.0.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for bifrons-1.0.0.tar.gz
Algorithm Hash digest
SHA256 01d2546ce2f4eab2f83def1ae3f4b3c72d81e06941c56bc25ac72156003b1619
MD5 799f03a7ae2ecc436e8664d673a01097
BLAKE2b-256 4b9f0777571b0512351408c93855dcceb6c09718ce04aeabe44450aac0621777

See more details on using hashes here.

File details

Details for the file bifrons-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: bifrons-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 4.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for bifrons-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 668f53c90e19def6e249d5d436885aeadce96503943ddff357e4b9e42a42610a
MD5 2d6e22335bd227f7aeb86539f7a14cdf
BLAKE2b-256 6e1c085c8928731da79c1555617edd4877c5cc7b63284ce29d7d335a974c78be

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page