0

I recently started using Atom IDE on Linux and I really like it. But I have come to small annoyance while developing a web2py application. I have installed linter and have tried several python extensions for linter (linter-python, pylint, etc.) but I can't seem to configure any of the linters to ignore the global web2py identifiers, which is really annyoing because they are used a lot. E.g. the "response" and "request" names are always shown as errors.

In my research I found a solution for the sublime-text IDE which I don't own: https://gist.github.com/maribo/4086469

Does anybody know if there is a similar solution in Atom or if there is any other package I can use?

Thanks in advance

1 Answers1

0

If you cannot get the linter configured as desired, you might also try adding the following line to your files:

from gluon import *

That imports all the web2py API globals, including creating some dummy objects.

Anthony
  • 25,466
  • 3
  • 28
  • 57
  • Thank you for your reply, it kind of works. The error disappears but I still get a Warning `W0401 'response may be undefined, or defined from star imports: gluon.globals' [pyflakes]` and as far as I know Warnings cannot be ignored. – Michael Wass Jun 26 '18 at 10:48
  • For more flexibility in ignoring particular warnings, you might consider [linter-flake8](https://atom.io/packages/linter-flake8), possibly in conjunction with [flake8-per-file-ignores](https://github.com/snoack/flake8-per-file-ignores) to ignore this warning only in model and controller files. – Anthony Jun 26 '18 at 15:05