movebit / movefmt

Other
5 stars 4 forks source link

Resources after acquires can exceed column limit #3

Closed vineethk closed 7 months ago

vineethk commented 8 months ago

Consider the following test case:

module 0x55::m {
    fun bar() acquires LongName1, LongName2, LongName3, LongName4, LongName5, LongName6, LongName7, LongName8, LongName9, LongName10 {
    }
}

When this gets formatted, we get:

module 0x55::m {
    fun bar()
        acquires LongName1, LongName2, LongName3, LongName4, LongName5, LongName6, LongName7, LongName8, LongName9, LongName10 {
    }
}

In particular, the resources after acquires can keep going beyond the column limit, without breaking.

Another problem is that if a developer has already broken resources after acquires into multiple lines to meet column limit, the formatter would bring these up into a single line.

robinlzw commented 7 months ago

fixed in https://github.com/movebit/movefmt/commit/7ddff07410de03ae4623039621fbe939e538c9ec