Skip to content

Commit

Permalink
Enable STRICT in the Template-Toolkit code
Browse files Browse the repository at this point in the history
  • Loading branch information
shlomif committed Dec 2, 2024
1 parent 575cfbd commit c8bb54d
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 5 deletions.
13 changes: 9 additions & 4 deletions fc-solve/site/wml/lib/FreecellSolver/Site/TTRender.pm
Original file line number Diff line number Diff line change
Expand Up @@ -226,11 +226,12 @@ my $template = Template->new(
{
COMPILE_DIR => ( $ENV{TMPDIR} // "/tmp" ) . "/shlomif-hp-tt2-cache",
COMPILE_EXT => ".ttc",
ENCODING => 'utf8',
INCLUDE_PATH => [ ".", "./lib", ],
PRE_PROCESS => ["lib/blocks.tt2"],
POST_CHOMP => 1,
PRE_PROCESS => ["lib/blocks.tt2"],
RELATIVE => 1,
ENCODING => 'utf8',
STRICT => 1,
}
);

Expand Down Expand Up @@ -380,7 +381,9 @@ EOF
my $html = '';
$template->process( "src/$input_tt2_page_path.tt2",
$vars, \$html, binmode => ':utf8', )
or die $template->error();
or die "[["
. $template->error()
. " ; src/$input_tt2_page_path.tt2 ]]";

$toc->add_toc( \$html );
print $html;
Expand All @@ -394,7 +397,9 @@ EOF
my $html = '';
$template->process( "src/$input_tt2_page_path.tt2",
$vars, \$html, binmode => ':utf8', )
or die $template->error();
or die "[["
. $template->error()
. " ; src/$input_tt2_page_path.tt2 ]]";

$toc->add_toc( \$html );
path( @$d, @fn, )->touchpath()->spew_utf8($html);
Expand Down
3 changes: 3 additions & 0 deletions fc-solve/site/wml/lib/Inc/js_fc_solve.tt2
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[%- SET skip_solitairey = '' -%]
[%- SET skip_yui = '' -%]

[%- BLOCK set_up_requirejs -%]
requirejs.config({
baseUrl: '[% base_path %]js',
Expand Down
9 changes: 8 additions & 1 deletion fc-solve/site/wml/lib/blocks.tt2
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
[% SET html_lang = "en-US" %]
[%- SET body_params = '' -%]
[%- SET extra_h_header_contents = '' -%]
[%- SET href = '' -%]
[%- SET html_lang = "en-US" -%]
[%- SET more_keywords = '' -%]
[%- SET sect_class = '' -%]
[%- SET title = '' -%]
[%- SET xhtml1 = '' -%]

[% SET desc = "Freecell Solver - a Program and a Library written in C for Solving Games of Freecell and similar Solitaire Variants" %]
[% SET fcs_discuss_url = base_path _ "forums.html" %]
Expand Down
2 changes: 2 additions & 0 deletions fc-solve/site/wml/src/code-of-conduct/index.html.tt2
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

[%- WRAPPER wrap_html -%]

[%- SET country = 'Israel' -%]

[% BLOCK diversity_statement %]
<div class="diversity" id="diversity_statement">

Expand Down
2 changes: 2 additions & 0 deletions fc-solve/site/wml/src/js-fc-solve/expand-moves/index.html.tt2
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ card solitaire game, and <a href="#other_games">several related solitaire games<
[% END %]
</div>

[%- SET sel = '' -%]

[% BLOCK output_opt %]
<input name="unicode_suits" id="unicode_suits__[% id_base %]" type="radio" title="[% title %]" class="phoenix" value="[% value %]" [% IF sel %] checked="checked"[% END %]/><label for="unicode_suits__[% id_base %]">[% title %]</label><br />
[% END %]
Expand Down
1 change: 1 addition & 0 deletions fc-solve/site/wml/src/js-fc-solve/text/gui-tests.xhtml.tt2
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,5 @@ require(["ui-tests-driver"], function (tests_runner) {
<div id="qunit-fixture">test markup, will be hidden</div>

[% END %]
[%- SET sel = '' -%]
[% INCLUDE "src/js-fc-solve/text/index.html.tt2" %]
1 change: 1 addition & 0 deletions fc-solve/site/wml/src/js-fc-solve/text/index.html.tt2
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[%- SET sel = '' -%]
[% PROCESS "Inc/js_fc_solve.tt2" %]
[% UNLESS title %]
[%- SET title = "Online Freecell solver" -%]
Expand Down

0 comments on commit c8bb54d

Please sign in to comment.