Skip to content

Commit b3a0dd2

Browse files
committed
add pre-commit
1 parent 3ac9cf9 commit b3a0dd2

File tree

9 files changed

+30
-22
lines changed

9 files changed

+30
-22
lines changed

.pre-commit-config.yaml

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
# To install the git pre-commit hook run:
2-
# pre-commit install
3-
# To update the pre-commit hooks run:
4-
# pre-commit install-hooks
1+
exclude: tests/fixtures
52
exclude: '^(\.tox|ci/templates|\.bumpversion\.cfg)(/|$)'
3+
64
repos:
75
- repo: https://github.com/pre-commit/pre-commit-hooks
86
rev: v4.5.0
@@ -11,14 +9,16 @@ repos:
119
- id: end-of-file-fixer
1210
- id: debug-statements
1311
- repo: https://github.com/asottile/pyupgrade
14-
rev: v3.10.1
12+
rev: v3.15.1
1513
hooks:
1614
- id: pyupgrade
17-
args:
18-
- --keep-percent-format
1915
- repo: https://github.com/astral-sh/ruff-pre-commit
20-
rev: v0.1.3
16+
rev: v0.3.2
2117
hooks:
2218
- id: ruff
23-
args: [--exit-non-zero-on-fix]
19+
args: [ --fix, --show-fixes ]
2420
- id: ruff-format
21+
- repo: https://github.com/PyCQA/doc8
22+
rev: v1.1.1
23+
hooks:
24+
- id: doc8

CONTRIBUTING.rst

+6-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ Bug reports
1111
When `reporting a bug <https://github.com/erpbrasil/erpbrasil.edoc/issues>`_ please include:
1212

1313
* Your operating system name and version.
14-
* Any details about your local setup that might be helpful in troubleshooting.
14+
* Any details about your local setup that might be helpful
15+
in troubleshooting.
1516
* Detailed steps to reproduce the bug.
1617

1718
Documentation improvements
@@ -30,7 +31,8 @@ If you are proposing a feature:
3031

3132
* Explain in detail how it would work.
3233
* Keep the scope as narrow as possible, to make it easier to implement.
33-
* Remember that this is a volunteer-driven project, and that code contributions are welcome :)
34+
* Remember that this is a volunteer-driven project, and that code contributions
35+
are welcome :)
3436

3537
Development
3638
===========
@@ -64,7 +66,8 @@ To set up `erpbrasil.edoc` for local development:
6466
Pull Request Guidelines
6567
-----------------------
6668

67-
If you need some code review or feedback while you're developing the code just make the pull request.
69+
If you need some code review or feedback while you're developing the code just
70+
make the pull request.
6871

6972
For merging, you should:
7073

README.rst

+4-3
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ Overview
4040

4141
.. end-badges
4242
43-
Emissão de documentos fiscais e outras obrigações (NF-E, NFS-E, MDF-E, CT-E, REINF, E-SOCIAL)
43+
Emissão de documentos fiscais e outras obrigações
44+
(NF-E, NFS-E, MDF-E, CT-E, REINF, E-SOCIAL)
4445

4546

4647
Documentação
@@ -68,8 +69,8 @@ Licença
6869
Instalação
6970
==========
7071

71-
Para permitir que a instalação do seu ERP cresça somente com a necessidade do cliente
72-
é possível instalar as dependências da biblioteca de forma opcional:
72+
Para permitir que a instalação do seu ERP cresça somente com a necessidade
73+
do cliente é possível instalar as dependências da biblioteca de forma opcional:
7374

7475
::
7576

docs/usage.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ Usage
44

55
To use erpbrasil.edoc in a project::
66

7-
import erpbrasil.edoc
7+
import erpbrasil.edoc

src/erpbrasil/edoc/__main__.py

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
- https://docs.python.org/2/using/cmdline.html#cmdoption-m
99
- https://docs.python.org/3/using/cmdline.html#cmdoption-m
1010
"""
11+
1112
import sys
1213

1314
from erpbrasil.edoc.cli import main

src/erpbrasil/edoc/cli.py

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
1515
Also see (1) from http://click.pocoo.org/5/setuptools/#setuptools-integration
1616
"""
17+
1718
import sys
1819

1920

src/erpbrasil/edoc/provedores/barueri.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22

33

44
import xml.etree.ElementTree as ET
5-
from lxml import etree
65
from datetime import datetime
76

7+
from lxml import etree
8+
89
from erpbrasil.base import misc
910
from erpbrasil.edoc.nfse import NFSe, ServicoNFSe
1011

@@ -67,12 +68,14 @@ def get_documento_id(self, edoc):
6768
def _prepara_envia_documento(self, edoc):
6869
numero_lote = self._gera_numero_lote()
6970
xml_string, xml_etree = self._generateds_to_string_etree(edoc)
70-
root = etree.Element("NFeLoteEnviarArquivo", xmlns="http://www.barueri.sp.gov.br/nfe")
71+
root = etree.Element(
72+
"NFeLoteEnviarArquivo", xmlns="http://www.barueri.sp.gov.br/nfe"
73+
)
7174
versao_schema = etree.SubElement(root, "VersaoSchema")
7275
versao_schema.text = "1"
7376
mensagem_xml = etree.SubElement(root, "MensagemXML")
7477
mensagem_xml.text = etree.CDATA(xml_string)
75-
edoc.ApenasValidaArq = 'lote' + numero_lote
78+
edoc.ApenasValidaArq = "lote" + numero_lote
7679
return root
7780

7881
def _prepara_consulta_recibo(self, proc_envio):

src/erpbrasil/edoc/provedores/issnet.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,8 @@ def _prepara_cancelar_nfse_envio(self, doc_numero):
165165
xml_assinado = (
166166
'<?xml version="1.0"?>'
167167
"<p1:CancelarNfseEnvio "
168-
'xmlns:p1="http://www.issnetonline.com.br/webserviceabrasf/vsd/servico_cancelar_nfse_envio.xsd" ' # noqa: E501
169-
'xmlns:tc="http://www.issnetonline.com.br/webserviceabrasf/vsd/tipos_complexos.xsd" ' # noqa: E501
168+
'xmlns:p1="http://www.issnetonline.com.br/webserviceabrasf/vsd/servico_cancelar_nfse_envio.xsd" '
169+
'xmlns:tc="http://www.issnetonline.com.br/webserviceabrasf/vsd/tipos_complexos.xsd" '
170170
'xmlns:ts="http://www.issnetonline.com.br/webserviceabrasf/vsd/tipos_simples.xsd">'
171171
+ pedido
172172
+ "</p1:CancelarNfseEnvio>"

tox.ini

-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ commands =
4343

4444
[testenv:check]
4545
deps =
46-
docutils
4746
check-manifest
4847
readme-renderer
4948
pygments

0 commit comments

Comments
 (0)