summaryrefslogtreecommitdiff
path: root/guix/scripts
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2014-11-07 17:44:30 +0100
committerLudovic Courtès <ludo@gnu.org>2014-11-07 17:52:11 +0100
commit15a6d433ff33c44ffef406ad77e196d6a5ef0822 (patch)
tree7b1f6774ff5c064e24b5f2dac9f83ab96a94d70b /guix/scripts
parent105c260f00479d404b140be534efb21f9f3d17fe (diff)
downloadgnu-guix-15a6d433ff33c44ffef406ad77e196d6a5ef0822.tar
gnu-guix-15a6d433ff33c44ffef406ad77e196d6a5ef0822.tar.gz
lint: Allow synopses that start with an abbreviation.
* guix/scripts/lint.scm (starts-with-abbreviation?): New procedure. (check-synopsis-style)[check-start-with-package-name]: Use it. * tests/lint.scm ("synopsis: start with abbreviation"): New test.
Diffstat (limited to 'guix/scripts')
-rw-r--r--guix/scripts/lint.scm7
1 files changed, 6 insertions, 1 deletions
diff --git a/guix/scripts/lint.scm b/guix/scripts/lint.scm
index 350a35222c..237709848f 100644
--- a/guix/scripts/lint.scm
+++ b/guix/scripts/lint.scm
@@ -80,6 +80,10 @@
(define (properly-starts-sentence? s)
(string-match "^[(\"'[:upper:][:digit:]]" 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))
+
(define (check-description-style package)
;; Emit a warning if stylistic issues are found in the description of PACKAGE.
(define (check-not-empty description)
@@ -180,7 +184,8 @@ line."
'synopsis)))
(define (check-start-with-package-name synopsis)
- (when (regexp-exec (package-name-regexp package) synopsis)
+ (when (and (regexp-exec (package-name-regexp package) synopsis)
+ (not (starts-with-abbreviation? synopsis)))
(emit-warning package
"synopsis should not start with the package name"
'synopsis)))