From ef69531b5ce26c72118bfbb2364f2973ed2cfc27 Mon Sep 17 00:00:00 2001 From: Steve Hancock Date: Sat, 16 Jan 2021 06:41:32 -0800 Subject: [PATCH] turn off -bli if -bar is set and issue warning --- lib/Perl/Tidy.pm | 28 +++++++++++++++++++--------- local-docs/BugLog.pod | 5 +++++ 2 files changed, 24 insertions(+), 9 deletions(-) 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 -- 2.39.5