lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On 01/29/2017 11:13 PM, Daurnimator wrote:
> You missed sending a link to your project!
> https://github.com/martin-eden/lua_code_formatter
> 
> Some misc comments:
> 
>   - You use a little bash script for the entry point: if you used a
> lua file then luarocks would do path setup for you.
>   - Would be nice to be able to pipe in/out by default instead of
> providing filenames
>   - Your 'workshop.base' module messes with the global environment: I
> would not want to use it inside my own library or application.
>   - I'm not sure how to use your module with custom parameters (e.g.
> indent_chunk): your global request function fails with lua:
> /usr/share/lua/5.3/lcf/workshop/base.lua:128: module
> 'workshop.load_from.lua' not found
>   - I'm curious what you will do with version numbers.... your current
> release is 5.3?
> 

Thank you for reply! This is my first luarocks release and first
announce in lua mailing list so some errors. (And it occured to be
"ninja" announce as a hidden reply to other thread.)

I agree with your notes, especially with version numbers.

>   - I'm curious what you will do with version numbers.... your current
> release is 5.3?

There two versions, "5.1-0" and "5.3-0". When new functionality will be
added I'm plan to migrate "5.1.x-0" and "5.3.x-0" format.

>   - Your 'workshop.base' module messes with the global environment: I
> would not want to use it inside my own library or application.

Yes. I've not found a valid way to use few globally exported functions
without requiring them in each module (which are usually around 40 lines).

>   - I'm not sure how to use your module with custom parameters (e.g.
> indent_chunk): your global request function fails with lua:
> /usr/share/lua/5.3/lcf/workshop/base.lua:128: module

Could not reproduce.
>Lua 5.3.3  Copyright (C) 1994-2016 Lua.org, PUC-Rio
> do
>>   local lua_code_str = 'do return end' -- < fill it
>>
>>   require('lcf.workshop.base')
>>   local get_formatted_ast = request('lcf.workshop.load_from.lua')
>>   local get_formatted_code = request('lcf.workshop.save_to.lua')
>>
>>   return
>>     get_formatted_code(
>>       get_formatted_ast(lua_code_str),
>>       {
>>         indent_chunk = '!..',
>>         right_margin = 100,
>>         max_text_width = 65,
>>       }
>>     )
>> end
do
!..return
end
>