From 74c7d8df3adb21b3f918d24512e227f66c75fdd9 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sat, 13 Oct 2018 21:03:48 +0000 Subject: latexindent (13oct18) git-svn-id: svn://tug.org/texlive/trunk@48905 c570f23f-e606-0410-a88d-b1316a301751 --- .../latexindent/LatexIndent/GetYamlSettings.pm | 33 +++++++++++++--------- .../scripts/latexindent/LatexIndent/Version.pm | 4 +-- .../scripts/latexindent/defaultSettings.yaml | 2 +- .../texmf-dist/scripts/latexindent/latexindent.pl | 2 +- 4 files changed, 23 insertions(+), 18 deletions(-) (limited to 'Master/texmf-dist/scripts/latexindent') diff --git a/Master/texmf-dist/scripts/latexindent/LatexIndent/GetYamlSettings.pm b/Master/texmf-dist/scripts/latexindent/LatexIndent/GetYamlSettings.pm index 84558485951..a190d1e5f8c 100644 --- a/Master/texmf-dist/scripts/latexindent/LatexIndent/GetYamlSettings.pm +++ b/Master/texmf-dist/scripts/latexindent/LatexIndent/GetYamlSettings.pm @@ -85,24 +85,29 @@ sub yaml_read_settings{ # messages for indentconfig.yaml and/or .indentconfig.yaml if ( -e $indentconfig and !$switches{onlyDefault}) { - $logger->info("Reading path information from $indentconfig"); - # if both indentconfig.yaml and .indentconfig.yaml exist - if ( -e File::HomeDir->my_home . "/indentconfig.yaml" and -e File::HomeDir->my_home . "/.indentconfig.yaml") { - $logger->info("$homeDir/.indentconfig.yaml has been found, but $indentconfig takes priority"); - } elsif ( -e File::HomeDir->my_home . "/indentconfig.yaml" ) { - $logger->info("(Alternatively $homeDir/.indentconfig.yaml can be used)"); - } elsif ( -e File::HomeDir->my_home . "/.indentconfig.yaml" ) { - $logger->info("(Alternatively $homeDir/indentconfig.yaml can be used)"); - } - # read the absolute paths from indentconfig.yaml $userSettings = YAML::Tiny->read( "$indentconfig" ); - # output the contents of indentconfig to the log file - $logger->info(Dump \%{$userSettings->[0]}); - # update the absolute paths - @absPaths = @{$userSettings->[0]->{paths}}; + if($userSettings and (ref($userSettings->[0]) eq 'HASH') and $userSettings->[0]->{paths}){ + $logger->info("Reading path information from $indentconfig"); + # if both indentconfig.yaml and .indentconfig.yaml exist + if ( -e File::HomeDir->my_home . "/indentconfig.yaml" and -e File::HomeDir->my_home . "/.indentconfig.yaml") { + $logger->info("$homeDir/.indentconfig.yaml has been found, but $indentconfig takes priority"); + } elsif ( -e File::HomeDir->my_home . "/indentconfig.yaml" ) { + $logger->info("(Alternatively $homeDir/.indentconfig.yaml can be used)"); + } elsif ( -e File::HomeDir->my_home . "/.indentconfig.yaml" ) { + $logger->info("(Alternatively $homeDir/indentconfig.yaml can be used)"); + } + + # output the contents of indentconfig to the log file + $logger->info(Dump \%{$userSettings->[0]}); + + @absPaths = @{$userSettings->[0]->{paths}}; + } else { + $logger->warn("*The paths field cannot be read from $indentconfig; this means it is either empty or contains invalid YAML"); + $logger->warn("See https://latexindentpl.readthedocs.io/en/latest/sec-indent-config-and-settings.html for an example"); + } } else { if($switches{onlyDefault}) { $logger->info("*-d switch active: only default settings requested"); diff --git a/Master/texmf-dist/scripts/latexindent/LatexIndent/Version.pm b/Master/texmf-dist/scripts/latexindent/LatexIndent/Version.pm index 14e84d15c6d..4dd9ec1da57 100644 --- a/Master/texmf-dist/scripts/latexindent/LatexIndent/Version.pm +++ b/Master/texmf-dist/scripts/latexindent/LatexIndent/Version.pm @@ -19,6 +19,6 @@ use warnings; use Exporter qw/import/; our @EXPORT_OK = qw/$versionNumber $versionDate/; -our $versionNumber = '3.5.2'; -our $versionDate = '2018-10-06'; +our $versionNumber = '3.5.3'; +our $versionDate = '2018-10-13'; 1 diff --git a/Master/texmf-dist/scripts/latexindent/defaultSettings.yaml b/Master/texmf-dist/scripts/latexindent/defaultSettings.yaml index 69436cd7d8a..ad6a61fed57 100755 --- a/Master/texmf-dist/scripts/latexindent/defaultSettings.yaml +++ b/Master/texmf-dist/scripts/latexindent/defaultSettings.yaml @@ -1,4 +1,4 @@ -# defaultSettings.yaml for latexindent.pl, version 3.5.2, 2018-10-06 +# defaultSettings.yaml for latexindent.pl, version 3.5.3, 2018-10-13 # a script that aims to # beautify .tex, .sty, .cls files # diff --git a/Master/texmf-dist/scripts/latexindent/latexindent.pl b/Master/texmf-dist/scripts/latexindent/latexindent.pl index 6ff6ea348a6..d55682eadde 100755 --- a/Master/texmf-dist/scripts/latexindent/latexindent.pl +++ b/Master/texmf-dist/scripts/latexindent/latexindent.pl @@ -1,5 +1,5 @@ #!/usr/bin/env perl -# latexindent.pl, version 3.5.2, 2018-10-06 +# latexindent.pl, version 3.5.3, 2018-10-13 # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by -- cgit v1.2.3