Skip to content

Commit 98a92e1

Browse files
authored
Formata todos os arquivos para o padrão do Ruff e coloca verificação no CI (#417)
- Created requirements-dev.txt to include pytest and ruff for development. - Updated requirements.txt to reference the new requirements-dev.txt for development dependencies. - Modified CI configuration to install development dependencies and check formatting with ruff. - Cleaned up some docstrings and improved code formatting in various files for consistency.
1 parent c549adf commit 98a92e1

File tree

69 files changed

+26137
-13243
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+26137
-13243
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,7 @@ jobs:
66
strategy:
77
fail-fast: false
88
matrix:
9-
python-version: [
10-
"3.8",
11-
"3.9",
12-
"3.10",
13-
"3.11",
14-
"3.12",
15-
"3.13"
16-
]
9+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
1710
steps:
1811
- uses: actions/checkout@v2
1912
- name: Set up Python ${{ matrix.python-version }}
@@ -25,7 +18,9 @@ jobs:
2518
python -m pip install --upgrade pip
2619
pip install -r requirements.txt
2720
pip install -r requirements-nfse.txt
28-
pip install ruff pytest
21+
pip install -r requirements-dev.txt
22+
- name: Check formatting
23+
run: ruff format --check .
2924
- name: Lint
3025
run: ruff check --output-format=github .
3126
- name: Tests

pynfe/entidades/certificado.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def separar_arquivo(self, senha, caminho=False):
7171
except Exception as e:
7272
if "invalid password" in str(e).lower():
7373
raise Exception(
74-
"Falha ao carregar certificado digital A1. Verifique a senha do" " certificado."
74+
"Falha ao carregar certificado digital A1. Verifique a senha do certificado."
7575
) from e
7676
else:
7777
raise Exception(

pynfe/entidades/evento.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# -*- coding: utf-8 -*-
22

33
"""
4-
@author: Junior Tada, Leonardo Tada
4+
@author: Junior Tada, Leonardo Tada
55
"""
66

77
from decimal import Decimal

pynfe/entidades/servico.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
@author: Junior Tada, Leonardo Tada
2+
@author: Junior Tada, Leonardo Tada
33
"""
44

55
from .base import Entidade

pynfe/processamento/autorizador_nfse.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -344,9 +344,7 @@ def consultar_situacao_lote(self, emitente, numero):
344344
id_prestador.Cnpj = emitente.cnpj
345345
id_prestador.InscricaoMunicipal = emitente.inscricao_municipal
346346

347-
consulta = (
348-
servico_consultar_situacao_lote_rps_envio_v03.ConsultarSituacaoLoteRpsEnvio()
349-
)
347+
consulta = servico_consultar_situacao_lote_rps_envio_v03.ConsultarSituacaoLoteRpsEnvio()
350348
consulta.Prestador = id_prestador
351349
consulta.Protocolo = str(numero)
352350

@@ -387,9 +385,7 @@ def serializar_lote_assincrono(self, nfse):
387385
if nfse.servico.aliquota:
388386
valores_servico.Aliquota = nfse.servico.aliquota
389387
if nfse.servico.desconto_incondicionado:
390-
valores_servico.DescontoIncondicionado = (
391-
nfse.servico.desconto_incondicionado
392-
)
388+
valores_servico.DescontoIncondicionado = nfse.servico.desconto_incondicionado
393389
if nfse.servico.desconto_condicionado:
394390
valores_servico.DescontoCondicionado = nfse.servico.desconto_condicionado
395391

@@ -525,9 +521,7 @@ def cancelar_v2(self, nfse):
525521

526522
ns1 = "http://www.ginfes.com.br/servico_cancelar_nfse_envio"
527523
ns2 = "http://www.ginfes.com.br/tipos"
528-
raiz = etree.Element(
529-
"{%s}CancelarNfseEnvio" % ns1, nsmap={"ns1": ns1, "ns2": ns2}
530-
)
524+
raiz = etree.Element("{%s}CancelarNfseEnvio" % ns1, nsmap={"ns1": ns1, "ns2": ns2})
531525
prestador = etree.SubElement(raiz, "{%s}Prestador" % ns1)
532526
etree.SubElement(prestador, "{%s}Cnpj" % ns2).text = nfse.emitente.cnpj
533527
etree.SubElement(

0 commit comments

Comments
 (0)