Generate.py ignoring tab-width setting

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Generate.py ignoring tab-width setting

deniska
Hi, all.

I'm trying to generate with different tab-width. According to documentation, I've added the following settings to "jobs" section of config.json

        "fix-files" :
        {
          "tab-width" : 4
        },

After running "generate.py -fix" from my application folder, I would expect the tab size in generated Application.js file will change to 4. In fact the code is still idented with 2 spaces. The editor I'm using is notepad++.

What am I missing?

Thanks,
Denis.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Generate.py ignoring tab-width setting

Dietrich Streifert
I thought this config.json part is responsible for configuring indention:

"pretty-print" :
{
  "general" :
  {
    "indent-string"        : "  ",

But I'm not sure, because I'm not using the pretty printing feature currently.

I think that "fix-files.tab-width" only is used if your files contain \t characters.


Am 18.10.2015 um 16:48 schrieb deniska:
Hi, all.

I'm trying to generate with different tab-width. According to documentation,
I've added the following settings to "jobs" section of config.json

	"fix-files" :
	{
	  "tab-width" : 4
	},

After running "generate.py -fix" from my application folder, I would expect
the tab size in generated Application.js file will change to 4. In fact the
code is still idented with 2 spaces. The editor I'm using is notepad++.

What am I missing?

Thanks,
Denis.



--
View this message in context: http://qooxdoo.678.n2.nabble.com/Generate-py-ignoring-tab-width-setting-tp7587693.html
Sent from the qooxdoo mailing list archive at Nabble.com.

------------------------------------------------------------------------------
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel


------------------------------------------------------------------------------

_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Generate.py ignoring tab-width setting

deniska
Hmm, that still doesn't seem to make any change to Application.js

Attaching the config files, perhaps I'm still doing something wrong.

After added the section you've suggest to config.json I'm running generate.py fix

config.json
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Generate.py ignoring tab-width setting

Dietrich Streifert
Try generate.py pretty

Does this make a difference?

Am 19.10.2015 um 11:25 schrieb deniska:

> Hmm, that still doesn't seem to make any change to Application.js
>
> Attaching the config files, perhaps I'm still doing something wrong.
>
> After added the section you've suggest to config.json I'm running
> generate.py fix
>
> config.json <http://qooxdoo.678.n2.nabble.com/file/n7587695/config.json>
>
>
>
> --
> View this message in context: http://qooxdoo.678.n2.nabble.com/Generate-py-ignoring-tab-width-setting-tp7587693p7587695.html
> Sent from the qooxdoo mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> _______________________________________________
> qooxdoo-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel


------------------------------------------------------------------------------
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Generate.py ignoring tab-width setting

deniska
<quote author="Dietrich Streifert">
Try generate.py pretty

Does this make a difference?

Still not. I'm debugging right now and it seems that pretty-print settings are getting lost in generator.py main() somewhere along the following lines:

        ctx = context.copy()
        print(config._data['jobs']['pretty-print']._data)
        ctx['jobconf'] = config.getJob(job)
        print(ctx['jobconf']._data['pretty-print'])

Here's the result of prints:

{u'general': {u'indent-string': u'    '}}
{}

So the config is read correctly, but when job is initialized, it's getting lost. Still digging into the code to find the issue.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Generate.py ignoring tab-width setting

deniska
Whoops, never mind my previous post, there's no problem with python tools.

Apparently "pretty" is the name of the job, so the correct format is:

    "pretty":
    {
        "pretty-print" :
        {
          "general" :
          {
            "indent-string" : "\t"
          }
        }
    }

Thanks, Dietrich :)
Loading...