All,
I’m currently on 12.11.0.77.
In the formatter options, list arrangements, parameters, I have set:
- List arrangement: Stacked on overflow or more than 3
- Parentheses:option 2
- On overflow on 1, 2, 3 then use: option 5
With the current code this results in parameter sprawl over an excessive number of lines,
reducing readability and maintainability of the code
For example I now get:
if lower(p_debug) = ‘debug’
then
utl_krg.msg_log.log_debug_msg(
p_schema =>
g_my_schema
, p_package =>
g_my_package
, p_routine =>
l_my_routine
, p_action =>
l_action
, p_msg_id =>
g_my_msg_prefix || ‘0035D’
, p_message =>
‘reread check: l_app=’
|| coalesce(l_app, ‘<*null>’)
|| ‘, g_getkrg_last_app=’
|| coalesce(g_getkrg_last_app, ‘<*null>’)
|| ‘, g_mqget_retry_time=’
|| coalesce(trim(to_char(g_mqget_retry_time)), ‘<*null>’)
|| ‘, localtimestamp=’
|| coalesce(trim(to_char(localtimestamp)), ‘<*null>’)
);
end if;
Where the formatter in 12.10.0.30 gives me:
if lower(p_debug) = ‘debug’
then
utl_krg.msg_log.log_debug_msg(
p_schema => g_my_schema
, p_package => g_my_package
, p_routine => l_my_routine
, p_action => l_action
, p_msg_id => g_my_msg_prefix || ‘0035D’
, p_message => ‘resend check: l_app=’
|| coalesce(l_app, ‘<*null>’)
|| ‘, g_putkrg_last_app=’
|| coalesce(g_putkrg_last_app, ‘<*null>’)
|| ‘, g_mqput_retry_time=’
|| coalesce(trim(to_char(g_mqput_retry_time)), ‘<*null>’)
|| ‘, localtimestamp=’
|| coalesce(trim(to_char(localtimestamp)), ‘<*null>’)
);
end if;
Which is more both compact and better readable.
I assume some customer(s) have asked questions that have prompted the change in formatter behavior,
so I’m not going to ask for a reversal of the change. But could we have a formatting parameter,
to force or not force all parameters onto a separate line if any parameter overflows?
While I’m at it, we’d also like a distinction between Oracle supplied functions, and user-defined ones.
Would it be possible to have separate formatting rules for these two categories of functions?