Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

modifiedBlankLines() takes 7 positional arguments but 9 were given #138

Open
jfhbrook opened this issue Jun 14, 2019 · 4 comments
Open

modifiedBlankLines() takes 7 positional arguments but 9 were given #138

jfhbrook opened this issue Jun 14, 2019 · 4 comments

Comments

@jfhbrook
Copy link

jfhbrook commented Jun 14, 2019

When running twisted's linting tox task, I got a traceback like this:

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

I think what happened was that pycodestyle updated its list of arguments for its blank lines check, such that it doesn't match with modifiedBlankLinesCheck anymore.

I think this can be fixed by naively introducing the new arguments, but I haven't investigated the changes deeply enough to understand what the new parameters are for or whether the core API has changed enough to require a refactor of modifiedBlankLines beyond just changing the call signature. That said I was able to get the step to pass by modifying call signature in the code installed in my tox environment directly, so I suspect the changes are minor.

@adiroiban
Copy link
Member

I don't know why this is still used in Twisted.
I was expected to have pycodestyle executed outside of tiwstedcheker twisted/twisted#969

And there is also this upstream merge PyCQA/pycodestyle#733

My suggestion is to remove pycodestyle from twistedchecker and run pycodestyle as a separate job.
AFAIK, pycodestyle upstream now supports Twisted style

@jfhbrook
Copy link
Author

I see. I flipped through the blame for tox.ini and following the thread it looks like twisted/twisted#1043 may have inadvertently pulled an optional twistedchecker task in while trying to consolidate linting?

@adiroiban
Copy link
Member

Thanks for the search.
I don't have time for twistedchecker... and I think that twisted build should be changed to stop using it :)

Twistedchecker didn't received much love in the last years

@glyph
Copy link
Member

glyph commented Aug 4, 2019

Is this still broken?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants