Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/python/review/inspectors/flake8/flake8.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
logger = logging.getLogger(__name__)

PATH_FLAKE8_CONFIG = Path(__file__).parent / '.flake8'
# To make the whitelist, a list of words was examined based on students' solutions
# that were flagged by flake8-spellcheck as erroneous. In general, the whitelist included those words
# that belonged to library methods and which were common abbreviations.
PATH_FLAKE8_SPELLCHECK_WHITELIST = Path(__file__).parent / 'whitelist.txt'
FORMAT = '%(path)s:%(row)d:%(col)d:%(code)s:%(text)s'
INSPECTOR_NAME = 'flake8'

Expand All @@ -34,6 +38,7 @@ def inspect(cls, path: Path, config: dict) -> List[BaseIssue]:
'flake8',
f'--format={FORMAT}',
f'--config={PATH_FLAKE8_CONFIG}',
f'--whitelist={PATH_FLAKE8_SPELLCHECK_WHITELIST}',
'--max-complexity', '0',
'--cohesion-below', '100',
path,
Expand Down
127 changes: 127 additions & 0 deletions src/python/review/inspectors/flake8/whitelist.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
aggfunc
appendleft
argmax
asctime
astype
betavariate
birthdate
blackbox
bs4
byteorder
calc
capwords
casefold
caseless
concat
consts
coord
copysign
csgraph
ctime
dataframe
dataframes
dataset
datasets
decrypted
dedent
deque
desc
devs
df
dicts
dirs
divmod
dtype
edu
eig
elems
etree
expm1
falsy
fillna
floordiv
fromstring
fullmatch
gensim
gmtime
groupby
halfs
hashable
href
hyp
hyperskill
iadd
iloc
inplace
ints
isalnum
isalpha
isin
islice
islower
isnumeric
isprintable
istitle
isub
iterrows
kcal
kcals
lastname
lemmatize
lemmatizer
lifes
lim
linalg
linspace
lowercased
lvl
lxml
matmul
multiline
ndarray
ndigits
ndim
nltk
nrows
numpy
nums
ost
param
params
parsers
pathlib
popleft
pos
punct
readline
rfind
rindex
rmdir
schur
scipy
sigmoid
sqrt
src
stemmer
stepik
subdicts
subdir
subdirs
substr
substring
textwrap
todos
tokenize
tokenized
tokenizer
tolist
tracklist
truediv
truthy
unpickled
upd
util
utils
webpage
whitespaces
writeback