From 3ed47b65e8ca898b8ed38be771b118cd5f969e3d Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Thu, 4 Jun 2026 08:06:04 +0100 Subject: [PATCH] Bug 42764: Use inline codespell:ignore for SAN-Ouest Provence in templates Rather than excluding the entire about.tt files from codespell scanning, annotate only the specific lines containing the proper noun "Provence" (SAN-Ouest Provence, a French library co-operative and Koha sponsor) with an inline TT comment that codespell recognises as a per-line ignore. This lets codespell continue to check the rest of each file for genuine spelling mistakes, while still catching accidental "Provence" for "Province" in any other template not carrying this annotation. Replaces the file-level exceptions added to Koha::Devel::Files in favour of the more surgical inline approach. Test plan: 1. Apply patch 2. Verify "Provence" on the annotated lines produces no codespell output: codespell -d --ignore-words .codespell-ignore \ koha-tmpl/intranet-tmpl/prog/en/modules/about.tt => no output 3. Verify the rest of about.tt is still checked by introducing a deliberate typo elsewhere in the file and confirming codespell flags it 4. prove xt/author/codespell.t => All tests pass Signed-off-by: Martin Renvoize --- Koha/Devel/Files.pm | 12 +++--------- koha-tmpl/intranet-tmpl/prog/en/modules/about.tt | 2 +- .../intranet-tmpl/prog/en/modules/about.tt | 7 +++---- .../intranet-tmpl/prog/fr-CA/modules/about.tt | 4 ++-- 4 files changed, 9 insertions(+), 16 deletions(-) diff --git a/Koha/Devel/Files.pm b/Koha/Devel/Files.pm index 4ed54179fe..51e81e1cbc 100644 --- a/Koha/Devel/Files.pm +++ b/Koha/Devel/Files.pm @@ -102,15 +102,9 @@ my $exceptions = { misc/cronjobs/rss ) ], - codespell => [ - qw( - koha-tmpl/intranet-tmpl/prog/en/modules/about.tt - t/mock_templates/intranet-tmpl/prog/en/modules/about.tt - t/mock_templates/intranet-tmpl/prog/fr-CA/modules/about.tt - ) - ], - core => [], - nonce => [qw(t/lib/plugins/Koha/Plugin/TestValuebuilder/test_valuebuilder_popup.tt)], + codespell => [], + core => [], + nonce => [qw(t/lib/plugins/Koha/Plugin/TestValuebuilder/test_valuebuilder_popup.tt)], }, yml => { core => [], diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt index 7a4502bf1a..749daafad3 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt @@ -896,7 +896,7 @@
  • The Athens County Public Libraries, Ohio, USA (MARC sponsorship, documentation, template maintenance)
  • EMN (Ecole des Mines de Nantes), France (Suggestions, Stats wizards and improved LDAP sponsorship)
  • Mines Paristech (previously Ecole Nationale Supérieure des Mines de Paris), France (bibliographic frameworks, MARC authorities, OPAC basket, Serials sponsorship)
  • -
  • SAN-Ouest Provence, France (Koha 3.0 enhancements to patrons and holds modules)
  • +
  • SAN-Ouest Provence, France (Koha 3.0 enhancements to patrons and holds modules) [%# codespell:ignore provence %]
  • The Crawford County Federated Library System, PA, USA (Koha 3.0 Zebra Integration sponsorship)
  • The Geauga County Public Library, OH, USA (Koha 3.0 beta testing)
  • The Near East University, Cyprus
  • diff --git a/t/mock_templates/intranet-tmpl/prog/en/modules/about.tt b/t/mock_templates/intranet-tmpl/prog/en/modules/about.tt index 73f35942ff..f7fbc9ff34 100644 --- a/t/mock_templates/intranet-tmpl/prog/en/modules/about.tt +++ b/t/mock_templates/intranet-tmpl/prog/en/modules/about.tt @@ -14,8 +14,7 @@ > [% INCLUDE 'doc-head-close.inc' %] - -[% INCLUDE 'header.inc' %] + [% INCLUDE 'header.inc' %] [% PROCESS 'about-team.inc' %] [% WRAPPER 'sub-header.inc' %] @@ -764,7 +763,7 @@
  • The Athens County Public Libraries, Ohio, USA (MARC sponsorship, documentation, template maintenance)
  • EMN (Ecole des Mines de Nantes), France (Suggestions, Stats wizards and improved LDAP sponsorship)
  • Mines Paristech (previously Ecole Nationale Supérieure des Mines de Paris), France (bibliographic frameworks, MARC authorities, OPAC basket, Serials sponsorship)
  • -
  • SAN-Ouest Provence, France (Koha 3.0 enhancements to patrons and holds modules)
  • +
  • SAN-Ouest Provence, France (Koha 3.0 enhancements to patrons and holds modules) [%# codespell:ignore provence %]
  • The Crawford County Federated Library System, PA, USA (Koha 3.0 Zebra Integration sponsorship)
  • The Geauga County Public Library, OH, USA (Koha 3.0 beta testing)
  • The Near East University, Cyprus
  • @@ -910,7 +909,7 @@
  • Rijksmuseum, Amsterdam, The Netherlands
  • Rolling Hills Consolidated Libraries, USA
  • Round Rock Public Library, USA
  • -
  • SAN-Ouest Provence, France
  • +
  • SAN-Ouest Provence, France[%# codespell:ignore provence %]
  • Sefton Council, United Kingdom
  • software.coop, United Kingdom
  • South-East Kansas Library System (SEKLS), USA
  • diff --git a/t/mock_templates/intranet-tmpl/prog/fr-CA/modules/about.tt b/t/mock_templates/intranet-tmpl/prog/fr-CA/modules/about.tt index 7a7988b341..e499f103f5 100644 --- a/t/mock_templates/intranet-tmpl/prog/fr-CA/modules/about.tt +++ b/t/mock_templates/intranet-tmpl/prog/fr-CA/modules/about.tt @@ -764,7 +764,7 @@
  • The Athens County Public Libraries, Ohio, USA (MARC sponsorship, documentation, template maintenance)
  • EMN (Ecole des Mines de Nantes), France (Suggestions, Stats wizards and improved LDAP sponsorship)
  • Mines Paristech (previously Ecole Nationale Supérieure des Mines de Paris), France (bibliographic frameworks, MARC authorities, OPAC basket, Serials sponsorship)
  • -
  • SAN-Ouest Provence, France (Koha 3.0 enhancements to patrons and holds modules)
  • +
  • SAN-Ouest Provence, France (Koha 3.0 enhancements to patrons and holds modules) [%# codespell:ignore provence %]
  • The Crawford County Federated Library System, PA, USA (Koha 3.0 Zebra Integration sponsorship)
  • The Geauga County Public Library, OH, USA (Koha 3.0 beta testing)
  • The Near East University, Cyprus
  • @@ -910,7 +910,7 @@
  • Rijksmuseum, Amsterdam, The Netherlands
  • Rolling Hills Consolidated Libraries, USA
  • Round Rock Public Library, USA
  • -
  • SAN-Ouest Provence, France
  • +
  • SAN-Ouest Provence, France[%# codespell:ignore provence %]
  • Sefton Council, United Kingdom
  • software.coop, United Kingdom
  • South-East Kansas Library System (SEKLS), USA