Skip to content

Commit 3bd9d0c

Browse files
authored
Merge pull request #46 from akretion/UPD_FIX-pre_commit_libs
[UPD+FIX] Atualizando as bibliotecas do Pre-commit e corrigido conflito entre validações
2 parents ef4324e + 59ffa9c commit 3bd9d0c

6 files changed

Lines changed: 21 additions & 15 deletions

File tree

.pre-commit-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,20 @@
55
exclude: '^(\.tox|ci/templates|\.bumpversion\.cfg)(/|$)'
66
repos:
77
- repo: https://github.com/pre-commit/pre-commit-hooks
8-
rev: v4.4.0
8+
rev: v4.5.0
99
hooks:
1010
- id: trailing-whitespace
1111
- id: end-of-file-fixer
1212
- id: debug-statements
1313
- repo: https://github.com/timothycrosley/isort
14-
rev: 5.12.0
14+
rev: 5.13.2
1515
hooks:
1616
- id: isort
1717
- repo: https://github.com/psf/black
18-
rev: 23.3.0
18+
rev: 23.12.1
1919
hooks:
2020
- id: black
2121
- repo: https://github.com/pycqa/flake8
22-
rev: 6.0.0
22+
rev: 7.0.0
2323
hooks:
2424
- id: flake8

README.rst

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,6 @@ Overview
1818
:target: https://readthedocs.org/projects/erpbrasilbase
1919
:alt: Documentation Status
2020

21-
.. |travis| image:: https://api.travis-ci.org/erpbrasil/erpbrasil.base.svg?branch=master
22-
:alt: Travis-CI Build Status
23-
:target: https://travis-ci.org/erpbrasil/erpbrasil.base
24-
2521
.. |appveyor| image:: https://ci.appveyor.com/api/projects/status/github/erpbrasil/erpbrasil.base?branch=master&svg=true
2622
:alt: AppVeyor Build Status
2723
:target: https://ci.appveyor.com/project/erpbrasil/erpbrasil.base

ci/bootstrap.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def exec_in_env():
3535
check_call([bin_path / "pip", "install", "jinja2", "tox"])
3636
python_executable = bin_path / "python"
3737
if not python_executable.exists():
38-
python_executable = python_executable.with_suffix('.exe')
38+
python_executable = python_executable.with_suffix(".exe")
3939

4040
print("Re-executing with: {0}".format(python_executable))
4141
print("+ exec", python_executable, __file__, "--no-env")
@@ -61,16 +61,22 @@ def main():
6161
# This uses sys.executable the same way that the call in
6262
# cookiecutter-pylibrary/hooks/post_gen_project.py
6363
# invokes this bootstrap.py itself.
64-
for line in subprocess.check_output([sys.executable, '-m', 'tox', '--listenvs'], universal_newlines=True).splitlines()
64+
for line in subprocess.check_output(
65+
[sys.executable, "-m", "tox", "--listenvs"], universal_newlines=True
66+
).splitlines()
6567
]
66-
tox_environments = [line for line in tox_environments if line.startswith('py')]
68+
tox_environments = [line for line in tox_environments if line.startswith("py")]
6769

68-
for template in templates_path.rglob('*'):
70+
for template in templates_path.rglob("*"):
6971
if template.is_file():
7072
template_path = str(template.relative_to(templates_path))
7173
destination = base_path / template_path
7274
destination.parent.mkdir(parents=True, exist_ok=True)
73-
destination.write_text(jinja.get_template(template_path).render(tox_environments=tox_environments))
75+
destination.write_text(
76+
jinja.get_template(template_path).render(
77+
tox_environments=tox_environments
78+
)
79+
)
7480
print("Wrote {}".format(template_path))
7581
print("DONE.")
7682

setup.cfg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ universal = 1
55
[flake8]
66
max-line-length = 140
77
exclude = */migrations/*
8+
# Conflito entre o Black e Flake8
9+
# https://black.readthedocs.io/en/stable/the_black_code_style/current_style.html#slices
10+
# This behaviour may raise E203 whitespace before ':' warnings in style guide enforcement tools like Flake8. Since E203 is not PEP 8 compliant, you should tell Flake8 to ignore these warnings.
11+
extend-ignore = E203
812

913
[tool:pytest]
1014
testpaths = tests

src/erpbrasil/base/fiscal/edoc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ def partes(self, num_partes=11):
347347
).format(num_partes)
348348

349349
salto = 44 // num_partes
350-
return [self._campos[n: (n + salto)] for n in range(0, 44, salto)]
350+
return [self._campos[n : (n + salto)] for n in range(0, 44, salto)]
351351

352352

353353
class ChaveCFeSAT(ChaveEdoc):

src/erpbrasil/base/gs1/gtin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def calcula_dv(gs1_code, code_length):
1515
prod = [3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3]
1616

1717
# get the product with some gs1_code length
18-
gs1_prod = prod[len(prod) - len(gs1_code):]
18+
gs1_prod = prod[len(prod) - len(gs1_code) :]
1919

2020
while len(gs1_code) < code_length:
2121
r = sum([x * y for (x, y) in zip(gs1_code, gs1_prod)]) % 10

0 commit comments

Comments
 (0)