From: Steve Hancock Date: Sat, 16 Jan 2021 14:41:32 +0000 (-0800) Subject: turn off -bli if -bar is set and issue warning X-Git-Tag: 20210402~83 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=ef69531b5ce26c72118bfbb2364f2973ed2cfc27;p=perltidy.git turn off -bli if -bar is set and issue warning --- diff --git a/lib/Perl/Tidy.pm b/lib/Perl/Tidy.pm index 828f20c4..6c984986 100644 --- a/lib/Perl/Tidy.pm +++ b/lib/Perl/Tidy.pm @@ -3298,20 +3298,30 @@ sub check_options { $rOpts->{'indent-block-comments'} = 1; } + # -bar cannot be used with -bl or -bli; arbitrarily keep -bar + if ( $rOpts->{'opening-brace-always-on-right'} ) { + + if ( $rOpts->{'opening-brace-on-new-line'} ) { + Warn(<{'opening-brace-on-new-line'} = 0; + } + if ( $rOpts->{'brace-left-and-indent'} ) { + Warn(<{'brace-left-and-indent'} = 0; + } + } + # -bli flag implies -bl if ( $rOpts->{'brace-left-and-indent'} ) { $rOpts->{'opening-brace-on-new-line'} = 1; } - if ( $rOpts->{'opening-brace-always-on-right'} - && $rOpts->{'opening-brace-on-new-line'} ) - { - Warn(<{'opening-brace-on-new-line'} = 0; - } # it simplifies things if -bl is 0 rather than undefined if ( !defined( $rOpts->{'opening-brace-on-new-line'} ) ) { diff --git a/local-docs/BugLog.pod b/local-docs/BugLog.pod index e60c435a..5e281d49 100644 --- a/local-docs/BugLog.pod +++ b/local-docs/BugLog.pod @@ -2,6 +2,11 @@ =over 4 +=item B + +A conflict arises if both B<-bli> and B<-bar> are set. In this case a warning message +is given and B<-bli> is turned off. + =item B A blinking state was discovered in testing between the following two states