Skip to content

Commit

Permalink
Merge pull request #46 from akretion/UPD_FIX-pre_commit_libs
Browse files Browse the repository at this point in the history
[UPD+FIX] Atualizando as bibliotecas do Pre-commit e corrigido conflito entre validações
  • Loading branch information
mileo authored Dec 10, 2024
2 parents ef4324e + 59ffa9c commit 3bd9d0c
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 15 deletions.
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@
exclude: '^(\.tox|ci/templates|\.bumpversion\.cfg)(/|$)'
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: debug-statements
- repo: https://github.com/timothycrosley/isort
rev: 5.12.0
rev: 5.13.2
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: 23.3.0
rev: 23.12.1
hooks:
- id: black
- repo: https://github.com/pycqa/flake8
rev: 6.0.0
rev: 7.0.0
hooks:
- id: flake8
4 changes: 0 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ Overview
:target: https://readthedocs.org/projects/erpbrasilbase
:alt: Documentation Status

.. |travis| image:: https://api.travis-ci.org/erpbrasil/erpbrasil.base.svg?branch=master
:alt: Travis-CI Build Status
:target: https://travis-ci.org/erpbrasil/erpbrasil.base

.. |appveyor| image:: https://ci.appveyor.com/api/projects/status/github/erpbrasil/erpbrasil.base?branch=master&svg=true
:alt: AppVeyor Build Status
:target: https://ci.appveyor.com/project/erpbrasil/erpbrasil.base
Expand Down
16 changes: 11 additions & 5 deletions ci/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def exec_in_env():
check_call([bin_path / "pip", "install", "jinja2", "tox"])
python_executable = bin_path / "python"
if not python_executable.exists():
python_executable = python_executable.with_suffix('.exe')
python_executable = python_executable.with_suffix(".exe")

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

for template in templates_path.rglob('*'):
for template in templates_path.rglob("*"):
if template.is_file():
template_path = str(template.relative_to(templates_path))
destination = base_path / template_path
destination.parent.mkdir(parents=True, exist_ok=True)
destination.write_text(jinja.get_template(template_path).render(tox_environments=tox_environments))
destination.write_text(
jinja.get_template(template_path).render(
tox_environments=tox_environments
)
)
print("Wrote {}".format(template_path))
print("DONE.")

Expand Down
4 changes: 4 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ universal = 1
[flake8]
max-line-length = 140
exclude = */migrations/*
# Conflito entre o Black e Flake8
# https://black.readthedocs.io/en/stable/the_black_code_style/current_style.html#slices
# 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.
extend-ignore = E203

[tool:pytest]
testpaths = tests
Expand Down
2 changes: 1 addition & 1 deletion src/erpbrasil/base/fiscal/edoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ def partes(self, num_partes=11):
).format(num_partes)

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


class ChaveCFeSAT(ChaveEdoc):
Expand Down
2 changes: 1 addition & 1 deletion src/erpbrasil/base/gs1/gtin.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def calcula_dv(gs1_code, code_length):
prod = [3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3]

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

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

0 comments on commit 3bd9d0c

Please sign in to comment.