dmlc / gluon-nlp

NLP made easy
https://nlp.gluon.ai/
Apache License 2.0
2.56k stars 538 forks source link

Add flake8 to CI #214

Closed leezu closed 6 years ago

leezu commented 6 years ago

@cclauss has pointed out several issues discoverd by running flake8. We may want to run it on CI too.

Currently the following issues need to be addressed before flake8 will run without errors on CI (or selectively disabled):

./setup.py:5:1: F401 'shutil' imported but unused
./setup.py:6:1: F401 'sys' imported but unused
./docs/conf.py:15:1: F401 'subprocess' imported but unused
./docs/conf.py:15:10: E401 multiple imports on one line
./docs/conf.py:16:1: F401 'shlex' imported but unused
./docs/conf.py:17:1: F401 'recommonmark' imported but unused
./docs/conf.py:18:1: F401 'sphinx_gallery' imported but unused
./docs/conf.py:31:1: E402 module level import not at top of file
./docs/conf.py:84:1: E265 block comment should start with '# '
./docs/conf.py:101:1: E265 block comment should start with '# '
./docs/conf.py:103:1: E265 block comment should start with '# '
./docs/conf.py:120:1: E265 block comment should start with '# '
./docs/conf.py:123:1: E265 block comment should start with '# '
./docs/conf.py:127:1: E265 block comment should start with '# '
./docs/conf.py:131:1: E265 block comment should start with '# '
./docs/conf.py:137:1: E265 block comment should start with '# '
./docs/conf.py:140:1: E265 block comment should start with '# '
./docs/conf.py:187:1: E402 module level import not at top of file
./docs/conf.py:194:1: E302 expected 2 blank lines, found 1
./docs/conf.py:207:1: E122 continuation line missing indentation or outdented
./docs/conf.py:220:1: W391 blank line at end of file
./docs/md2ipynb.py:26:46: E228 missing whitespace around modulo operator
./gluonnlp/__init__.py:27:1: F403 'from .vocab import *' used; unable to detect undefined names
./gluonnlp/_constants.py:34:15: E114 indentation is not a multiple of four (comment)
./gluonnlp/_constants.py:34:15: E116 unexpected indentation (comment)
./gluonnlp/_constants.py:35:15: E114 indentation is not a multiple of four (comment)
./gluonnlp/_constants.py:35:15: E116 unexpected indentation (comment)
./gluonnlp/base.py:30:24: F821 undefined name 'unicode'
./gluonnlp/data/__init__.py:23:1: F403 'from .utils import *' used; unable to detect undefined names
./gluonnlp/data/__init__.py:25:1: F403 'from .registry import *' used; unable to detect undefined names
./gluonnlp/data/__init__.py:27:1: F403 'from .transforms import *' used; unable to detect undefined names
./gluonnlp/data/__init__.py:29:1: F403 'from .sampler import *' used; unable to detect undefined names
./gluonnlp/data/__init__.py:31:1: F403 'from .candidate_sampler import *' used; unable to detect undefined names
./gluonnlp/data/__init__.py:33:1: F403 'from .dataset import *' used; unable to detect undefined names
./gluonnlp/data/__init__.py:35:1: F403 'from .stream import *' used; unable to detect undefined names
./gluonnlp/data/__init__.py:37:1: F403 'from .language_model import *' used; unable to detect undefined names
./gluonnlp/data/__init__.py:39:1: F403 'from .sentiment import *' used; unable to detect undefined names
./gluonnlp/data/__init__.py:41:1: F403 'from .word_embedding_evaluation import *' used; unable to detect undefined names
./gluonnlp/data/__init__.py:43:1: F403 'from .word_embedding_training import *' used; unable to detect undefined names
./gluonnlp/data/__init__.py:45:1: F403 'from .conll import *' used; unable to detect undefined names
./gluonnlp/data/__init__.py:47:1: F403 'from .translation import *' used; unable to detect undefined names
./gluonnlp/data/__init__.py:49:1: F401 '.batchify' imported but unused
./gluonnlp/data/__init__.py:51:1: F403 'from .question_answering import *' used; unable to detect undefined names
./gluonnlp/data/__init__.py:53:12: F405 'utils' may be undefined, or defined from star imports: .candidate_sampler, .conll, .dataset, .language_model, .question_answering, .registry, .sampler, .sentiment, .stream, .transforms, .translation, .utils, .word_embedding_evaluation, .word_embedding_training
./gluonnlp/data/__init__.py:53:28: F405 'transforms' may be undefined, or defined from star imports: .candidate_sampler, .conll, .dataset, .language_model, .question_answering, .registry, .sampler, .sentiment, .stream, .transforms, .translation, .utils, .word_embedding_evaluation, .word_embedding_training
./gluonnlp/data/__init__.py:53:49: F405 'sampler' may be undefined, or defined from star imports: .candidate_sampler, .conll, .dataset, .language_model, .question_answering, .registry, .sampler, .sentiment, .stream, .transforms, .translation, .utils, .word_embedding_evaluation, .word_embedding_training
./gluonnlp/data/__init__.py:54:12: F405 'dataset' may be undefined, or defined from star imports: .candidate_sampler, .conll, .dataset, .language_model, .question_answering, .registry, .sampler, .sentiment, .stream, .transforms, .translation, .utils, .word_embedding_evaluation, .word_embedding_training
./gluonnlp/data/__init__.py:54:30: F405 'language_model' may be undefined, or defined from star imports: .candidate_sampler, .conll, .dataset, .language_model, .question_answering, .registry, .sampler, .sentiment, .stream, .transforms, .translation, .utils, .word_embedding_evaluation, .word_embedding_training
./gluonnlp/data/__init__.py:54:55: F405 'sentiment' may be undefined, or defined from star imports: .candidate_sampler, .conll, .dataset, .language_model, .question_answering, .registry, .sampler, .sentiment, .stream, .transforms, .translation, .utils, .word_embedding_evaluation, .word_embedding_training
./gluonnlp/data/__init__.py:55:12: F405 'word_embedding_evaluation' may be undefined, or defined from star imports: .candidate_sampler, .conll, .dataset, .language_model, .question_answering, .registry, .sampler, .sentiment, .stream, .transforms, .translation, .utils, .word_embedding_evaluation, .word_embedding_training
./gluonnlp/data/__init__.py:55:48: F405 'stream' may be undefined, or defined from star imports: .candidate_sampler, .conll, .dataset, .language_model, .question_answering, .registry, .sampler, .sentiment, .stream, .transforms, .translation, .utils, .word_embedding_evaluation, .word_embedding_training
./gluonnlp/data/__init__.py:56:12: F405 'word_embedding_training' may be undefined, or defined from star imports: .candidate_sampler, .conll, .dataset, .language_model, .question_answering, .registry, .sampler, .sentiment, .stream, .transforms, .translation, .utils, .word_embedding_evaluation, .word_embedding_training
./gluonnlp/data/__init__.py:56:46: F405 'conll' may be undefined, or defined from star imports: .candidate_sampler, .conll, .dataset, .language_model, .question_answering, .registry, .sampler, .sentiment, .stream, .transforms, .translation, .utils, .word_embedding_evaluation, .word_embedding_training
./gluonnlp/data/__init__.py:57:12: F405 'translation' may be undefined, or defined from star imports: .candidate_sampler, .conll, .dataset, .language_model, .question_answering, .registry, .sampler, .sentiment, .stream, .transforms, .translation, .utils, .word_embedding_evaluation, .word_embedding_training
./gluonnlp/data/__init__.py:57:34: F405 'registry' may be undefined, or defined from star imports: .candidate_sampler, .conll, .dataset, .language_model, .question_answering, .registry, .sampler, .sentiment, .stream, .transforms, .translation, .utils, .word_embedding_evaluation, .word_embedding_training
./gluonnlp/data/__init__.py:57:53: F405 'question_answering' may be undefined, or defined from star imports: .candidate_sampler, .conll, .dataset, .language_model, .question_answering, .registry, .sampler, .sentiment, .stream, .transforms, .translation, .utils, .word_embedding_evaluation, .word_embedding_training
./gluonnlp/data/candidate_sampler.py:71:13: E741 ambiguous variable name 'l'
./gluonnlp/data/conll.py:183:17: E127 continuation line over-indented for visual indent
./gluonnlp/data/conll.py:236:17: E127 continuation line over-indented for visual indent
./gluonnlp/data/conll.py:297:17: E127 continuation line over-indented for visual indent
./gluonnlp/data/conll.py:354:17: E127 continuation line over-indented for visual indent
./gluonnlp/data/dataset.py:95:9: E306 expected 1 blank line before a nested definition, found 0
./gluonnlp/data/language_model.py:258:1: E302 expected 2 blank lines, found 1
./gluonnlp/data/language_model.py:305:18: F821 undefined name 'tarfile'
./gluonnlp/data/language_model.py:308:1: E302 expected 2 blank lines, found 1
./gluonnlp/data/registry.py:76:16: E713 test for membership should be 'not in'
./gluonnlp/data/sampler.py:64:79: E502 the backslash is redundant between brackets
./gluonnlp/data/sampler.py:390:25: E127 continuation line over-indented for visual indent
./gluonnlp/data/sampler.py:391:25: E127 continuation line over-indented for visual indent
./gluonnlp/data/stream.py:34:1: E302 expected 2 blank lines, found 1
./gluonnlp/data/stream.py:48:1: E302 expected 2 blank lines, found 1
./gluonnlp/data/stream.py:56:1: E302 expected 2 blank lines, found 1
./gluonnlp/data/stream.py:66:1: E302 expected 2 blank lines, found 1
./gluonnlp/data/stream.py:111:67: E228 missing whitespace around modulo operator
./gluonnlp/data/stream.py:124:84: E228 missing whitespace around modulo operator
./gluonnlp/data/stream.py:129:87: E228 missing whitespace around modulo operator
./gluonnlp/data/stream.py:137:67: E228 missing whitespace around modulo operator
./gluonnlp/data/stream.py:149:1: E302 expected 2 blank lines, found 1
./gluonnlp/data/stream.py:271:1: E302 expected 2 blank lines, found 1
./gluonnlp/data/stream.py:291:90: E502 the backslash is redundant between brackets
./gluonnlp/data/translation.py:175:35: E127 continuation line over-indented for visual indent
./gluonnlp/data/translation.py:177:32: E127 continuation line over-indented for visual indent
./gluonnlp/data/translation.py:191:43: E203 whitespace before ':'
./gluonnlp/data/translation.py:197:77: E502 the backslash is redundant between brackets
./gluonnlp/data/translation.py:222:35: E127 continuation line over-indented for visual indent
./gluonnlp/data/translation.py:225:32: E127 continuation line over-indented for visual indent
./gluonnlp/data/translation.py:269:77: E502 the backslash is redundant between brackets
./gluonnlp/data/translation.py:297:35: E127 continuation line over-indented for visual indent
./gluonnlp/data/translation.py:300:32: E127 continuation line over-indented for visual indent
./gluonnlp/data/translation.py:350:77: E502 the backslash is redundant between brackets
./gluonnlp/data/translation.py:372:35: E127 continuation line over-indented for visual indent
./gluonnlp/data/translation.py:375:32: E127 continuation line over-indented for visual indent
./gluonnlp/data/translation.py:404:77: E502 the backslash is redundant between brackets
./gluonnlp/data/translation.py:429:35: E127 continuation line over-indented for visual indent
./gluonnlp/data/translation.py:432:32: E127 continuation line over-indented for visual indent
./gluonnlp/data/utils.py:38:36: E261 at least two spaces before inline comment
./gluonnlp/data/utils.py:72:1: E302 expected 2 blank lines, found 1
./gluonnlp/data/word_embedding_evaluation.py:104:93: E502 the backslash is redundant between brackets
./gluonnlp/data/word_embedding_evaluation.py:105:90: E502 the backslash is redundant between brackets
./gluonnlp/data/word_embedding_evaluation.py:106:89: E502 the backslash is redundant between brackets
./gluonnlp/embedding/__init__.py:23:1: F403 'from .token_embedding import *' used; unable to detect undefined names
./gluonnlp/embedding/__init__.py:25:1: F401 '.evaluation' imported but unused
./gluonnlp/embedding/__init__.py:27:12: F405 'token_embedding' may be undefined, or defined from star imports: .token_embedding
./gluonnlp/embedding/evaluation.py:39:101: E501 line too long (107 > 100 characters)
./gluonnlp/embedding/evaluation.py:44:101: E501 line too long (104 > 100 characters)
./gluonnlp/embedding/evaluation.py:130:8: E713 test for membership should be 'not in'
./gluonnlp/embedding/evaluation.py:380:67: F821 undefined name 'name'
./gluonnlp/embedding/evaluation.py:439:67: F821 undefined name 'name'
./gluonnlp/embedding/token_embedding.py:459:5: E303 too many blank lines (2)
./gluonnlp/initializer/__init__.py:23:1: F403 'from .initializer import *' used; unable to detect undefined names
./gluonnlp/initializer/__init__.py:25:11: F405 'initializer' may be undefined, or defined from star imports: .initializer
./gluonnlp/loss/__init__.py:23:1: F403 'from .activation_regularizer import *' used; unable to detect undefined names
./gluonnlp/loss/__init__.py:25:11: F405 'activation_regularizer' may be undefined, or defined from star imports: .activation_regularizer
./gluonnlp/loss/activation_regularizer.py:66:42: E261 at least two spaces before inline comment
./gluonnlp/loss/activation_regularizer.py:128:42: E261 at least two spaces before inline comment
./gluonnlp/model/__init__.py:52:1: F403 'from .language_model import *' used; unable to detect undefined names
./gluonnlp/model/__init__.py:54:1: F403 'from .beam_search import *' used; unable to detect undefined names
./gluonnlp/model/__init__.py:56:1: F403 'from .attention_cell import *' used; unable to detect undefined names
./gluonnlp/model/__init__.py:58:1: F403 'from .utils import *' used; unable to detect undefined names
./gluonnlp/model/__init__.py:60:1: F403 'from .parameter import *' used; unable to detect undefined names
./gluonnlp/model/__init__.py:62:1: F403 'from .block import *' used; unable to detect undefined names
./gluonnlp/model/__init__.py:64:1: F403 'from .highway import *' used; unable to detect undefined names
./gluonnlp/model/__init__.py:66:1: F403 'from .convolutional_encoder import *' used; unable to detect undefined names
./gluonnlp/model/__init__.py:68:1: F401 '.train' imported but unused
./gluonnlp/model/__init__.py:70:11: F405 'language_model' may be undefined, or defined from star imports: .attention_cell, .beam_search, .block, .convolutional_encoder, .highway, .language_model, .parameter, .utils
./gluonnlp/model/__init__.py:70:36: F405 'beam_search' may be undefined, or defined from star imports: .attention_cell, .beam_search, .block, .convolutional_encoder, .highway, .language_model, .parameter, .utils
./gluonnlp/model/__init__.py:70:58: F405 'attention_cell' may be undefined, or defined from star imports: .attention_cell, .beam_search, .block, .convolutional_encoder, .highway, .language_model, .parameter, .utils
./gluonnlp/model/__init__.py:71:11: F405 'utils' may be undefined, or defined from star imports: .attention_cell, .beam_search, .block, .convolutional_encoder, .highway, .language_model, .parameter, .utils
./gluonnlp/model/__init__.py:71:27: F405 'parameter' may be undefined, or defined from star imports: .attention_cell, .beam_search, .block, .convolutional_encoder, .highway, .language_model, .parameter, .utils
./gluonnlp/model/__init__.py:71:47: F405 'block' may be undefined, or defined from star imports: .attention_cell, .beam_search, .block, .convolutional_encoder, .highway, .language_model, .parameter, .utils
./gluonnlp/model/__init__.py:71:63: F405 'highway' may be undefined, or defined from star imports: .attention_cell, .beam_search, .block, .convolutional_encoder, .highway, .language_model, .parameter, .utils
./gluonnlp/model/__init__.py:72:11: F405 'convolutional_encoder' may be undefined, or defined from star imports: .attention_cell, .beam_search, .block, .convolutional_encoder, .highway, .language_model, .parameter, .utils
./gluonnlp/model/__init__.py:103:39: F405 'standard_lstm_lm_200' may be undefined, or defined from star imports: .attention_cell, .beam_search, .block, .convolutional_encoder, .highway, .language_model, .parameter, .utils
./gluonnlp/model/__init__.py:104:39: F405 'standard_lstm_lm_650' may be undefined, or defined from star imports: .attention_cell, .beam_search, .block, .convolutional_encoder, .highway, .language_model, .parameter, .utils
./gluonnlp/model/__init__.py:105:40: F405 'standard_lstm_lm_1500' may be undefined, or defined from star imports: .attention_cell, .beam_search, .block, .convolutional_encoder, .highway, .language_model, .parameter, .utils
./gluonnlp/model/__init__.py:106:35: F405 'awd_lstm_lm_1150' may be undefined, or defined from star imports: .attention_cell, .beam_search, .block, .convolutional_encoder, .highway, .language_model, .parameter, .utils
./gluonnlp/model/__init__.py:107:34: F405 'awd_lstm_lm_600' may be undefined, or defined from star imports: .attention_cell, .beam_search, .block, .convolutional_encoder, .highway, .language_model, .parameter, .utils
./gluonnlp/model/__init__.py:111:69: E228 missing whitespace around modulo operator
./gluonnlp/model/attention_cell.py:32:1: E302 expected 2 blank lines, found 1
./gluonnlp/model/beam_search.py:50:49: E261 at least two spaces before inline comment
./gluonnlp/model/beam_search.py:99:13: E127 continuation line over-indented for visual indent
./gluonnlp/model/beam_search.py:155:13: E127 continuation line over-indented for visual indent
./gluonnlp/model/beam_search.py:194:101: E501 line too long (133 > 100 characters)
./gluonnlp/model/beam_search.py:245:28: E127 continuation line over-indented for visual indent
./gluonnlp/model/beam_search.py:269:28: E127 continuation line over-indented for visual indent
./gluonnlp/model/beam_search.py:275:31: E127 continuation line over-indented for visual indent
./gluonnlp/model/beam_search.py:278:16: E127 continuation line over-indented for visual indent
./gluonnlp/model/beam_search.py:385:16: E127 continuation line over-indented for visual indent
./gluonnlp/model/beam_search.py:386:16: E127 continuation line over-indented for visual indent
./gluonnlp/model/block.py:41:65: E228 missing whitespace around modulo operator
./gluonnlp/model/block.py:46:44: E261 at least two spaces before inline comment
./gluonnlp/model/block.py:58:75: E228 missing whitespace around modulo operator
./gluonnlp/model/convolutional_encoder.py:136:52: E261 at least two spaces before inline comment
./gluonnlp/model/highway.py:125:29: E127 continuation line over-indented for visual indent
./gluonnlp/model/language_model.py:73:49: E261 at least two spaces before inline comment
./gluonnlp/model/language_model.py:109:1: E302 expected 2 blank lines, found 1
./gluonnlp/model/language_model.py:139:49: E261 at least two spaces before inline comment
./gluonnlp/model/language_model.py:170:1: E302 expected 2 blank lines, found 1
./gluonnlp/model/language_model.py:236:12: E127 continuation line over-indented for visual indent
./gluonnlp/model/language_model.py:283:12: E127 continuation line over-indented for visual indent
./gluonnlp/model/language_model.py:288:1: E302 expected 2 blank lines, found 1
./gluonnlp/model/language_model.py:325:12: E127 continuation line over-indented for visual indent
./gluonnlp/model/language_model.py:368:12: E127 continuation line over-indented for visual indent
./gluonnlp/model/language_model.py:411:12: E127 continuation line over-indented for visual indent
./gluonnlp/model/language_model.py:416:1: E305 expected 2 blank lines after class or function definition, found 1
./gluonnlp/model/utils.py:27:1: E302 expected 2 blank lines, found 1
./gluonnlp/model/utils.py:102:1: E302 expected 2 blank lines, found 1
./gluonnlp/model/train/__init__.py:26:1: F403 'from .language_model import *' used; unable to detect undefined names
./gluonnlp/model/train/__init__.py:27:1: F403 'from .cache import *' used; unable to detect undefined names
./gluonnlp/model/train/__init__.py:28:1: F403 'from .embedding import *' used; unable to detect undefined names
./gluonnlp/model/train/__init__.py:30:11: F405 'language_model' may be undefined, or defined from star imports: .cache, .embedding, .language_model
./gluonnlp/model/train/__init__.py:30:36: F405 'cache' may be undefined, or defined from star imports: .cache, .embedding, .language_model
./gluonnlp/model/train/__init__.py:30:52: F405 'embedding' may be undefined, or defined from star imports: .cache, .embedding, .language_model
./gluonnlp/model/train/__init__.py:95:18: F405 'CacheCell' may be undefined, or defined from star imports: .cache, .embedding, .language_model
./gluonnlp/model/train/cache.py:27:1: E302 expected 2 blank lines, found 1
./gluonnlp/model/train/cache.py:84:51: E261 at least two spaces before inline comment
./gluonnlp/model/train/cache.py:100:5: E303 too many blank lines (2)
./gluonnlp/model/train/cache.py:100:91: E261 at least two spaces before inline comment
./gluonnlp/model/train/cache.py:100:101: E501 line too long (125 > 100 characters)
./gluonnlp/model/train/cache.py:130:17: E127 continuation line over-indented for visual indent
./gluonnlp/model/train/embedding.py:145:9: E265 block comment should start with '# '
./gluonnlp/model/train/embedding.py:204:9: E265 block comment should start with '# '
./gluonnlp/model/train/embedding.py:485:9: E265 block comment should start with '# '
./gluonnlp/model/train/language_model.py:98:79: E741 ambiguous variable name 'l'
./gluonnlp/model/train/language_model.py:100:44: E741 ambiguous variable name 'l'
./gluonnlp/model/train/language_model.py:120:49: E261 at least two spaces before inline comment
./gluonnlp/model/train/language_model.py:239:49: E261 at least two spaces before inline comment
./gluonnlp/vocab/__init__.py:23:1: F403 'from .vocab import *' used; unable to detect undefined names
./gluonnlp/vocab/__init__.py:24:1: F403 'from .subwords import *' used; unable to detect undefined names
./gluonnlp/vocab/__init__.py:26:11: F405 'vocab' may be undefined, or defined from star imports: .subwords, .vocab
./gluonnlp/vocab/__init__.py:26:27: F405 'subwords' may be undefined, or defined from star imports: .subwords, .vocab
./scripts/language_model/cache_language_model.py:47:46: E251 unexpected spaces around keyword / parameter equals
./scripts/language_model/cache_language_model.py:189:40: E225 missing whitespace around operator
./scripts/language_model/cache_language_model.py:208:52: E228 missing whitespace around modulo operator
./scripts/language_model/cache_language_model.py:209:47: E228 missing whitespace around modulo operator
./scripts/language_model/cache_language_model.py:210:34: E228 missing whitespace around modulo operator
./scripts/language_model/word_language_model.py:54:46: E251 unexpected spaces around keyword / parameter equals
./scripts/language_model/word_language_model.py:237:70: E261 at least two spaces before inline comment
./scripts/language_model/word_language_model.py:237:101: E501 line too long (104 > 100 characters)
./scripts/language_model/word_language_model.py:239:9: E741 ambiguous variable name 'l'
./scripts/language_model/word_language_model.py:240:9: E741 ambiguous variable name 'l'
./scripts/language_model/word_language_model.py:241:9: E741 ambiguous variable name 'l'
./scripts/language_model/word_language_model.py:251:1: E302 expected 2 blank lines, found 1
./scripts/language_model/word_language_model.py:362:21: E741 ambiguous variable name 'l'
./scripts/language_model/word_language_model.py:378:24: E225 missing whitespace around operator
./scripts/language_model/word_language_model.py:388:53: E228 missing whitespace around modulo operator
./scripts/language_model/word_language_model.py:392:76: E228 missing whitespace around modulo operator
./scripts/language_model/word_language_model.py:400:50: E228 missing whitespace around modulo operator
./scripts/language_model/word_language_model.py:405:63: E228 missing whitespace around modulo operator
./scripts/language_model/word_language_model.py:410:12: E225 missing whitespace around operator
./scripts/language_model/word_language_model.py:419:52: E228 missing whitespace around modulo operator
./scripts/language_model/word_language_model.py:420:47: E228 missing whitespace around modulo operator
./scripts/language_model/word_language_model.py:421:34: E228 missing whitespace around modulo operator
./scripts/nmt/bleu.py:204:13: E131 continuation line unaligned for hanging indent
./scripts/nmt/bleu.py:209:13: E131 continuation line unaligned for hanging indent
./scripts/nmt/encoder_decoder.py:115:17: E131 continuation line unaligned for hanging indent
./scripts/nmt/encoder_decoder.py:151:66: E262 inline comment should start with '# '
./scripts/nmt/encoder_decoder.py:171:65: E262 inline comment should start with '# '
./scripts/nmt/encoder_decoder.py:219:46: E262 inline comment should start with '# '
./scripts/nmt/encoder_decoder.py:238:45: E262 inline comment should start with '# '
./scripts/nmt/gnmt.py:140:65: E262 inline comment should start with '# '
./scripts/nmt/gnmt.py:140:101: E501 line too long (116 > 100 characters)
./scripts/nmt/gnmt.py:310:44: E261 at least two spaces before inline comment
./scripts/nmt/gnmt.py:310:45: E262 inline comment should start with '# '
./scripts/nmt/gnmt.py:337:45: E262 inline comment should start with '# '
./scripts/nmt/gnmt.py:349:55: E262 inline comment should start with '# '
./scripts/nmt/loss.py:31:60: E261 at least two spaces before inline comment
./scripts/nmt/loss.py:59:1: E302 expected 2 blank lines, found 1
./scripts/nmt/loss.py:129:53: E261 at least two spaces before inline comment
./scripts/nmt/train_gnmt.py:218:5: E731 do not assign a lambda expression, use a def
./scripts/nmt/train_gnmt.py:222:12: E127 continuation line over-indented for visual indent
./scripts/nmt/train_transformer.py:266:9: E731 do not assign a lambda expression, use a def
./scripts/nmt/train_transformer.py:270:9: E731 do not assign a lambda expression, use a def
./scripts/nmt/train_transformer.py:285:12: E127 continuation line over-indented for visual indent
./scripts/nmt/train_transformer.py:508:26: E127 continuation line over-indented for visual indent
./scripts/nmt/transformer.py:36:20: E127 continuation line over-indented for visual indent
./scripts/nmt/transformer.py:279:80: E262 inline comment should start with '# '
./scripts/nmt/transformer.py:279:101: E501 line too long (111 > 100 characters)
./scripts/nmt/transformer.py:402:64: E261 at least two spaces before inline comment
./scripts/nmt/transformer.py:402:65: E262 inline comment should start with '# '
./scripts/nmt/transformer.py:425:75: E261 at least two spaces before inline comment
./scripts/nmt/transformer.py:425:101: E501 line too long (109 > 100 characters)
./scripts/nmt/transformer.py:471:95: E261 at least two spaces before inline comment
./scripts/nmt/transformer.py:471:101: E501 line too long (129 > 100 characters)
./scripts/nmt/transformer.py:668:44: E261 at least two spaces before inline comment
./scripts/nmt/transformer.py:668:45: E262 inline comment should start with '# '
./scripts/nmt/transformer.py:696:56: E262 inline comment should start with '# '
./scripts/nmt/transformer.py:696:101: E501 line too long (107 > 100 characters)
./scripts/nmt/transformer.py:732:100: E262 inline comment should start with '# '
./scripts/nmt/transformer.py:732:101: E501 line too long (138 > 100 characters)
./scripts/nmt/transformer.py:743:88: E262 inline comment should start with '# '
./scripts/nmt/transformer.py:743:101: E501 line too long (120 > 100 characters)
./scripts/nmt/translation.py:190:90: E262 inline comment should start with '# '
./scripts/nmt/translation.py:190:101: E501 line too long (122 > 100 characters)
./scripts/nmt/translation.py:211:89: E262 inline comment should start with '# '
./scripts/nmt/translation.py:211:101: E501 line too long (121 > 100 characters)
./scripts/question_answering/data_processing.py:89:16: E127 continuation line over-indented for visual indent
./scripts/sentiment_analysis/sentiment_analysis.py:99:1: E302 expected 2 blank lines, found 1
./scripts/sentiment_analysis/sentiment_analysis.py:105:53: E261 at least two spaces before inline comment
./scripts/sentiment_analysis/sentiment_analysis.py:135:43: E261 at least two spaces before inline comment
./scripts/sentiment_analysis/sentiment_analysis.py:141:1: E305 expected 2 blank lines after class or function definition, found 1
./scripts/sentiment_analysis/sentiment_analysis.py:160:1: E302 expected 2 blank lines, found 1
./scripts/sentiment_analysis/sentiment_analysis.py:164:1: E305 expected 2 blank lines after class or function definition, found 1
./scripts/sentiment_analysis/sentiment_analysis.py:169:1: E302 expected 2 blank lines, found 1
./scripts/sentiment_analysis/sentiment_analysis.py:179:1: E305 expected 2 blank lines after class or function definition, found 1
./scripts/sentiment_analysis/sentiment_analysis.py:337:57: E228 missing whitespace around modulo operator
./scripts/sentiment_analysis/sentiment_analysis.py:338:45: E228 missing whitespace around modulo operator
./scripts/sentiment_analysis/sentiment_analysis.py:339:34: E228 missing whitespace around modulo operator
./scripts/tests/test_bleu.py:145:101: E501 line too long (104 > 100 characters)
./scripts/tests/test_bleu.py:147:101: E501 line too long (111 > 100 characters)
./scripts/tests/test_bleu.py:151:1: W391 blank line at end of file
./scripts/tests/test_encoder_decoder.py:4:1: F403 'from ..nmt.gnmt import *' used; unable to detect undefined names
./scripts/tests/test_encoder_decoder.py:5:1: F403 'from ..nmt.transformer import *' used; unable to detect undefined names
./scripts/tests/test_encoder_decoder.py:13:27: F405 'GNMTEncoder' may be undefined, or defined from star imports: ..nmt.gnmt, ..nmt.transformer
./scripts/tests/test_encoder_decoder.py:21:101: E501 line too long (105 > 100 characters)
./scripts/tests/test_encoder_decoder.py:23:101: E501 line too long (101 > 100 characters)
./scripts/tests/test_encoder_decoder.py:30:101: E501 line too long (102 > 100 characters)
./scripts/tests/test_encoder_decoder.py:38:15: F405 'GNMTEncoder' may be undefined, or defined from star imports: ..nmt.gnmt, ..nmt.transformer
./scripts/tests/test_encoder_decoder.py:44:23: F405 'GNMTDecoder' may be undefined, or defined from star imports: ..nmt.gnmt, ..nmt.transformer
./scripts/tests/test_encoder_decoder.py:44:101: E501 line too long (102 > 100 characters)
./scripts/tests/test_encoder_decoder.py:45:101: E501 line too long (119 > 100 characters)
./scripts/tests/test_encoder_decoder.py:50:101: E501 line too long (106 > 100 characters)
./scripts/tests/test_encoder_decoder.py:51:101: E501 line too long (106 > 100 characters)
./scripts/tests/test_encoder_decoder.py:52:101: E501 line too long (120 > 100 characters)
./scripts/tests/test_encoder_decoder.py:53:101: E501 line too long (120 > 100 characters)
./scripts/tests/test_encoder_decoder.py:57:101: E501 line too long (106 > 100 characters)
./scripts/tests/test_encoder_decoder.py:83:1: E302 expected 2 blank lines, found 1
./scripts/tests/test_encoder_decoder.py:88:27: F405 'TransformerEncoder' may be undefined, or defined from star imports: ..nmt.gnmt, ..nmt.transformer
./scripts/tests/test_encoder_decoder.py:91:101: E501 line too long (110 > 100 characters)
./scripts/tests/test_encoder_decoder.py:96:101: E501 line too long (106 > 100 characters)
./scripts/tests/test_encoder_decoder.py:98:101: E501 line too long (101 > 100 characters)
./scripts/tests/test_encoder_decoder.py:99:101: E501 line too long (110 > 100 characters)
./scripts/tests/test_encoder_decoder.py:105:101: E501 line too long (102 > 100 characters)
./scripts/tests/test_encoder_decoder.py:117:55: E128 continuation line under-indented for visual indent
./scripts/tests/test_encoder_decoder.py:118:30: W291 trailing whitespace
./scripts/tests/test_encoder_decoder.py:121:1: E302 expected 2 blank lines, found 1
./scripts/tests/test_encoder_decoder.py:124:15: F405 'TransformerEncoder' may be undefined, or defined from star imports: ..nmt.gnmt, ..nmt.transformer
./scripts/tests/test_encoder_decoder.py:124:101: E501 line too long (103 > 100 characters)
./scripts/tests/test_encoder_decoder.py:130:23: F405 'TransformerDecoder' may be undefined, or defined from star imports: ..nmt.gnmt, ..nmt.transformer
./scripts/tests/test_encoder_decoder.py:130:101: E501 line too long (124 > 100 characters)
./scripts/tests/test_encoder_decoder.py:131:101: E501 line too long (133 > 100 characters)
./scripts/tests/test_encoder_decoder.py:136:101: E501 line too long (110 > 100 characters)
./scripts/tests/test_encoder_decoder.py:137:101: E501 line too long (110 > 100 characters)
./scripts/tests/test_encoder_decoder.py:138:101: E501 line too long (120 > 100 characters)
./scripts/tests/test_encoder_decoder.py:139:101: E501 line too long (120 > 100 characters)
./scripts/tests/test_encoder_decoder.py:143:101: E501 line too long (106 > 100 characters)
./scripts/tests/test_encoder_decoder.py:158:101: E501 line too long (102 > 100 characters)
./scripts/tests/test_encoder_decoder.py:168:1: W391 blank line at end of file
./scripts/tests/test_question_answering.py:19:1: F401 'os' imported but unused
./scripts/word_embeddings/evaluation.py:65:5: E266 too many leading '#' for block comment
./scripts/word_embeddings/train_fasttext.py:44:1: E402 module level import not at top of file
./scripts/word_embeddings/train_fasttext.py:45:1: E402 module level import not at top of file
./scripts/word_embeddings/train_fasttext.py:46:1: E402 module level import not at top of file
./scripts/word_embeddings/train_fasttext.py:47:1: E402 module level import not at top of file
./scripts/word_embeddings/train_fasttext.py:48:1: E402 module level import not at top of file
./scripts/word_embeddings/train_fasttext.py:49:1: E402 module level import not at top of file
./scripts/word_embeddings/train_fasttext.py:50:1: E402 module level import not at top of file
./scripts/word_embeddings/train_fasttext.py:51:1: E402 module level import not at top of file
./scripts/word_embeddings/train_fasttext.py:53:1: E402 module level import not at top of file
./scripts/word_embeddings/train_fasttext.py:54:1: E402 module level import not at top of file
./scripts/word_embeddings/train_fasttext.py:56:1: E402 module level import not at top of file
./scripts/word_embeddings/train_fasttext.py:57:1: E402 module level import not at top of file
./scripts/word_embeddings/train_fasttext.py:58:1: E402 module level import not at top of file
./scripts/word_embeddings/train_fasttext.py:59:1: E402 module level import not at top of file
./scripts/word_embeddings/train_fasttext.py:179:76: E502 the backslash is redundant between brackets
./scripts/word_embeddings/train_fasttext.py:349:77: E251 unexpected spaces around keyword / parameter equals
./tests/unittest/test_attention_cell.py:2:1: F403 'from gluonnlp.model.attention_cell import *' used; unable to detect undefined names
./tests/unittest/test_attention_cell.py:58:20: F405 'MLPAttentionCell' may be undefined, or defined from star imports: gluonnlp.model.attention_cell
./tests/unittest/test_attention_cell.py:60:20: F405 'MLPAttentionCell' may be undefined, or defined from star imports: gluonnlp.model.attention_cell
./tests/unittest/test_attention_cell.py:69:28: F405 'DotProductAttentionCell' may be undefined, or defined from star imports: gluonnlp.model.attention_cell
./tests/unittest/test_attention_cell.py:76:28: F405 'DotProductAttentionCell' may be undefined, or defined from star imports: gluonnlp.model.attention_cell
./tests/unittest/test_attention_cell.py:78:28: F405 'DotProductAttentionCell' may be undefined, or defined from star imports: gluonnlp.model.attention_cell
./tests/unittest/test_attention_cell.py:89:28: F405 'MultiHeadAttentionCell' may be undefined, or defined from star imports: gluonnlp.model.attention_cell
./tests/unittest/test_attention_cell.py:90:35: F405 'DotProductAttentionCell' may be undefined, or defined from star imports: gluonnlp.model.attention_cell
./tests/unittest/test_batchify.py:6:1: F401 'pytest' imported but unused
./tests/unittest/test_batchify.py:8:1: E302 expected 2 blank lines, found 1
./tests/unittest/test_batchify.py:9:101: E501 line too long (102 > 100 characters)
./tests/unittest/test_batchify.py:12:1: E302 expected 2 blank lines, found 1
./tests/unittest/test_batchify.py:47:101: E501 line too long (136 > 100 characters)
./tests/unittest/test_batchify.py:57:101: E501 line too long (115 > 100 characters)
./tests/unittest/test_batchify.py:66:101: E501 line too long (103 > 100 characters)
./tests/unittest/test_batchify.py:67:101: E501 line too long (111 > 100 characters)
./tests/unittest/test_batchify.py:71:101: E501 line too long (113 > 100 characters)
./tests/unittest/test_batchify.py:76:101: E501 line too long (152 > 100 characters)
./tests/unittest/test_batchify.py:79:101: E501 line too long (101 > 100 characters)
./tests/unittest/test_batchify.py:80:101: E501 line too long (104 > 100 characters)
./tests/unittest/test_batchify.py:88:101: E501 line too long (102 > 100 characters)
./tests/unittest/test_batchify.py:98:101: E501 line too long (126 > 100 characters)
./tests/unittest/test_beam_search.py:139:101: E501 line too long (102 > 100 characters)
./tests/unittest/test_beam_search.py:145:5: E306 expected 1 blank line before a nested definition, found 0
./tests/unittest/test_beam_search.py:160:101: E501 line too long (104 > 100 characters)
./tests/unittest/test_beam_search.py:176:44: E127 continuation line over-indented for visual indent
./tests/unittest/test_beam_search.py:176:101: E501 line too long (101 > 100 characters)
./tests/unittest/test_beam_search.py:177:21: E127 continuation line over-indented for visual indent
./tests/unittest/test_beam_search.py:178:101: E501 line too long (101 > 100 characters)
./tests/unittest/test_beam_search.py:191:101: E501 line too long (105 > 100 characters)
./tests/unittest/test_beam_search.py:238:101: E501 line too long (102 > 100 characters)
./tests/unittest/test_datasets.py:38:24: F821 undefined name 'unicode'
./tests/unittest/test_datasets.py:74:5: E303 too many blank lines (2)
./tests/unittest/test_datasets.py:79:5: F841 local variable 'my_dataset' is assigned to but never used
./tests/unittest/test_datasets.py:92:101: E501 line too long (102 > 100 characters)
./tests/unittest/test_datasets.py:120:101: E501 line too long (102 > 100 characters)
./tests/unittest/test_datasets.py:463:57: E225 missing whitespace around operator
./tests/unittest/test_datasets.py:468:66: E225 missing whitespace around operator
./tests/unittest/test_datasets.py:476:60: E225 missing whitespace around operator
./tests/unittest/test_datasets.py:481:69: E225 missing whitespace around operator
./tests/unittest/test_datasets.py:482:101: E501 line too long (104 > 100 characters)
./tests/unittest/test_datasets.py:492:57: E225 missing whitespace around operator
./tests/unittest/test_datasets.py:497:66: E225 missing whitespace around operator
./tests/unittest/test_datasets.py:505:101: E501 line too long (101 > 100 characters)
./tests/unittest/test_datasets.py:513:60: E225 missing whitespace around operator
./tests/unittest/test_datasets.py:518:69: E225 missing whitespace around operator
./tests/unittest/test_datasets.py:519:101: E501 line too long (104 > 100 characters)
./tests/unittest/test_datasets.py:529:101: E501 line too long (104 > 100 characters)
./tests/unittest/test_datasets.py:536:1: E302 expected 2 blank lines, found 1
./tests/unittest/test_datasets.py:540:5: F841 local variable 'train' is assigned to but never used
./tests/unittest/test_datasets.py:541:5: F841 local variable 'val' is assigned to but never used
./tests/unittest/test_datasets.py:542:5: F841 local variable 'test' is assigned to but never used
./tests/unittest/test_datasets.py:555:1: E302 expected 2 blank lines, found 1
./tests/unittest/test_datasets.py:559:5: F841 local variable 'train' is assigned to but never used
./tests/unittest/test_datasets.py:560:5: F841 local variable 'val' is assigned to but never used
./tests/unittest/test_datasets.py:561:5: F841 local variable 'test' is assigned to but never used
./tests/unittest/test_datasets.py:568:5: F841 local variable 'padding_idx' is assigned to but never used
./tests/unittest/test_datasets.py:579:5: F841 local variable 'num_batches' is assigned to but never used
./tests/unittest/test_datasets.py:584:1: E302 expected 2 blank lines, found 1
./tests/unittest/test_datasets.py:588:5: F841 local variable 'test' is assigned to but never used
./tests/unittest/test_datasets.py:598:1: E302 expected 2 blank lines, found 1
./tests/unittest/test_datasets.py:611:1: E302 expected 2 blank lines, found 1
./tests/unittest/test_datasets.py:618:1: E302 expected 2 blank lines, found 1
./tests/unittest/test_loss.py:21:1: F401 'mxnet.gluon' imported but unused
./tests/unittest/test_loss.py:24:1: E302 expected 2 blank lines, found 1
./tests/unittest/test_loss.py:30:1: E302 expected 2 blank lines, found 1
./tests/unittest/test_models.py:30:1: E302 expected 2 blank lines, found 1
./tests/unittest/test_models.py:37:1: E302 expected 2 blank lines, found 1
./tests/unittest/test_models.py:41:101: E501 line too long (130 > 100 characters)
./tests/unittest/test_models.py:42:101: E501 line too long (207 > 100 characters)
./tests/unittest/test_models.py:48:101: E501 line too long (102 > 100 characters)
./tests/unittest/test_models.py:56:1: E302 expected 2 blank lines, found 1
./tests/unittest/test_models.py:58:20: E128 continuation line under-indented for visual indent
./tests/unittest/test_models.py:65:101: E501 line too long (104 > 100 characters)
./tests/unittest/test_models.py:78:101: E501 line too long (104 > 100 characters)
./tests/unittest/test_models.py:79:101: E501 line too long (104 > 100 characters)
./tests/unittest/test_models.py:80:101: E501 line too long (106 > 100 characters)
./tests/unittest/test_models.py:97:101: E501 line too long (106 > 100 characters)
./tests/unittest/test_models.py:99:101: E501 line too long (106 > 100 characters)
./tests/unittest/test_models.py:109:20: E128 continuation line under-indented for visual indent
./tests/unittest/test_models.py:114:44: E127 continuation line over-indented for visual indent
./tests/unittest/test_sampler.py:5:1: F401 'gluonnlp as nlp' imported but unused
./tests/unittest/test_sampler.py:21:101: E501 line too long (102 > 100 characters)
./tests/unittest/test_sampler.py:25:101: E501 line too long (101 > 100 characters)
./tests/unittest/test_sampler.py:47:101: E501 line too long (102 > 100 characters)
./tests/unittest/test_sampler.py:48:101: E501 line too long (127 > 100 characters)
./tests/unittest/test_transforms.py:22:1: F403 'from gluonnlp.data.transforms import *' used; unable to detect undefined names
./tests/unittest/test_transforms.py:31:20: F405 'ClipSequence' may be undefined, or defined from star imports: gluonnlp.data.transforms
./tests/unittest/test_transforms.py:57:27: F405 'PadSequence' may be undefined, or defined from star imports: gluonnlp.data.transforms
./tests/unittest/test_transforms.py:72:17: F405 'NLTKMosesTokenizer' may be undefined, or defined from star imports: gluonnlp.data.transforms
./tests/unittest/test_transforms.py:84:17: F405 'SpacyTokenizer' may be undefined, or defined from star imports: gluonnlp.data.transforms
./tests/unittest/test_transforms.py:96:19: F405 'NLTKMosesDetokenizer' may be undefined, or defined from star imports: gluonnlp.data.transforms
./tests/unittest/test_vocab_embed.py:32:1: F403 'from mxnet.test_utils import *' used; unable to detect undefined names
./tests/unittest/test_vocab_embed.py:38:24: F405 'unicode' may be undefined, or defined from star imports: mxnet.test_utils
./tests/unittest/test_vocab_embed.py:48:1: E302 expected 2 blank lines, found 1
./tests/unittest/test_vocab_embed.py:51:1: E302 expected 2 blank lines, found 1
./tests/unittest/test_vocab_embed.py:67:36: E128 continuation line under-indented for visual indent
./tests/unittest/test_vocab_embed.py:73:30: E128 continuation line under-indented for visual indent
./tests/unittest/test_vocab_embed.py:121:57: E231 missing whitespace after ','
./tests/unittest/test_vocab_embed.py:135:26: E231 missing whitespace after ','
./tests/unittest/test_vocab_embed.py:218:15: E128 continuation line under-indented for visual indent
./tests/unittest/test_vocab_embed.py:221:15: E128 continuation line under-indented for visual indent
./tests/unittest/test_vocab_embed.py:224:15: E128 continuation line under-indented for visual indent
./tests/unittest/test_vocab_embed.py:394:5: F405 'assert_almost_equal' may be undefined, or defined from star imports: mxnet.test_utils
./tests/unittest/test_vocab_embed.py:400:5: F405 'assert_almost_equal' may be undefined, or defined from star imports: mxnet.test_utils
./tests/unittest/test_vocab_embed.py:401:24: E128 continuation line under-indented for visual indent
./tests/unittest/test_vocab_embed.py:404:24: E124 closing bracket does not match visual indentation
./tests/unittest/test_vocab_embed.py:408:5: F405 'assert_almost_equal' may be undefined, or defined from star imports: mxnet.test_utils
./tests/unittest/test_vocab_embed.py:411:5: F405 'assert_almost_equal' may be undefined, or defined from star imports: mxnet.test_utils
./tests/unittest/test_vocab_embed.py:416:5: F405 'assert_almost_equal' may be undefined, or defined from star imports: mxnet.test_utils
./tests/unittest/test_vocab_embed.py:419:9: F405 'assert_almost_equal' may be undefined, or defined from star imports: mxnet.test_utils
./tests/unittest/test_vocab_embed.py:429:5: F405 'assert_almost_equal' may be undefined, or defined from star imports: mxnet.test_utils
./tests/unittest/test_vocab_embed.py:435:101: E501 line too long (106 > 100 characters)
./tests/unittest/test_vocab_embed.py:437:5: F405 'assert_almost_equal' may be undefined, or defined from star imports: mxnet.test_utils
./tests/unittest/test_vocab_embed.py:439:5: F405 'assert_almost_equal' may be undefined, or defined from star imports: mxnet.test_utils
./tests/unittest/test_vocab_embed.py:441:101: E501 line too long (107 > 100 characters)
./tests/unittest/test_vocab_embed.py:443:5: F405 'assert_almost_equal' may be undefined, or defined from star imports: mxnet.test_utils
./tests/unittest/test_vocab_embed.py:445:5: F405 'assert_almost_equal' may be undefined, or defined from star imports: mxnet.test_utils
./tests/unittest/test_vocab_embed.py:507:101: E501 line too long (105 > 100 characters)
./tests/unittest/test_vocab_embed.py:513:5: F405 'assert_almost_equal' may be undefined, or defined from star imports: mxnet.test_utils
./tests/unittest/test_vocab_embed.py:521:5: F405 'assert_almost_equal' may be undefined, or defined from star imports: mxnet.test_utils
./tests/unittest/test_vocab_embed.py:529:5: F405 'assert_almost_equal' may be undefined, or defined from star imports: mxnet.test_utils
./tests/unittest/test_vocab_embed.py:532:5: F405 'assert_almost_equal' may be undefined, or defined from star imports: mxnet.test_utils
./tests/unittest/test_vocab_embed.py:536:5: F405 'assert_almost_equal' may be undefined, or defined from star imports: mxnet.test_utils
./tests/unittest/test_vocab_embed.py:539:5: F405 'assert_almost_equal' may be undefined, or defined from star imports: mxnet.test_utils
./tests/unittest/test_vocab_embed.py:543:5: F405 'assert_almost_equal' may be undefined, or defined from star imports: mxnet.test_utils
./tests/unittest/test_vocab_embed.py:550:5: F405 'assert_almost_equal' may be undefined, or defined from star imports: mxnet.test_utils
./tests/unittest/test_vocab_embed.py:554:5: F405 'assert_almost_equal' may be undefined, or defined from star imports: mxnet.test_utils
./tests/unittest/test_vocab_embed.py:559:5: F405 'assert_almost_equal' may be undefined, or defined from star imports: mxnet.test_utils
./tests/unittest/test_vocab_embed.py:571:5: F405 'assert_almost_equal' may be undefined, or defined from star imports: mxnet.test_utils
./tests/unittest/test_vocab_embed.py:580:5: F405 'assert_almost_equal' may be undefined, or defined from star imports: mxnet.test_utils
./tests/unittest/test_vocab_embed.py:589:5: F405 'assert_almost_equal' may be undefined, or defined from star imports: mxnet.test_utils
./tests/unittest/test_vocab_embed.py:601:5: F405 'assert_almost_equal' may be undefined, or defined from star imports: mxnet.test_utils
./tests/unittest/test_vocab_embed.py:646:5: F405 'assert_almost_equal' may be undefined, or defined from star imports: mxnet.test_utils
./tests/unittest/test_vocab_embed.py:655:5: F405 'assert_almost_equal' may be undefined, or defined from star imports: mxnet.test_utils
./tests/unittest/test_vocab_embed.py:659:5: F405 'assert_almost_equal' may be undefined, or defined from star imports: mxnet.test_utils
./tests/unittest/test_vocab_embed.py:667:5: F405 'assert_almost_equal' may be undefined, or defined from star imports: mxnet.test_utils
./tests/unittest/test_vocab_embed.py:694:5: F405 'assert_almost_equal' may be undefined, or defined from star imports: mxnet.test_utils
./tests/unittest/test_vocab_embed.py:712:5: F405 'assert_almost_equal' may be undefined, or defined from star imports: mxnet.test_utils
./tests/unittest/test_vocab_embed.py:730:5: F405 'assert_almost_equal' may be undefined, or defined from star imports: mxnet.test_utils
./tests/unittest/test_vocab_embed.py:750:5: F405 'assert_almost_equal' may be undefined, or defined from star imports: mxnet.test_utils
./tests/unittest/test_vocab_embed.py:783:5: F405 'assert_almost_equal' may be undefined, or defined from star imports: mxnet.test_utils
./tests/unittest/test_vocab_embed.py:784:5: F405 'assert_almost_equal' may be undefined, or defined from star imports: mxnet.test_utils
./tests/unittest/test_vocab_embed.py:785:5: F405 'assert_almost_equal' may be undefined, or defined from star imports: mxnet.test_utils
cclauss commented 6 years ago

I usually do it in two passes like this:

    # stop the build if there are Python syntax errors or undefined names
    - flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics
    # exit-zero treats all errors as warnings.  The GitHub editor is 127 chars wide
    - flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics

The first pass halts the build on error but the second just treats "style violations" as warnings.

E901,E999,F821,F822,F823 are the "showstopper" flake8 issues that can halt the runtime with a SyntaxError, NameError, etc. Most other flake8 issues are merely "style violations" -- useful for readability but they do not effect runtime safety. This PR should therefore recommend a flake8 run of these tests on the entire codebase.

leezu commented 6 years ago

Thanks. I believe we should enforce E901,E999,F821,F822,F823 on the CI. I have enabled the check for them following your suggestion in https://github.com/dmlc/gluon-nlp/pull/213 (subject to review). I would be happy to also enforce style related issues (once they are all fixed or selectively disabled), but let's see what others think.