|
hello,
in our python code we have the problem that pygenie does not seem to be able to handle comment surrounded by ''' : example file: ''' foo.py some comment date: 20110519 version: 1.0.2 ''' from struct import bar, foobar import os import time import array # # Constants for foobar types [...] pygenie stacktrace: # python pygenie.py all -v foo.py Traceback (most recent call last): File "pygenie.py", line 79, in <module> main() File "pygenie.py", line 73, in main stats = cc.measure_complexity(code, item) File "/root/org/sonar/plugins/python/pygenie/cc.py", line 92, in measure_complexity return CCVisitor(ast, description=module_name).stats File "/root/org/sonar/plugins/python/pygenie/cc.py", line 46, in __init__ ast = compiler.parse(ast) File "/usr/lib64/python2.6/compiler/transformer.py", line 51, in parse return Transformer().parsesuite(buf) File "/usr/lib64/python2.6/compiler/transformer.py", line 128, in parsesuite return self.transform(parser.suite(text)) File "<string>", line 7 ''' ^ any help is much appreciated. thanks alex -- Alexander Lorenz | Test Engineer Traffic | TomTom Content Production Unit Berlin | [hidden email] | +49-30-756543-194 | www.tomtom.com --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email |
|
Hi alex,
this looks to me much like this issue: http://jira.codehaus.org/browse/SONARPLUGINS-1721 For now, the workaround is to cleanup whitespace. If you send me the offending file, i'll try to point to the line in question. Cheers, -- Waleri On 06/28/2012 03:23 PM, Alexander Lorenz wrote: > hello, > > in our python code we have the problem that pygenie does not seem to be > able to handle comment surrounded by ''' : > > > example file: > > > ''' > foo.py > some comment > date: 20110519 > version: 1.0.2 > ''' > > from struct import bar, foobar > import os > import time > import array > # > # Constants for foobar types > > [...] > > > > pygenie stacktrace: > > > # python pygenie.py all -v foo.py > Traceback (most recent call last): > File "pygenie.py", line 79, in <module> > main() > File "pygenie.py", line 73, in main > stats = cc.measure_complexity(code, item) > File "/root/org/sonar/plugins/python/pygenie/cc.py", line 92, in > measure_complexity > return CCVisitor(ast, description=module_name).stats > File "/root/org/sonar/plugins/python/pygenie/cc.py", line 46, in __init__ > ast = compiler.parse(ast) > File "/usr/lib64/python2.6/compiler/transformer.py", line 51, in parse > return Transformer().parsesuite(buf) > File "/usr/lib64/python2.6/compiler/transformer.py", line 128, in > parsesuite > return self.transform(parser.suite(text)) > File "<string>", line 7 > ''' > ^ > > any help is much appreciated. > > > thanks > > alex > --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email |
|
hi waleri,
we had also discovered and fixed the whitespace problem, so it's not that. since the parser does not seem very stable, i think we'll have to wait till november, when 1.0 comes out, to really start using python in sonar. cheers alex On 06/29/2012 08:14 AM, Waleri Enns wrote: > Hi alex, > > this looks to me much like this issue: > http://jira.codehaus.org/browse/SONARPLUGINS-1721 > > For now, the workaround is to cleanup whitespace. > If you send me the offending file, i'll try to point to the line in > question. > > Cheers, > -- > Waleri > > > On 06/28/2012 03:23 PM, Alexander Lorenz wrote: >> hello, >> >> in our python code we have the problem that pygenie does not seem to be >> able to handle comment surrounded by ''' : >> >> >> example file: >> >> >> ''' >> foo.py >> some comment >> date: 20110519 >> version: 1.0.2 >> ''' >> >> from struct import bar, foobar >> import os >> import time >> import array >> # >> # Constants for foobar types >> >> [...] >> >> >> >> pygenie stacktrace: >> >> >> # python pygenie.py all -v foo.py >> Traceback (most recent call last): >> File "pygenie.py", line 79, in <module> >> main() >> File "pygenie.py", line 73, in main >> stats = cc.measure_complexity(code, item) >> File "/root/org/sonar/plugins/python/pygenie/cc.py", line 92, in >> measure_complexity >> return CCVisitor(ast, description=module_name).stats >> File "/root/org/sonar/plugins/python/pygenie/cc.py", line 46, in >> __init__ >> ast = compiler.parse(ast) >> File "/usr/lib64/python2.6/compiler/transformer.py", line 51, in parse >> return Transformer().parsesuite(buf) >> File "/usr/lib64/python2.6/compiler/transformer.py", line 128, in >> parsesuite >> return self.transform(parser.suite(text)) >> File "<string>", line 7 >> ''' >> ^ >> >> any help is much appreciated. >> >> >> thanks >> >> alex >> > > > --------------------------------------------------------------------- > To unsubscribe from this list, please visit: > > http://xircles.codehaus.org/manage_email > > -- Alexander Lorenz | Test Engineer Traffic | TomTom Content Production Unit Berlin | [hidden email] | +49-30-756543-194 | www.tomtom.com --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email |
|
Hi Alex,
Maybe in the meantime you can give a try for snapshot of 1.0 and provide feedback - see http://markmail.org/message/m5foeugnqv7u3jkf
On Mon, Jul 2, 2012 at 10:36 PM, Alexander Lorenz <[hidden email]> wrote: hi waleri, Best regards, Evgeny Mandrikov aka Godin <http://godin.net.ru> http://twitter.com/_godin_ |
|
hi evgeny,
we'd love to, but the mail does not contain a valid link to a python 1.0 snapshot jar. where can we obtain it? thanks alex On 07/02/2012 06:45 PM, Evgeny Mandrikov wrote: Hi Alex, -- Alexander Lorenz | Test Engineer Traffic | TomTom Content Production Unit Berlin | [hidden email] | +49-30-756543-194 | www.tomtom.com |
|
Here is a link : On Wed, Jul 4, 2012 at 7:26 PM, Alexander Lorenz <[hidden email]> wrote:
Best regards, Evgeny Mandrikov aka Godin <http://godin.net.ru> http://twitter.com/_godin_ |
| Powered by Nabble | Edit this page |
