maxmello
12/01/2025, 2:51 PMPaul Dingemans
12/01/2025, 5:34 PM• Would we want to ensure a certain ordering of context parameters? Alphabetically? Named before underscore-parameters?We have no sorting rule for parameters in classes and functions in ktlint. Why would sorting the context parameter be handled differently? Enforcing that named context parameters go before anonymous parameters is definitely possible, but it comes with the same question what the benefit is.
• Do we think there will be a “maximum number of context parameters” rule? Is there a point where it would be recommended to wrap context parameters into grouped objects if the number of parameters is too large? Or are large numbers of context parameters expected to be common, as higher level functions will always have to accommodate all parameters required by the nested functions?There is no rule for maximum number of parameter in classes and rules in ktlint. Why would we need such a rule?
• Would we enforce underscores as name for context parameters if the parameter is not directly used inside the function? What about open/abstract functions, would we always use underscore here, or keep the naming identical for the super function as well as all the implementations?I am not sure whether ktlint could reliably detect that a context parameter is not used by name. Also here, it comes with the same question why we should do so for context parameters while we don't do this for classes and functions.
maxmello
12/02/2025, 8:04 AMmaxmello
12/02/2025, 8:12 AMPaul Dingemans
12/02/2025, 8:21 AM