Skip to content

Commit

Permalink
moved lint W503 to tox config
Browse files Browse the repository at this point in the history
  • Loading branch information
pratik-vii authored and kclowes committed Oct 12, 2020
1 parent 7c0e93f commit 1464074
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 16 deletions.
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@

extras_require['dev'] = (
extras_require['tester']
+ extras_require['linter'] # noqa: W503
+ extras_require['docs'] # noqa: W503
+ extras_require['dev'] # noqa: W503
+ extras_require['linter']
+ extras_require['docs']
+ extras_require['dev']
)

setup(
Expand Down
2 changes: 1 addition & 1 deletion tests/core/eth-module/test_accounts.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ def test_eth_account_sign(acct,
message = encode_defunct(text=message_text)
signed_message = Web3.keccak(
b"\x19Ethereum Signed Message:\n"
+ bytes(f"{len(message.body)}", encoding='utf-8') + message.body # noqa: W503
+ bytes(f"{len(message.body)}", encoding='utf-8') + message.body
)
assert signed_message == expected_hash

Expand Down
10 changes: 5 additions & 5 deletions tests/core/gas-strategies/test_time_based_gas_price_strategy.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def _get_block_by_something(method, params):
block_identifier = params[0]
if (
block_identifier == 'latest'
or block_identifier == '0x5' # noqa: W503
or block_identifier == '0x5'
):
return {
'hash': '0x0000000000000000000000000000000000000000000000000000000000000005',
Expand All @@ -39,7 +39,7 @@ def _get_block_by_something(method, params):
}
elif (
block_identifier == '0x0000000000000000000000000000000000000000000000000000000000000004'
or block_identifier == '0x4' # noqa: W503
or block_identifier == '0x4'
):
return {
'hash': '0x0000000000000000000000000000000000000000000000000000000000000004',
Expand All @@ -55,7 +55,7 @@ def _get_block_by_something(method, params):
}
elif (
block_identifier == '0x0000000000000000000000000000000000000000000000000000000000000003'
or block_identifier == '0x3' # noqa: W503
or block_identifier == '0x3'
):
return {
'hash': '0x0000000000000000000000000000000000000000000000000000000000000003',
Expand All @@ -69,7 +69,7 @@ def _get_block_by_something(method, params):
}
elif (
block_identifier == '0x0000000000000000000000000000000000000000000000000000000000000002'
or block_identifier == '0x2' # noqa: W503
or block_identifier == '0x2'
):
return {
'hash': '0x0000000000000000000000000000000000000000000000000000000000000002',
Expand All @@ -82,7 +82,7 @@ def _get_block_by_something(method, params):
}
elif (
block_identifier == '0x0000000000000000000000000000000000000000000000000000000000000001'
or block_identifier == '0x1' # noqa: W503
or block_identifier == '0x1'
):
return {
'hash': '0x0000000000000000000000000000000000000000000000000000000000000001',
Expand Down
2 changes: 1 addition & 1 deletion tests/ethpm/test_contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def test_linkable_contract_class_handles_missing_link_refs(get_manifest, w3):
],
{"SafeSendLib": SAFE_SEND_CANON, "SafeMathLib": SAFE_MATH_CANON},
b"\00" + SAFE_SEND_CANON + bytearray(4) + SAFE_MATH_CANON
+ bytearray(5) + SAFE_SEND_CANON + bytearray(10), # noqa: W503
+ bytearray(5) + SAFE_SEND_CANON + bytearray(10),
),
),
)
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use_parentheses=True
[flake8]
max-line-length= 100
exclude= venv*,.tox,docs,build
ignore=
ignore=W503
[testenv]
whitelist_externals=/usr/bin/make
install_command=python -m pip install --no-use-pep517 {opts} {packages}
Expand Down
2 changes: 1 addition & 1 deletion web3/_utils/abi.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def filter_by_name(name: str, contract_abi: ABI) -> List[Union[ABIFunction, ABIE
in contract_abi
if (
abi['type'] not in ('fallback', 'constructor', 'receive')
and abi['name'] == name # noqa: W503
and abi['name'] == name
)
]

Expand Down
2 changes: 1 addition & 1 deletion web3/contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -1510,7 +1510,7 @@ def call_contract_function(
# eth-abi-utils
is_missing_code_error = (
return_data in ACCEPTABLE_EMPTY_STRINGS
and web3.eth.getCode(address) in ACCEPTABLE_EMPTY_STRINGS) # noqa: W503
and web3.eth.getCode(address) in ACCEPTABLE_EMPTY_STRINGS)
if is_missing_code_error:
msg = (
"Could not transact with/call contract function, is contract "
Expand Down
4 changes: 2 additions & 2 deletions web3/middleware/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -414,8 +414,8 @@ def middleware(method: RPCEndpoint, params: Any) -> RPCResponse:
try:
should_try_cache = (
lock_acquired
and method in rpc_whitelist # noqa: W503
and not _is_latest_block_number_request(method, params) # noqa: W503
and method in rpc_whitelist
and not _is_latest_block_number_request(method, params)
)
if should_try_cache:
_update_block_info_cache()
Expand Down
2 changes: 1 addition & 1 deletion web3/middleware/filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def iter_latest_block(

is_bounded_range = (
to_block is not None
and to_block != "latest" # noqa: W503
and to_block != "latest"
)

while True:
Expand Down

0 comments on commit 1464074

Please sign in to comment.