diff --git a/src/python/review/inspectors/flake8/flake8.py b/src/python/review/inspectors/flake8/flake8.py index 5745a75f..c5dfd274 100644 --- a/src/python/review/inspectors/flake8/flake8.py +++ b/src/python/review/inspectors/flake8/flake8.py @@ -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' @@ -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, diff --git a/src/python/review/inspectors/flake8/whitelist.txt b/src/python/review/inspectors/flake8/whitelist.txt new file mode 100644 index 00000000..47340d90 --- /dev/null +++ b/src/python/review/inspectors/flake8/whitelist.txt @@ -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