Skip to content

Commit

Permalink
fix flake8 errors
Browse files Browse the repository at this point in the history
  • Loading branch information
cdump committed Jan 9, 2022
1 parent af4218f commit d6b35bc
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
7 changes: 3 additions & 4 deletions .flake8
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
[isort]
line_length = 79

[flake8]
max-line-length = 200

max-imports = 16

min-name-length = 1

max-line-complexity = 24
max-line-complexity = 25

max-string-usages = 16

Expand Down Expand Up @@ -44,6 +41,7 @@ ignore =
WPS202, # too many module members
WPS218, # too many asserts, useful for tests/
WPS226, # Found string constant over-use
WPS237, # too complex `f` string
WPS301, # dotted raw import
WPS305, # f-strings
WPS306, # class without a base class
Expand All @@ -52,5 +50,6 @@ ignore =
WPS323, # '%' strings, too many false-positives (strptime, ...)
WPS420, # allow 'pass' (but also 'global','local' & 'del')
WPS421, # allow 'print()' function
WPS454, # wrong `raise` exception type: Exception
WPS602, # @staticmethod
S314, S405, # allow xml.etree.ElementTree
2 changes: 2 additions & 0 deletions .isort.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[settings]
line_length = 128
5 changes: 2 additions & 3 deletions investments/data_providers/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,5 @@ def get(self) -> Optional[pandas.DataFrame]:
return pandas.read_pickle(self._cache_file)

def put(self, df: pandas.DataFrame):
if self._cache_file is None:
return None
df.to_pickle(self._cache_file)
if self._cache_file is not None:
df.to_pickle(self._cache_file)
2 changes: 1 addition & 1 deletion investments/data_providers/cbr.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import datetime
import logging
import xml.etree.ElementTree as ET # type: ignore
import xml.etree.ElementTree as ET # noqa:N817
from typing import Dict, List, Optional, Tuple

import pandas # type: ignore
Expand Down
2 changes: 1 addition & 1 deletion investments/ibtax/ibtax.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from investments.interests import Interest
from investments.money import Money
from investments.report_parsers.ib import InteractiveBrokersReportParser
from investments.trades_fifo import TradesAnalyzer, FinishedTrade, PortfolioElement # noqa: I001
from investments.trades_fifo import FinishedTrade, PortfolioElement, TradesAnalyzer


def apply_round_for_dataframe(source: pandas.DataFrame, columns: Iterable, digits: int = 2) -> pandas.DataFrame:
Expand Down
2 changes: 1 addition & 1 deletion investments/report_parsers/open_fr.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import datetime
import re
import xml.etree.ElementTree as ET # type: ignore
import xml.etree.ElementTree as ET # noqa:N817
from typing import List, Optional

from investments.currency import Currency
Expand Down

0 comments on commit d6b35bc

Please sign in to comment.