Subject: [bug#63866] [PATCH v3 13/13] gnu: Add tidyall.

From: gemmaro <[email-masked]>
Date: Wed, 5 Feb 2025 12:59:05 +0900

* gnu/packages/check.scm (tidyall): New variable.

Change-Id: Ic79089652d5768b62f626aa625905b904bfb40fc
---
 gnu/packages/check.scm | 73 +++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 72 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/check.scm b/gnu/packages/check.scm
index df858af4bd..cd09d9a393 100644
--- a/gnu/packages/check.scm
+++ b/gnu/packages/check.scm
@@ -52,7 +52,7 @@
 ;;; Copyright © 2024 Giacomo Leidi <[email-masked]>
 ;;; Copyright © 2024 Zheng Junjie <[email-masked]>
 ;;; Copyright © 2024 Navid Afkhami <[email-masked]>
-;;; Copyright © 2024 gemmaro <[email-masked]>
+;;; Copyright © 2024, 2025 gemmaro <[email-masked]>
 ;;; Copyright © 2024 Ashvith Shetty <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
@@ -97,6 +97,8 @@ (define-module (gnu packages check)
   #:use-module (gnu packages maths)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages perl)
+  #:use-module (gnu packages perl-check)
+  #:use-module (gnu packages php)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
   #:use-module (gnu packages python-check)
@@ -121,6 +123,7 @@ (define-module (gnu packages check)
   #:use-module (guix build-system go)
   #:use-module (guix build-system guile)
   #:use-module (guix build-system meson)
+  #:use-module (guix build-system perl)
   #:use-module (guix build-system pyproject)
   #:use-module (guix build-system python)
   #:use-module (guix build-system trivial)
@@ -3879,6 +3882,74 @@ (define-public trompeloeil
      "Trompeloeil is a thread-safe header-only mocking framework for C++11/14.")
     (license license:boost1.0)))
 
+(define-public tidyall
+  (package
+    (name "tidyall")
+    (version "0.84")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append
+             "mirror://cpan/authors/id/D/DR/DROLSKY/Code-TidyAll-" version
+             ".tar.gz"))
+       (sha256
+        (base32 "1xxil8yfbd4nizwaaris07sp441nhx3ixr4qj13l1x6pxphi9h5k"))))
+    (build-system perl-build-system)
+    (arguments
+     (list
+      #:phases #~(modify-phases %standard-phases
+                   (delete 'remove-command-line-tool)
+                   (add-after 'install 'wrap-programs
+                     (lambda _
+                       (wrap-program (string-append #$output "/bin/tidyall")
+                         (list "PERL5LIB" ":"
+                               'prefix
+                               (list (getenv "PERL5LIB")
+                                     (string-append #$output
+                                                    "/lib/perl5/site_perl")))))))))
+    (native-inputs (list perl-test-class-most
+                         perl-test-differences
+                         perl-test-fatal
+                         perl-test-warnings
+                         perl-lib-relative
+                         php))
+    (inputs (list bash-minimal))
+    (propagated-inputs (list perl-capture-tiny
+                             perl-config-ini
+                             perl-timedate
+                             perl-file-which
+                             perl-ipc-run3
+                             perl-ipc-system-simple
+                             perl-list-compare
+                             perl-list-someutils
+                             perl-log-any
+                             perl-module-runtime
+                             perl-moo-2
+                             perl-path-tiny
+                             perl-scope-guard
+                             perl-specio
+                             perl-specio-library-path-tiny
+                             perl-text-diff
+                             perl-time-duration-parse
+                             perl-try-tiny
+                             perl-parallel-forkmanager
+                             perl-file-pushd))
+    (home-page "https://metacpan.org/release/Code-TidyAll")
+    (synopsis "Engine for tidyall, your all-in-one code tidier and validator")
+    (description
+     "@command{tidyall} makes a lot of code tidiers and validators available
+from a single unified interface.  You can run @command{tidyall} on a
+single file or on an entire project hierarchy, and configure which
+tidiers/validators are applied to which files.  @command{tidyall} will
+back up files beforehand, and for efficiency will only consider files
+that have changed since they were last processed.
+
+Note that if you see some missing tidier or validator modules error,
+you can let tidyall load them after install them.  For example, one
+can run @code{guix shell perl-perl-tidy perl} in advance to load
+@code{Perl::Tidy}.")
+    (license license:perl-license)))
+
 (define-public unittest-cpp
   (package
     (name "unittest-cpp")
-- 
2.47.1