guix/tests
Christopher Baines 50fc2384fe
scripts: lint: Handle warnings with a record type.
Rather than emiting warnings directly to a port, have the checkers return the
warning or warnings.

This makes it easier to use the warnings in different ways, for example,
loading the data in to a database, as you can work with the <lint-warning>
records directly, rather than having to parse the output to determine the
package and location.

* guix/scripts/lint.scm (<lint-warning>): New record type.
(lint-warning): New macro.
(lint-warning?, lint-warning-package, lint-warning-message,
lint-warning-location, package-file, make-warning): New procedures.
(call-with-accumulated-warnings, with-accumulated-warnings): Remove.
(emit-warning): Rename to emit-warnings, and switch to displaying multiple
warnings.
(check-description-style)[check-not-empty-description, check-texinfo-markup,
check-trademarks, check-quotes, check-proper-start,
check-end-of-sentence-space]: Switch to generating a list of warnings, and
using make-warning, rather than emit-warning.
(check-inputs-should-be-native, check-inputs-should-not-be-an-input-at-all):
Switch to generating a list of warnings, and using make-warning, rather than
emit-warning.
(check-synopsis): Switch to generating a list of warnings, and using
make-warning, rather than emit-warning.
[check-not-empty]: Remove, this is handled in the match clause
to avoid other warnings being emitted.
[check-final-period, check-start-article, check-synopsis-length,
check-proper-start, check-start-with-package-name, check-texinfo-markup]:
Switch to generating a list of warnings, and using make-warning, rather than
emit-warning.
[checks]: Remove check-not-empty.
(validate-uri, check-home-page, check-patch-file-names,
check-gnu-synopsis+description): Switch to generating a list of warnings, and
using make-warning, rather than emit-warning.
(check-source): Switch to generating a list of warnings, and using
make-warning, rather than emit-warning.
[try-uris]: Remove.
[warnings-for-uris]: New procedure, replacing try-uris.
(check-source-file-name, check-source-unstable-tarball, check-mirror-url,
check-github-url, check-derivation, check-vulnerabilities, check-for-updates,
report-tabulations, report-trailing-white-space, report-long-line,
report-lone-parentheses, report-formatting-issues, check-formatting): Switch
to generating a list of warnings, and using make-warning, rather than
emit-warning.
(run-checkers): Call emit-warnings on the warnings returned from the checker.
* tests/lint.scm (string-match-or-error, single-lint-warning-message): New
procedures.
(call-with-warnings, with-warnings): Remove.
("description: not a string", "description: not empty", "description: invalid
Texinfo markup", "description: does not start with an upper-case letter",
"description: may start with a digit", "description: may start with lower-case
package name", "description: two spaces after end of sentence", "description:
end-of-sentence detection with abbreviations", "description: may not contain
trademark signs: ™", "description: may not contain trademark signs: ®",
"description: suggest ornament instead of quotes", "synopsis: not a string",
"synopsis: not empty", "synopsis: valid Texinfo markup", "synopsis: does not
start with an upper-case letter", "synopsis: may start with a digit",
"synopsis: ends with a period", "synopsis: ends with 'etc.'", "synopsis:
starts with 'A'", "synopsis: starts with 'a'", "synopsis: starts with 'an'",
"synopsis: too long", "synopsis: start with package name", "synopsis: start
with package name prefix", "synopsis: start with abbreviation", "inputs:
pkg-config is probably a native input", "inputs: glib:bin is probably a native
input", "inputs: python-setuptools should not be an input at all (input)",
"inputs: python-setuptools should not be an input at all (native-input)",
"inputs: python-setuptools should not be an input at all (propagated-input)",
"patches: file names", "patches: file name too long", "patches: not found",
"derivation: invalid arguments", "license: invalid license", "home-page: wrong
home-page", "home-page: invalid URI", "home-page: host not found", "home-page:
Connection refused", "home-page: 200", "home-page: 200 but short length",
"home-page: 404", "home-page: 301, invalid", "home-page: 301 -> 200",
"home-page: 301 -> 404", "source-file-name", "source-file-name: v prefix",
"source-file-name: bad checkout", "source-file-name: good checkout",
"source-file-name: valid", "source-unstable-tarball",
"source-unstable-tarball: source #f", "source-unstable-tarball: valid",
"source-unstable-tarball: package named archive", "source-unstable-tarball:
not-github", "source-unstable-tarball: git-fetch", "source: 200", "source: 200
but short length", "source: 404", "source: 301 -> 200", "source: 301 -> 404",
"mirror-url", "mirror-url: one suggestion", "github-url", "github-url: one
suggestion", "github-url: already the correct github url", "cve", "cve: one
vulnerability", "cve: one patched vulnerability", "cve: known safe from
vulnerability", "cve: vulnerability fixed in replacement version", "cve:
patched vulnerability in replacement", "formatting: lonely parentheses",
"formatting: alright"): Change test-assert to test-equal, and adjust to work
with the changes above.
("formatting: tabulation", "formatting: trailing white space", "formatting:
long line"): Use string-match-or-error rather than string-contains.
2019-07-15 22:32:18 +01:00
..
accounts.scm tests: Adjust accounts test to shell-as-config change. 2019-04-27 16:30:40 +02:00
base16.scm
base32.scm
base64.scm
bournish.scm
build-utils.scm
builders.scm
cache.scm
challenge.scm
channels.scm
combinators.scm
containers.scm
cpan.scm
cpio.scm
cran.scm
crate.scm guix: import: crate: fix redundant inputs list nesting 2019-06-30 09:01:27 -07:00
cve-sample.xml
cve.scm
debug-link.scm
derivations.scm derivations: Update tests to use new calling convention. 2019-07-15 10:01:05 +02:00
discovery.scm
elpa.scm
file-systems.scm
gem.scm
gexp.scm gexp: 'lowered-gexp-guile' now returns a <derivation-input>. 2019-07-15 10:01:05 +02:00
glob.scm
gnu-maintenance.scm
grafts.scm derivations: Add 'derivation-input'. 2019-06-27 11:14:41 +02:00
graph.scm
gremlin.scm gremlin: Adjust tests for foreign distros. 2019-05-18 12:10:15 +02:00
guix-archive.sh
guix-authenticate.sh
guix-build-branch.sh
guix-build.sh guix build: Accept multiple '-s' options. 2019-04-19 17:46:40 +02:00
guix-daemon.sh tests: Avoid TCP port collision between lint.scm and guix-daemon.sh. 2019-06-27 11:14:42 +02:00
guix-describe.sh
guix-download.sh
guix-environment-container.sh
guix-environment.sh scripts: environment: Add --no-cwd. 2019-07-08 10:33:20 -04:00
guix-gc.sh
guix-graph.sh
guix-hash.sh
guix-lint.sh
guix-pack-localstatedir.sh pack: '--localstatedir' and '-R' tests gracefully handle missing /gnu/store. 2019-05-18 12:23:31 +02:00
guix-pack-relocatable.sh pack: '--localstatedir' and '-R' tests gracefully handle missing /gnu/store. 2019-05-18 12:23:31 +02:00
guix-pack.sh pack: Add '--root'. 2019-05-22 00:09:41 +02:00
guix-package-aliases.sh guix package: Add 'guix search' alias. 2019-04-29 12:19:24 +02:00
guix-package-net.sh
guix-package.sh discovery: 'all-modules' returns modules in path order. 2019-05-26 23:02:02 +02:00
guix-system.sh tests: Adjust wildcard when testing OS examples. 2019-04-29 21:57:52 +02:00
hackage.scm import: hackage: Add two expected failing test cases. 2019-06-20 14:07:01 +02:00
import-utils.scm
inferior.scm
lint.scm scripts: lint: Handle warnings with a record type. 2019-07-15 22:32:18 +01:00
lzlib.scm lzlib: Add 'make-lzip-input-port/compressed'. 2019-05-27 22:47:24 +02:00
modules.scm
monads.scm
nar.scm
opam.scm
pack.scm
packages.scm packages: 'specification->package+output' distinguishes "no output specified". 2019-06-27 11:14:41 +02:00
pki.scm
print.scm import: print: Honor the outputs of inputs (!). 2019-06-07 22:49:47 +02:00
processes.scm
profiles.scm
publish.scm publish: '--compression' can be repeated. 2019-06-02 22:01:57 +02:00
pypi.scm import: pypi: Include optional test inputs as native-inputs. 2019-07-02 10:08:00 +09:00
records.scm
scripts-build.scm
scripts.scm
search-paths.scm
services.scm
sets.scm
signing-key.pub
signing-key.sec
size.scm
snix.scm
status.scm
store-database.scm
store-deduplication.scm
store-roots.scm
store.scm store: 'build-things' accepts derivation/output pairs. 2019-06-10 22:42:59 +02:00
substitute.scm substitute: Select the best compression methods. 2019-06-02 22:01:57 +02:00
syscalls.scm syscalls: Add 'terminal-rows'. 2019-06-27 11:14:40 +02:00
system.scm
test.drv
texlive.scm
ui.scm ui: 'relevance' considers regexps connected with a logical and. 2019-06-27 11:14:40 +02:00
union.scm
upstream.scm
utils.scm utils: canonical-newline-port: Fix handling of carriage return at buffer end. 2019-06-20 14:07:01 +02:00
uuid.scm uuid: 'fat-uuid->string' preserves leading zeros. 2019-05-07 12:18:44 +02:00
workers.scm
zlib.scm