misc: add pyupgrade (#58937)
This commit is contained in:
parent
caa40e7e77
commit
f350cf3169
|
@ -0,0 +1,2 @@
|
|||
# trivial: apply pyupgrade (#58937)
|
||||
caa40e7e771b41bd1d164341a2e7f40689cbe4ba
|
|
@ -0,0 +1,8 @@
|
|||
# See https://pre-commit.com for more information
|
||||
# See https://pre-commit.com/hooks.html for more hooks
|
||||
repos:
|
||||
- repo: https://github.com/asottile/pyupgrade
|
||||
rev: v2.20.0
|
||||
hooks:
|
||||
- id: pyupgrade
|
||||
args: ['--keep-percent-format', '--py37-plus']
|
10
README.txt
10
README.txt
|
@ -179,3 +179,13 @@ You can put some configuration in ~/.config/eopayment.init ::
|
|||
order_id : 20201029093825_Vlco55
|
||||
test : True
|
||||
transaction_date : 2020-10-29 09:38:26+00:00
|
||||
|
||||
Code Style
|
||||
==========
|
||||
|
||||
pyupgrade is used to automatically upgrade syntax, using those parameters:
|
||||
|
||||
pyupgrade --keep-percent-format --py37-plus
|
||||
|
||||
There is .pre-commit-config.yaml to use pre-commit to automatically pyupgrade
|
||||
before commits. (execute `pre-commit install` to install the git hook.)
|
||||
|
|
4
tox.ini
4
tox.ini
|
@ -4,7 +4,7 @@
|
|||
# and then run "tox" from this directory.
|
||||
|
||||
[tox]
|
||||
envlist = py3
|
||||
envlist = py3,codestyle
|
||||
toxworkdir = {env:TMPDIR:/tmp}/tox-{env:USER}/eopayment/{env:BRANCH_NAME:}
|
||||
|
||||
[testenv]
|
||||
|
@ -13,6 +13,7 @@ setenv =
|
|||
SETUPTOOLS_USE_DISTUTILS=stdlib
|
||||
commands =
|
||||
py3: py.test {posargs: --junitxml=junit-{envname}.xml --cov-report xml --cov-report html --cov=eopayment/ tests}
|
||||
codestyle: pre-commit run --all-files --show-diff-on-failure
|
||||
usedevelop = True
|
||||
deps = coverage
|
||||
pytest
|
||||
|
@ -21,6 +22,7 @@ deps = coverage
|
|||
mock<4
|
||||
httmock
|
||||
lxml
|
||||
pre-commit
|
||||
|
||||
[pytest]
|
||||
filterwarnings =
|
||||
|
|
Loading…
Reference in New Issue