[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
05/15: lint: Allow texinfo markup at beginning of description.
From: |
guix-commits |
Subject: |
05/15: lint: Allow texinfo markup at beginning of description. |
Date: |
Thu, 12 Dec 2024 06:54:24 -0500 (EST) |
civodul pushed a commit to branch master
in repository guix.
commit f28c32089d14303e2dd261009600478bc4ae0463
Author: Gabriel Wicki <gabriel@erlikon.ch>
AuthorDate: Mon Dec 2 23:36:44 2024 +0100
lint: Allow texinfo markup at beginning of description.
* guix/lint.scm(starts-with-texinfo-markup?): New function.
(check-description-style)[check-proper-start]: Add condition.
* tests/lint.scm: Add test case.
Change-Id: I674988882265d9e2041d48dba0f9627cd68bf292
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
---
guix/lint.scm | 8 +++++++-
tests/lint.scm | 5 +++++
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/guix/lint.scm b/guix/lint.scm
index 63d101ebf9..d6d48ad27c 100644
--- a/guix/lint.scm
+++ b/guix/lint.scm
@@ -370,6 +370,9 @@ superfluous when building natively and incorrect when
cross-compiling."
(define (properly-starts-sentence? s)
(string-match "^[(\"'`[:upper:][:digit:]]" s))
+(define (starts-with-texinfo-markup? s)
+ (string-match
"^@(acronym|dfn|code|command|emph|file|quotation|samp|uref|url)\\{.*?\\}" s))
+
(define (starts-with-abbreviation? s)
"Return #t if S starts with what looks like an abbreviation or acronym."
(string-match "^[A-Z][A-Z0-9]+\\>" s))
@@ -447,6 +450,7 @@ trademark sign '~a' at ~d")
'pre "-" 'post)))
(if (or (string-null? description)
(properly-starts-sentence? description)
+ (starts-with-texinfo-markup? description)
(string-prefix-ci? first-word (package-name package))
(string-suffix-ci? first-word (package-name package)))
'()
@@ -513,7 +517,9 @@ by two spaces; possible infraction~p at ~{~a~^, ~}")
(match (check-texinfo-markup description)
((and warning (? lint-warning?)) (list warning))
(plain-description
- (check-proper-start plain-description))))
+ (if (string-prefix? "@" description)
+ '()
+ (check-proper-start plain-description)))))
(list
(make-warning package
(G_ "invalid description: ~s")
diff --git a/tests/lint.scm b/tests/lint.scm
index 9297bfbaac..df7042c470 100644
--- a/tests/lint.scm
+++ b/tests/lint.scm
@@ -121,6 +121,11 @@
(description "bad description."))))
(check-description-style pkg))))
+(test-equal "description: may start with texinfo markup"
+ '()
+ (check-description-style
+ (dummy-package "x" (description "@emph{Maxwell Equations of Software}"))))
+
(test-equal "description: may start with a digit"
'()
(let ((pkg (dummy-package "x"
- branch master updated (d916d3b156 -> 9ef5533123), guix-commits, 2024/12/12
- 01/15: transformations: Add tuning wrapper for gfortran., guix-commits, 2024/12/12
- 03/15: lint: Fix indentation., guix-commits, 2024/12/12
- 07/15: lint: Prevent false positives in description typo check., guix-commits, 2024/12/12
- 08/15: lint: Ignore initials from double space check., guix-commits, 2024/12/12
- 09/15: lint: More abbreviations., guix-commits, 2024/12/12
- 10/15: lint: Pre-compile regexp for ‘starts-with-texinfo-markup?’., guix-commits, 2024/12/12
- 11/15: services: cuirass: Run in a UTF-8 locale., guix-commits, 2024/12/12
- 04/15: lint: Refine description start check logic., guix-commits, 2024/12/12
- 02/15: gnu: lapack: Mark as tunable., guix-commits, 2024/12/12
- 05/15: lint: Allow texinfo markup at beginning of description.,
guix-commits <=
- 06/15: lint: Allow texinfo markup at beginning of synopsis., guix-commits, 2024/12/12
- 12/15: remote: Do not double-quote the repl-command., guix-commits, 2024/12/12
- 14/15: gnu: hyprutils: Fix cross-compilation., guix-commits, 2024/12/12
- 13/15: doc: cookbook: Document postgres upgrade for cuirass., guix-commits, 2024/12/12
- 15/15: gnu: hyprlang: Fix cross-compilation., guix-commits, 2024/12/12