plone / plone.recipe.codeanalysis

provides static code analysis for Buildout-based Python projects, including flake8, JSHint, CSS Lint, and other code checks
https://pypi.org/project/plone.recipe.codeanalysis/
11 stars 5 forks source link

AttributeError: 'ModuleScope' object has no attribute 'returnValue' #165

Closed khink closed 9 years ago

khink commented 9 years ago

Hi,

First off i really like this recipe, and wanted to use it in Products.LoginLockout.

I ran into the problem where a skins folder script has a bare return statement, and pyflakes < 0.9.0 throws an exception: "AttributeError: 'ModuleScope' object has no attribute 'returnValue'" . As the current flake8 (2.4.1) is still pinning to < 0.9.0, this is a problem. https://bugs.launchpad.net/pyflakes/+bug/1332451

How could we work around this? I'm currently adding the offending files to flake8-exclude.

gforcada commented 9 years ago

As discussed briefly at the conference: the syntax error is valid, there is a return statement without being in a scope (method, class, function...).

As skins templates anyway are already special I usually put them on the exclude list.

More of a reason to get rid of them as soon as possible :-)

Feel free to close if you think so.

khink commented 9 years ago

As this is not the recipe's problem, it's fair to close it i think.