Skip to content

Commit

Permalink
Merge pull request #1068 from eth-brownie/chore/update-linters
Browse files Browse the repository at this point in the history
Update linters
  • Loading branch information
iamdefinitelyahuman authored Apr 20, 2021
2 parents f7a657b + 4c520f1 commit 9d8d009
Show file tree
Hide file tree
Showing 17 changed files with 90 additions and 75 deletions.
9 changes: 2 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,13 @@ repos:
hooks:
- id: check-yaml

- repo: https://github.com/asottile/seed-isort-config
rev: v2.2.0
hooks:
- id: seed-isort-config

- repo: https://github.com/pre-commit/mirrors-isort
rev: v4.3.21
rev: v5.8.0
hooks:
- id: isort

- repo: https://github.com/psf/black
rev: 19.10b0
rev: 20.8b1
hooks:
- id: black
name: black
Expand Down
2 changes: 1 addition & 1 deletion brownie/convert/datatypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class Wei(int):
* a large float in scientific notation, where direct conversion to int
would cause inaccuracy: 8.3e32
* bytes: b'\xff\xff'
* hex strings: "0x330124\""""
* hex strings: "0x330124\" """

# Known typing error: https://github.com/python/mypy/issues/4290
def __new__(cls, value: Any) -> Any: # type: ignore
Expand Down
2 changes: 1 addition & 1 deletion brownie/network/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def __init__(self, name: str, address: Optional[str], event_data: List, pos: Tup
def __getitem__(self, key: Union[int, str]) -> List:
"""if key is int: returns the n'th event that was fired with this name
if key is str: returns the value of data field 'key' from the 1st event
within the container """
within the container"""
if not isinstance(key, (int, str)):
raise TypeError(f"Invalid key type '{type(key)}' - can only use strings or integers")
if isinstance(key, int):
Expand Down
4 changes: 1 addition & 3 deletions brownie/network/gas/strategies.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,7 @@ class ExponentialScalingStrategy(TimeGasStrategy):
Number of seconds between transactions
"""

def __init__(
self, initial_gas_price: int, max_gas_price: int, time_duration: int = 30,
):
def __init__(self, initial_gas_price: int, max_gas_price: int, time_duration: int = 30):
super().__init__(time_duration)
self.initial_gas_price = initial_gas_price
self.max_gas_price = max_gas_price
Expand Down
2 changes: 1 addition & 1 deletion brownie/network/transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ def _confirmed_trace(self, trace: Sequence) -> None:
fn = contract.get_method_object(self.input)
self._return_value = fn.decode_output(data)

def _reverted_trace(self, trace: Sequence,) -> None:
def _reverted_trace(self, trace: Sequence) -> None:
self._modified_state = False
if self.contract_address:
step = next((i for i in trace if i["op"] == "CODECOPY"), None)
Expand Down
2 changes: 1 addition & 1 deletion brownie/project/compiler/solidity.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def compile_from_input_json(
print(f" EVM Version: {input_json['settings']['evmVersion'].capitalize()}")

try:
return solcx.compile_standard(input_json, allow_paths=allow_paths,)
return solcx.compile_standard(input_json, allow_paths=allow_paths)
except solcx.exceptions.SolcError as e:
raise CompilerError(e, "solc")

Expand Down
2 changes: 1 addition & 1 deletion brownie/test/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def pytest_addoption(parser):
help="Only run or skip stateful tests (default: run all tests)",
)
parser.addoption(
"--failfast", action="store_true", help="Fail hypothesis tests quickly (no shrinking)",
"--failfast", action="store_true", help="Fail hypothesis tests quickly (no shrinking)"
)
parser.addoption(
"--network",
Expand Down
2 changes: 1 addition & 1 deletion brownie/utils/docopt.py
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@ def parse_seq(tokens: Tokens, options: List[Option]) -> List[Pattern]:

def parse_atom(tokens: Tokens, options: List[Option]) -> List[Pattern]:
"""atom ::= '(' expr ')' | '[' expr ']' | 'options'
| longer | shorts | argument | command ;
| longer | shorts | argument | command ;
"""
token = tokens.current()
if not token:
Expand Down
13 changes: 6 additions & 7 deletions brownie/utils/toposort.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,10 @@ def __init__(self, data):

def toposort(data):
"""Dependencies are expressed as a dictionary whose keys are items
and whose values are a set of dependent items. Output is a list of
sets in topological order. The first set consists of items with no
dependences, each subsequent set consists of items that depend upon
items in the preceeding sets.
"""
and whose values are a set of dependent items. Output is a list of
sets in topological order. The first set consists of items with no
dependences, each subsequent set consists of items that depend upon
items in the preceeding sets."""

# Special case empty input.
if len(data) == 0:
Expand Down Expand Up @@ -83,8 +82,8 @@ def toposort(data):

def toposort_flatten(data, sort=True):
"""Returns a single list of dependencies. For any set returned by
toposort(), those items are sorted and appended to the result (just to
make the results deterministic)."""
toposort(), those items are sorted and appended to the result (just to
make the results deterministic)."""

result = []
for d in toposort(data):
Expand Down
2 changes: 1 addition & 1 deletion requirements-dev.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ bumpversion
coverage
flake8
isort
mypy
mypy==0.720
pip-tools
pytest-cov
pytest-mock
Expand Down
53 changes: 32 additions & 21 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ click==7.1.2
# via
# -c requirements.txt
# pip-tools
coverage==5.2.1
colorama==0.4.4
# via twine
coverage==5.5
# via
# -r requirements-dev.in
# pytest-cov
Expand All @@ -48,40 +50,45 @@ docutils==0.16
# via
# readme-renderer
# sphinx
# sphinx-rtd-theme
filelock==3.0.12
# via
# tox
# virtualenv
flake8==3.8.3
flake8==3.9.1
# via -r requirements-dev.in
idna==2.10
# via
# -c requirements.txt
# requests
imagesize==1.2.0
# via sphinx
importlib-metadata==3.7.3
# via keyring
importlib-metadata==4.0.0
# via
# keyring
# twine
iniconfig==1.1.1
# via
# -c requirements.txt
# pytest
isort==4.3.21
isort==5.8.0
# via -r requirements-dev.in
jeepney==0.6.0
# via
# keyring
# secretstorage
jinja2==2.11.3
# via sphinx
keyring==23.0.0
keyring==23.0.1
# via twine
markupsafe==1.1.1
# via jinja2
mccabe==0.6.1
# via flake8
mypy-extensions==0.4.3
# via mypy
# via
# -c requirements.txt
# mypy
mypy==0.720
# via -r requirements-dev.in
packaging==20.9
Expand All @@ -93,7 +100,7 @@ packaging==20.9
# tox
pep517==0.10.0
# via pip-tools
pip-tools==6.0.1
pip-tools==6.1.0
# via -r requirements-dev.in
pkginfo==1.7.0
# via twine
Expand All @@ -107,11 +114,11 @@ py==1.10.0
# -c requirements.txt
# pytest
# tox
pycodestyle==2.6.0
pycodestyle==2.7.0
# via flake8
pycparser==2.20
# via cffi
pyflakes==2.2.0
pyflakes==2.3.1
# via flake8
pygments==2.8.1
# via
Expand All @@ -122,9 +129,9 @@ pyparsing==2.4.7
# via
# -c requirements.txt
# packaging
pytest-cov==2.10.1
pytest-cov==2.11.1
# via -r requirements-dev.in
pytest-mock==3.3.1
pytest-mock==3.5.1
# via -r requirements-dev.in
pytest==6.2.3
# via
Expand All @@ -143,6 +150,8 @@ requests==2.25.1
# requests-toolbelt
# sphinx
# twine
rfc3986==1.4.0
# via twine
secretstorage==3.3.1
# via keyring
six==1.15.0
Expand All @@ -154,9 +163,9 @@ six==1.15.0
# virtualenv
snowballstemmer==2.1.0
# via sphinx
sphinx-rtd-theme==0.5.0
sphinx-rtd-theme==0.5.2
# via -r requirements-dev.in
sphinx==3.2.1
sphinx==3.5.4
# via
# -r requirements-dev.in
# sphinx-rtd-theme
Expand All @@ -178,29 +187,31 @@ toml==0.10.2
# pep517
# pytest
# tox
tox==3.19.0
tox==3.23.0
# via -r requirements-dev.in
tqdm==4.53.0
tqdm==4.60.0
# via
# -c requirements.txt
# twine
twine==3.1.1
twine==3.4.1
# via -r requirements-dev.in
typed-ast==1.4.2
typed-ast==1.4.3
# via
# -c requirements.txt
# mypy
typing-extensions==3.7.4.3
# via mypy
# via
# -c requirements.txt
# mypy
urllib3==1.26.4
# via
# -c requirements.txt
# requests
virtualenv==20.4.3
virtualenv==20.4.4
# via tox
webencodings==0.5.1
# via bleach
wheel==0.35.1
wheel==0.36.2
# via -r requirements-dev.in
zipp==3.4.1
# via importlib-metadata
Expand Down
28 changes: 18 additions & 10 deletions requirements-windows.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ asttokens==2.0.4
attrs==20.3.0
# via
# -r requirements.txt
# black
# hypothesis
# jsonschema
# pytest
Expand All @@ -31,7 +30,7 @@ bitarray==1.2.2
# via
# -r requirements.txt
# eth-account
black==19.10b0
black==20.8b1
# via -r requirements.txt
certifi==2020.12.5
# via
Expand Down Expand Up @@ -64,7 +63,7 @@ eth-account==0.5.4
# web3
eth-event==1.2.3
# via -r requirements.txt
eth-hash[pycryptodome]==0.2.0
eth-hash[pycryptodome]==0.3.1
# via
# -r requirements.txt
# eth-event
Expand All @@ -90,12 +89,13 @@ eth-typing==2.2.2
# eth-keys
# eth-utils
# web3
eth-utils==1.9.5
eth-utils==1.10.0
# via
# -r requirements.txt
# eth-abi
# eth-account
# eth-event
# eth-hash
# eth-keyfile
# eth-keys
# eth-rlp
Expand Down Expand Up @@ -144,6 +144,10 @@ multiaddr==0.0.9
# via
# -r requirements.txt
# ipfshttpclient
mypy-extensions==0.4.3
# via
# -r requirements.txt
# black
mythx-models==1.9.1
# via
# -r requirements.txt
Expand All @@ -168,9 +172,9 @@ pluggy==0.13.1
# via
# -r requirements.txt
# pytest
prompt-toolkit==3.0.8
prompt-toolkit==3.0.18
# via -r requirements.txt
protobuf==3.15.6
protobuf==3.15.8
# via
# -r requirements.txt
# web3
Expand All @@ -191,7 +195,7 @@ pycryptodome==3.10.1
# eth-hash
# eth-keyfile
# vyper
pygments-lexer-solidity==0.5.1
pygments-lexer-solidity==0.7.0
# via -r requirements.txt
pygments==2.8.1
# via
Expand Down Expand Up @@ -231,7 +235,7 @@ pythx==1.6.1
# via -r requirements.txt
pyyaml==5.4.1
# via -r requirements.txt
regex==2020.11.13
regex==2021.4.4
# via
# -r requirements.txt
# black
Expand Down Expand Up @@ -277,9 +281,13 @@ toolz==0.11.1
# via
# -r requirements.txt
# cytoolz
tqdm==4.53.0
tqdm==4.60.0
# via -r requirements.txt
typed-ast==1.4.2
typed-ast==1.4.3
# via
# -r requirements.txt
# black
typing-extensions==3.7.4.3
# via
# -r requirements.txt
# black
Expand Down
4 changes: 2 additions & 2 deletions requirements.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
black==19.10b0
black==20.8b1
eth-abi<3
eth-account<1
eth-event>=1.2.1,<2
Expand All @@ -16,7 +16,7 @@ pygments<3
pytest-xdist<2
pytest<7
python-dotenv>=0.16.0,<0.17.0
pythx<2
pythx<=1.6.1
pyyaml>=5.3.0,<6
requests>=2.25.0,<3
rlp<2
Expand Down
Loading

0 comments on commit 9d8d009

Please sign in to comment.