From d474fc60540f2cdb646604bfd461e6f1d1795e64 Mon Sep 17 00:00:00 2001 From: Lucie Dubrunfaut Date: Thu, 18 Jan 2024 16:47:24 +0100 Subject: [PATCH] Handle with stopword path --- .github/scripts/pod_spell_check.t | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/.github/scripts/pod_spell_check.t b/.github/scripts/pod_spell_check.t index 20b763dcab..dd932714fc 100644 --- a/.github/scripts/pod_spell_check.t +++ b/.github/scripts/pod_spell_check.t @@ -1,13 +1,22 @@ use strict; use warnings; -use Test::More; +use Test::More; use Test::Spelling; -open(FILE, "<", "stopwords.t"); -add_stopwords(); +if (!@ARGV) { + die "Missing perl file to check."; +} -set_spell_cmd('hunspell -l'); -all_pod_files_spelling_ok( $ARGV[0]); +my $stopword_filename='.github/scripts/stopwords.t'; +if(defined($ARGV[1])){ + $stopword_filename=$ARGV[1]; +} +open(FILE, "<", $stopword_filename) + or die "Could not open $stopword_filename"; +printf("stopword file use : ".$stopword_filename." \n"); +add_stopwords(); +set_spell_cmd('hunspell -l'); +all_pod_files_spelling_ok($ARGV[0]); close(FILE); \ No newline at end of file