How to remove or silence 'attribute not allowed here' errors in Pycharm?
Using Windows Pycharm 2.7.
I'm trying to get rid of the annoying pycharm warnings. I attached a picture of a snippet of my code in pycharm. For example, when I highlight 'tal:define' I get a "attribute tal:define is not allowed here" (as well as all the other 'red' outlined errors). The 'light bulb' only gives me only a'remove attribute' option.
My friend is using the mac version of pycharm 2.7. He is able to disable the warnings somehow. The 'light bulb' next to the error gives him other options than I have on the PC version of pycharm. Is there something I'm doing wrong? Suggestions?
The code works perfectly. I'm just trying to get rid of the pycharm errors.
do you use PyCharm 3.0 EAP with Chameleon template language chosen in Settings->Template languages?
It's known issue and it'll be fixed in new EAP. For now you can disable inspections in Settings->Inspections->HTML->Unknown HTML tag attribute/Unknown HTML tag.
It could be done using Alt+Enter on erroneous code, then hit right and choose "Edit inspection profile setting".
I have made some progress based on your information. I switched over to Pycharm 3.0 EAP and selected Chameleon as my template language. This resolved most of the errors.
There were still unknown tags and unknown tag attributes to deal with. Instead of disabling unknown tag/unknown tag attributes I was able to add 'tal' as a custom attribute in the Unknown tag section and 'metal:use-macro' in the Unknown tag attribute. For some reason, attributes such as 'metal:fill-slot', 'tal:define' never raised an error so I didn't have to do anything with them.
Another side effect was that my html namespace declaration is not fully being detected now.
" gives 'Namespace Declaration is never used".
I hope this helps and if you have any other suggestions please let me know. I look forward to the fixes.
go to parent
Code Analysis - not working!
Scroll Past End Of File
Build #178 (Dec/17/2014 3:47PM)