twisted / twistedchecker

twistedchecker is a tool to automatically verify code against the Twisted coding standard.
MIT License
9 stars 13 forks source link

"twistedchecker twisted" emits a traceback #137

Open glyph opened 5 years ago

glyph commented 5 years ago

Every build of Twisted does this.

Traceback (most recent call last):
  File ".../bin/twistedchecker", line 10, in <module>
    sys.exit(main())
  File ".../site-packages/twistedchecker/core/runner.py", line 439, in main
    runner.run(sys.argv[1:])
  File ".../site-packages/twistedchecker/core/runner.py", line 315, in run
    self.linter.check(args)
  File ".../site-packages/pylint/lint.py", line 736, in check
    self._do_check(files_or_modules)
  File ".../site-packages/pylint/lint.py", line 867, in _do_check
    self.check_astroid_module(ast_node, walker, rawcheckers, tokencheckers)
  File ".../site-packages/pylint/lint.py", line 947, in check_astroid_module
    walker.walk(ast_node)
  File ".../site-packages/pylint/utils.py", line 935, in walk
    cb(astroid)
  File ".../site-packages/twistedchecker/checkers/pycodestyleformat.py", line 182, in visit_module
    recorder = PyCodeStyleWarningRecorder(node.file)
  File ".../site-packages/twistedchecker/checkers/pycodestyleformat.py", line 50, in __init__
    self.run()
  File ".../site-packages/twistedchecker/checkers/pycodestyleformat.py", line 79, in run
    pycodestyle.Checker.check_all(self)
  File ".../site-packages/pycodestyle.py", line 2113, in check_all
    self.check_logical()
  File ".../site-packages/pycodestyle.py", line 1998, in check_logical
    for offset, text in self.run_check(check, argument_names) or ():
  File ".../site-packages/pycodestyle.py", line 1927, in run_check
    return check(*arguments)
TypeError: modifiedBlankLines() takes 7 positional arguments but 9 were given
adiroiban commented 5 years ago

I think that this might be due to an update in pycodestyle.

I remember that I worked as removing pycodestyle from twistedchecker and running it as a separate tool https://github.com/twisted/twisted/pull/969

and then we have https://github.com/PyCQA/pycodestyle/pull/733

so upstream pycodestyle has support for tweaking it to work with twisted.

My suggestion is to remove pycodestuleformat.py from twistedchecker and just use upstream pycodestyle