Skip to content

Commit

Permalink
Remove pylint no-self-use and its disable directives
Browse files Browse the repository at this point in the history
It's been moved to optional checker and we won't activate it. Was not
really useful and switching to static methods in all places would
carry other interesting problems and no positives as shown in: pylint-dev/pylint#5502
  • Loading branch information
LefterisJP committed Feb 6, 2023
1 parent 583a025 commit d81507d
Show file tree
Hide file tree
Showing 65 changed files with 261 additions and 276 deletions.
1 change: 0 additions & 1 deletion .pylint.rc
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ enable=
bad-except-order,
redefined-builtin,
unused-variable,
no-self-use,
import-self,
useless-object-inheritance,
unused-argument,
Expand Down
43 changes: 21 additions & 22 deletions rotkehlchen/api/rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -3978,7 +3978,6 @@ def perform_assets_updates(
)

def get_all_binance_pairs(self, location: Location) -> Response:
# pylint: disable=no-self-use
try:
pairs = list(query_binance_exchange_pairs(location=location).keys())
except InputError as e:
Expand All @@ -4005,12 +4004,12 @@ def get_user_binance_pairs(self, name: str, location: Location) -> Response:
status_code=HTTPStatus.OK,
)

def add_manual_price( # pylint: disable=no-self-use
self,
from_asset: Asset,
to_asset: Asset,
price: Price,
timestamp: Timestamp,
def add_manual_price(
self,
from_asset: Asset,
to_asset: Asset,
price: Price,
timestamp: Timestamp,
) -> Response:
historical_price = HistoricalPrice(
from_asset=from_asset,
Expand All @@ -4027,12 +4026,12 @@ def add_manual_price( # pylint: disable=no-self-use
status_code=HTTPStatus.CONFLICT,
)

def edit_manual_price( # pylint: disable=no-self-use
self,
from_asset: Asset,
to_asset: Asset,
price: Price,
timestamp: Timestamp,
def edit_manual_price(
self,
from_asset: Asset,
to_asset: Asset,
price: Price,
timestamp: Timestamp,
) -> Response:
historical_price = HistoricalPrice(
from_asset=from_asset,
Expand All @@ -4049,21 +4048,21 @@ def edit_manual_price( # pylint: disable=no-self-use
status_code=HTTPStatus.CONFLICT,
)

def get_manual_prices( # pylint: disable=no-self-use
self,
from_asset: Optional[Asset],
to_asset: Optional[Asset],
def get_manual_prices(
self,
from_asset: Optional[Asset],
to_asset: Optional[Asset],
) -> Response:
return api_response(
_wrap_in_ok_result(GlobalDBHandler().get_manual_prices(from_asset, to_asset)),
status_code=HTTPStatus.OK,
)

def delete_manual_price( # pylint: disable=no-self-use
self,
from_asset: Asset,
to_asset: Asset,
timestamp: Timestamp,
def delete_manual_price(
self,
from_asset: Asset,
to_asset: Asset,
timestamp: Timestamp,
) -> Response:
deleted = GlobalDBHandler().delete_manual_price(from_asset, to_asset, timestamp)
if deleted:
Expand Down
Loading

0 comments on commit d81507d

Please sign in to comment.