From: Andreas Gerler Date: Wed, 24 Dec 2025 17:16:00 +0000 (+0100) Subject: update flymake-perlcritic X-Git-Url: http://git.bundesbrandschatzamt.de/?a=commitdiff_plain;h=83d21fa0fed11e3e9c3e4be1935d254bec92b423;p=emacsconfig.git update flymake-perlcritic --- diff --git a/elpa/flymake-perlcritic-20240229.953/flymake-perlcritic-autoloads.el b/elpa/flymake-perlcritic-20240229.953/flymake-perlcritic-autoloads.el deleted file mode 100644 index 9d25c169..00000000 --- a/elpa/flymake-perlcritic-20240229.953/flymake-perlcritic-autoloads.el +++ /dev/null @@ -1,32 +0,0 @@ -;;; flymake-perlcritic-autoloads.el --- automatically extracted autoloads (do not edit) -*- lexical-binding: t -*- -;; Generated by the `loaddefs-generate' function. - -;; This file is part of GNU Emacs. - -;;; Code: - -(add-to-list 'load-path (or (and load-file-name (directory-file-name (file-name-directory load-file-name))) (car load-path))) - - - -;;; Generated autoloads from flymake-perlcritic.el - -(autoload 'flymake-perlcritic-setup "flymake-perlcritic" "\ -Set up Flymake perlcritic. -Add perlcritic to the Flymake diagnostic functions. To use it, -add this function to `perl-mode-hook'.") -(register-definition-prefixes "flymake-perlcritic" '("flymake-perlcritic-")) - -;;; End of scraped data - -(provide 'flymake-perlcritic-autoloads) - -;; Local Variables: -;; version-control: never -;; no-byte-compile: t -;; no-update-autoloads: t -;; no-native-compile: t -;; coding: utf-8-emacs-unix -;; End: - -;;; flymake-perlcritic-autoloads.el ends here diff --git a/elpa/flymake-perlcritic-20240229.953/flymake-perlcritic-pkg.el b/elpa/flymake-perlcritic-20240229.953/flymake-perlcritic-pkg.el deleted file mode 100644 index 3924db74..00000000 --- a/elpa/flymake-perlcritic-20240229.953/flymake-perlcritic-pkg.el +++ /dev/null @@ -1,10 +0,0 @@ -;; -*- no-byte-compile: t; lexical-binding: nil -*- -(define-package "flymake-perlcritic" "20240229.953" - "Flymake handler for Perl to invoke Perl::Critic." - '((flymake "1.2")) - :url "https://github.com/flymake/emacs-flymake-perlcritic" - :commit "f65ac37608b78ce785808c27fba86a8102a4ff95" - :revdesc "f65ac37608b7" - :authors '(("Sam Graham" . "libflymake-perlcritic-emacsBLAHBLAHillusori.co.uk") - ("gemmaro" . "gemmaro.dev@gmail.com")) - :maintainers '(("Sam Graham" . "libflymake-perlcritic-emacsBLAHBLAHillusori.co.uk"))) diff --git a/elpa/flymake-perlcritic-20240229.953/flymake-perlcritic.el b/elpa/flymake-perlcritic-20240229.953/flymake-perlcritic.el deleted file mode 100644 index c8c00a14..00000000 --- a/elpa/flymake-perlcritic-20240229.953/flymake-perlcritic.el +++ /dev/null @@ -1,165 +0,0 @@ -;;; flymake-perlcritic.el --- Flymake handler for Perl to invoke Perl::Critic -;; -;; Copyright (C) 2011-2024 Free Software Foundation, Inc. -;; -;; Author: Sam Graham -;; gemmaro -;; Maintainer: Sam Graham -;; URL: https://github.com/illusori/emacs-flymake-perlcritic -;; Package-Version: 20240229.953 -;; Package-Revision: f65ac37608b7 -;; Package-Requires: ((flymake "1.2")) -;; -;; 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 -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. -;; -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. -;; -;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see . -;; -;;; Commentary: -;; -;; `flymake-perlcritic.el' adds support to `flymake.el' for running -;; `Perl::Critic' (http://search.cpan.org/perldoc?Perl::Critic) to -;; perform static analysis of your Perl code in addition to syntax -;; checking. -;; -;;; Usage: -;; (add-hook 'perl-mode-hook 'flymake-perlcritic-setup) - -;;; Code: - -(require 'flymake) - -(defcustom flymake-perlcritic-command (executable-find "perlcritic") - "Command of perlcritic. -If `perlcritic' isn't in your `$PATH', set it to the command -needed to run it." - :group 'flymake-perlcritic - :type '(choice file string)) - -(defcustom flymake-perlcritic-profile nil - "Profile path of perlcritic. -The path to the profile file to configure perlcritic, if nil then -perlcritic will look in its default location (`~/.perlcriticrc')." - :group 'flymake-perlcritic - :type '(choice (const :tag "Default" nil) - file)) - -(defconst flymake-perlcritic--severities - '(choice (const :tag "gentle" 5) - (const :tag "stern" 4) - (const :tag "harsh" 3) - (const :tag "cruel" 2) - (const :tag "brutal" 1)) - "Severities of perlcritic. -See also the `perlcritic' documentation[1]. - -[1] https://metacpan.org/dist/Perl-Critic/view/bin/perlcritic#-severity-NAME") - -(defcustom flymake-perlcritic-severity 4 - "The perlcritic severity. -The severity to run perlcritic at, values are from \"brutal\" (1) -to \"gentle\" (5) with \"brutal\" (1) being the strictest." - :group 'flymake-perlcritic - :type flymake-perlcritic--severities) - -(defcustom flymake-perlcritic-error-threshold 5 - "Error threshold for Flymake diagnostic types. -The lower Severities are considered to be at \"warning\" or \"note\" level." - :group 'flymake-perlcritic - :type `(choice (const :tag "Default" nil) - ,flymake-perlcritic--severities)) - -(defcustom flymake-perlcritic-warning-threshold nil - "Warning threshold for Flymake diagnostic types. -The lower severities are considered to be at \"note\" level." - :group 'flymake-perlcritic - :type `(choice (const :tag "Default" nil) - ,flymake-perlcritic--severities)) - -(defvar-local flymake-perlcritic--proc nil - "Flymake perlcritic process.") - -(defun flymake-perlcritic-backend (report-fn &rest _args) - "Flymake for perlcritic. -This calls REPORT-FN to pass diagnostic objects." - (unless flymake-perlcritic-command - (error "Cannot find a suitable perlcritic")) - (when (process-live-p flymake-perlcritic--proc) - (kill-process flymake-perlcritic--proc)) - (let ((source (current-buffer))) - (save-restriction - (widen) - (setq flymake-perlcritic--proc - (make-process - :name "flymake-perlcritic" - :noquery t - :connection-type 'pipe - :buffer (generate-new-buffer " *Flymake-perlcritic*") - :command (flymake-perlcritic-init) - :sentinel (apply-partially 'flymake-perlcritic--sentinel report-fn source))) - (process-send-region flymake-perlcritic--proc (point-min) (point-max)) - (process-send-eof flymake-perlcritic--proc)))) - -(defun flymake-perlcritic--sentinel (report-fn source proc _event) - "Sentinel for perlcritic process PROC. -SOURCE is the target source for perlcritic. When perlcritic -exits successfully, it calls REPORT-FN to report to Flymake." - (when (memq (process-status proc) '(exit signal)) - (unwind-protect - (if (with-current-buffer source (eq proc flymake-perlcritic--proc)) - (with-current-buffer (process-buffer proc) - (goto-char (point-min)) - (cl-loop - while (search-forward-regexp - (rx (group (+ digit)) ":" - (group (+ digit)) ":" - (group (+ digit)) ":" - (group (+ not-newline)) - line-end) - nil t) - for severity = (string-to-number (match-string 1)) - for line = (string-to-number (match-string 2)) - for column = (string-to-number (match-string 3)) - for msg = (match-string 4) - for (beg . end) = (flymake-diag-region source line column) - for type = (cond - ((and flymake-perlcritic-error-threshold - (>= severity flymake-perlcritic-error-threshold)) - :error) - ((and flymake-perlcritic-warning-threshold - (>= severity flymake-perlcritic-warning-threshold)) - :warning) - (t :note)) - collect (flymake-make-diagnostic source beg end type msg) - into diags - finally (funcall report-fn diags))) - (flymake-log :warning "Canceling obsolete check %s" proc)) - (kill-buffer (process-buffer proc))))) - -(defun flymake-perlcritic-init () - "Initialise perlcritic command." - (let ((command (list "perlcritic" - "--nocolour" - "--verbose" "%s:%l:%c:%m. %e. (%p)\\n" - "--severity" (number-to-string flymake-perlcritic-severity)))) - (if flymake-perlcritic-profile - (append command (list "--profile" flymake-perlcritic-profile)) - command))) - -;;;###autoload -(defun flymake-perlcritic-setup () - "Set up Flymake perlcritic. -Add perlcritic to the Flymake diagnostic functions. To use it, -add this function to `perl-mode-hook'." - (add-hook 'flymake-diagnostic-functions 'flymake-perlcritic-backend nil 'local)) - -(provide 'flymake-perlcritic) -;;; flymake-perlcritic.el ends here. diff --git a/elpa/flymake-perlcritic-20250615.802/flymake-perlcritic-autoloads.el b/elpa/flymake-perlcritic-20250615.802/flymake-perlcritic-autoloads.el new file mode 100644 index 00000000..9d25c169 --- /dev/null +++ b/elpa/flymake-perlcritic-20250615.802/flymake-perlcritic-autoloads.el @@ -0,0 +1,32 @@ +;;; flymake-perlcritic-autoloads.el --- automatically extracted autoloads (do not edit) -*- lexical-binding: t -*- +;; Generated by the `loaddefs-generate' function. + +;; This file is part of GNU Emacs. + +;;; Code: + +(add-to-list 'load-path (or (and load-file-name (directory-file-name (file-name-directory load-file-name))) (car load-path))) + + + +;;; Generated autoloads from flymake-perlcritic.el + +(autoload 'flymake-perlcritic-setup "flymake-perlcritic" "\ +Set up Flymake perlcritic. +Add perlcritic to the Flymake diagnostic functions. To use it, +add this function to `perl-mode-hook'.") +(register-definition-prefixes "flymake-perlcritic" '("flymake-perlcritic-")) + +;;; End of scraped data + +(provide 'flymake-perlcritic-autoloads) + +;; Local Variables: +;; version-control: never +;; no-byte-compile: t +;; no-update-autoloads: t +;; no-native-compile: t +;; coding: utf-8-emacs-unix +;; End: + +;;; flymake-perlcritic-autoloads.el ends here diff --git a/elpa/flymake-perlcritic-20250615.802/flymake-perlcritic-pkg.el b/elpa/flymake-perlcritic-20250615.802/flymake-perlcritic-pkg.el new file mode 100644 index 00000000..3b22e9ee --- /dev/null +++ b/elpa/flymake-perlcritic-20250615.802/flymake-perlcritic-pkg.el @@ -0,0 +1,10 @@ +;; -*- no-byte-compile: t; lexical-binding: nil -*- +(define-package "flymake-perlcritic" "20250615.802" + "Flymake handler for Perl to invoke Perl::Critic." + '((flymake "1.2")) + :url "https://github.com/illusori/emacs-flymake-perlcritic" + :commit "311743e97d2f705e76755697eea9ff451a39dd64" + :revdesc "311743e97d2f" + :authors '(("Sam Graham" . "libflymake-perlcritic-emacsBLAHBLAHillusori.co.uk") + ("gemmaro" . "gemmaro.dev@gmail.com")) + :maintainers '(("Sam Graham" . "libflymake-perlcritic-emacsBLAHBLAHillusori.co.uk"))) diff --git a/elpa/flymake-perlcritic-20250615.802/flymake-perlcritic.el b/elpa/flymake-perlcritic-20250615.802/flymake-perlcritic.el new file mode 100644 index 00000000..86870bf2 --- /dev/null +++ b/elpa/flymake-perlcritic-20250615.802/flymake-perlcritic.el @@ -0,0 +1,165 @@ +;;; flymake-perlcritic.el --- Flymake handler for Perl to invoke Perl::Critic +;; +;; Copyright (C) 2011-2024 Free Software Foundation, Inc. +;; +;; Author: Sam Graham +;; gemmaro +;; Maintainer: Sam Graham +;; URL: https://github.com/illusori/emacs-flymake-perlcritic +;; Package-Version: 20250615.802 +;; Package-Revision: 311743e97d2f +;; Package-Requires: ((flymake "1.2")) +;; +;; 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 +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. +;; +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. +;; +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . +;; +;;; Commentary: +;; +;; `flymake-perlcritic.el' adds support to `flymake.el' for running +;; `Perl::Critic' (http://search.cpan.org/perldoc?Perl::Critic) to +;; perform static analysis of your Perl code in addition to syntax +;; checking. +;; +;;; Usage: +;; (add-hook 'perl-mode-hook 'flymake-perlcritic-setup) + +;;; Code: + +(require 'flymake) + +(defcustom flymake-perlcritic-command (executable-find "perlcritic") + "Command of perlcritic. +If `perlcritic' isn't in your `$PATH', set it to the command +needed to run it." + :group 'flymake-perlcritic + :type '(choice file string)) + +(defcustom flymake-perlcritic-profile nil + "Profile path of perlcritic. +The path to the profile file to configure perlcritic, if nil then +perlcritic will look in its default location (`~/.perlcriticrc')." + :group 'flymake-perlcritic + :type '(choice (const :tag "Default" nil) + file)) + +(defconst flymake-perlcritic--severities + '(choice (const :tag "gentle" 5) + (const :tag "stern" 4) + (const :tag "harsh" 3) + (const :tag "cruel" 2) + (const :tag "brutal" 1)) + "Severities of perlcritic. +See also the `perlcritic' documentation[1]. + +[1] https://metacpan.org/dist/Perl-Critic/view/bin/perlcritic#-severity-NAME") + +(defcustom flymake-perlcritic-severity 4 + "The perlcritic severity. +The severity to run perlcritic at, values are from \"brutal\" (1) +to \"gentle\" (5) with \"brutal\" (1) being the strictest." + :group 'flymake-perlcritic + :type flymake-perlcritic--severities) + +(defcustom flymake-perlcritic-error-threshold 5 + "Error threshold for Flymake diagnostic types. +The lower Severities are considered to be at \"warning\" or \"note\" level." + :group 'flymake-perlcritic + :type `(choice (const :tag "Default" nil) + ,flymake-perlcritic--severities)) + +(defcustom flymake-perlcritic-warning-threshold nil + "Warning threshold for Flymake diagnostic types. +The lower severities are considered to be at \"note\" level." + :group 'flymake-perlcritic + :type `(choice (const :tag "Default" nil) + ,flymake-perlcritic--severities)) + +(defvar-local flymake-perlcritic--proc nil + "Flymake perlcritic process.") + +(defun flymake-perlcritic-backend (report-fn &rest _args) + "Flymake for perlcritic. +This calls REPORT-FN to pass diagnostic objects." + (unless flymake-perlcritic-command + (error "Cannot find a suitable perlcritic")) + (when (process-live-p flymake-perlcritic--proc) + (kill-process flymake-perlcritic--proc)) + (let ((source (current-buffer))) + (save-restriction + (widen) + (setq flymake-perlcritic--proc + (make-process + :name "flymake-perlcritic" + :noquery t + :connection-type 'pipe + :buffer (generate-new-buffer " *Flymake-perlcritic*") + :command (flymake-perlcritic-init) + :sentinel (apply-partially 'flymake-perlcritic--sentinel report-fn source))) + (process-send-region flymake-perlcritic--proc (point-min) (point-max)) + (process-send-eof flymake-perlcritic--proc)))) + +(defun flymake-perlcritic--sentinel (report-fn source proc _event) + "Sentinel for perlcritic process PROC. +SOURCE is the target source for perlcritic. When perlcritic +exits successfully, it calls REPORT-FN to report to Flymake." + (when (memq (process-status proc) '(exit signal)) + (unwind-protect + (if (with-current-buffer source (eq proc flymake-perlcritic--proc)) + (with-current-buffer (process-buffer proc) + (goto-char (point-min)) + (cl-loop + while (search-forward-regexp + (rx (group (+ digit)) ":" + (group (+ digit)) ":" + (group (+ digit)) ":" + (group (+ not-newline)) + line-end) + nil t) + for severity = (string-to-number (match-string 1)) + for line = (string-to-number (match-string 2)) + for column = (string-to-number (match-string 3)) + for msg = (match-string 4) + for (beg . end) = (flymake-diag-region source line column) + for type = (cond + ((and flymake-perlcritic-error-threshold + (>= severity flymake-perlcritic-error-threshold)) + :error) + ((and flymake-perlcritic-warning-threshold + (>= severity flymake-perlcritic-warning-threshold)) + :warning) + (t :note)) + collect (flymake-make-diagnostic source beg end type msg) + into diags + finally (funcall report-fn diags))) + (flymake-log :warning "Canceling obsolete check %s" proc)) + (kill-buffer (process-buffer proc))))) + +(defun flymake-perlcritic-init () + "Initialise perlcritic command." + (let ((command (list flymake-perlcritic-command + "--nocolour" + "--verbose" "%s:%l:%c:%m. %e. (%p)\\n" + "--severity" (number-to-string flymake-perlcritic-severity)))) + (if flymake-perlcritic-profile + (append command (list "--profile" flymake-perlcritic-profile)) + command))) + +;;;###autoload +(defun flymake-perlcritic-setup () + "Set up Flymake perlcritic. +Add perlcritic to the Flymake diagnostic functions. To use it, +add this function to `perl-mode-hook'." + (add-hook 'flymake-diagnostic-functions 'flymake-perlcritic-backend nil 'local)) + +(provide 'flymake-perlcritic) +;;; flymake-perlcritic.el ends here.