summaryrefslogtreecommitdiff
path: root/guix/lint.scm
Commit message (Collapse)AuthorAge
* guix: lint: Fix comment per TODO.Maxim Cournoyer2022-01-10
| | | | * guix/lint.scm (check-wrapper-inputs): Address TODO in comment.
* lint: Adjust patch file length check.Vagrant Cascadian2021-12-17
| | | | | | | | | | | With the switch to "ustar" format in commit bdf5c16ac052af2ca9d5c3acc4acbc08fd9fdbea, the maximum file length has increased. * guix/lint.scm (check-patch-file-names): Adjust margin used to check for patch file lengths. Increase allowable patch file length appropriate to new tar format. Extend warning to explain that long files may break 'make dist'. * tests/lint.scm: Update tests accordingly.
* lint: 'kdoctools' is typically used only while building.Leo Famulari2021-12-16
| | | | * guix/lint.scm (check-inputs-should-be-native): Add kdoctools.
* Merge remote-tracking branch 'origin/master' into core-updates-frozenEfraim Flashner2021-10-31
|\
| * lint: Add description check for common typos.Vagrant Cascadian2021-10-24
| | | | | | | | | | | | | | | | | | Fixes: https://issues.guix.gnu.org/44675 * guix/lint.scm (check-description-typo): Add check for occurences of "This packages", "This modules", "allows to" and "permits to" in package descriptions. * tests/lint.scm: Add tests for "This packages" and "allows to".
* | Merge remote-tracking branch 'signed/master' into core-updatesMathieu Othacehe2021-10-18
|\|
| * lint: archival: Remove extra newline in warning.Ludovic Courtès2021-10-15
| | | | | | | | * guix/lint.scm (check-archival): Remove extra newline in message.
* | Merge branch 'master' into core-updates-frozenMarius Bakke2021-09-17
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: gnu/packages/bioinformatics.scm gnu/packages/chez.scm gnu/packages/docbook.scm gnu/packages/ebook.scm gnu/packages/gnome.scm gnu/packages/linux.scm gnu/packages/networking.scm gnu/packages/python-web.scm gnu/packages/python-xyz.scm gnu/packages/tex.scm gnu/packages/version-control.scm gnu/packages/xml.scm guix/build-system/dune.scm guix/build-system/go.scm guix/build-system/linux-module.scm guix/packages.scm
| * lint: archival: Warn about non-origin sources.Ludovic Courtès2021-09-10
| | | | | | | | * guix/lint.scm (check-archival): Warn about non-origin sources.
* | Merge branch 'master' into core-updatesLudovic Courtès2021-07-18
|\|
| * lint: Check for leading whitespace in description.Brice Waegeneire2021-07-13
| | | | | | | | | | * guix/lint.scm (check-description-style): Check for leading whitespace. * tests/lint.scm: ("description: leading whitespace"): New test.
| * lint: Lint usages of 'wrap-program' without a "bash" input.Maxime Devos2021-07-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using 'wrap-program', "bash" (or "bash-minimal") should be in inputs. Otherwise, when cross-compiling, 'wrap-program' will use a native bash instead of the cross bash and the 'patch-shebangs' won't be able to correct this. Tobias Geerinckx-Rice is added to the copyright lines because a part of the "straw-viewer" package definition is included. This linter detects 365 problematic package definitions at time of writing. * guix/lint.scm (report-wrap-program-error): New procedure. (check-wrapper-inputs): New linter. (%local-checkers)[wrapper-inputs]: Add the new linter. ("explicit #:sh argument to 'wrap-program' is acceptable") ("'check-wrapper-inputs' detects 'wrap-program' without \"bash\" in inputs") ("'check-wrapper-inputs' detects 'wrap-qt-program' without \"bash\" in inputs") ("\"bash\" in 'inputs' satisfies 'check-wrapper-inputs'") ("\"bash-minimal\" in 'inputs' satisfies 'check-wrapper-inputs'") ("'cut' doesn't hide bad usages of 'wrap-program'") ("bogus phase specifications don't crash the linter"): New tests. Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
| * lint: Define some procedures for analysing code in phases.Maxime Devos2021-07-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * guix/lint.scm (check-optional-tests): Extract logic for extracting the phases from a package to ... (find-phase-deltas): ... here, and ... (report-bogus-phase-deltas): ... here. (check-optional-tests)[check-check-procedure]: Extract code for extracting the procedure body to ... (find-procedure-body) ... here. (find-phase-procedure): New procedure. (report-bogus-phase-procedure): New procedure. Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
| * lint: Verify if #:tests? is respected in the 'check' phase.Maxime Devos2021-06-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There have been a few patches to the mailing list lately not respecting this, and this linter detects 630 package definitions that could be modified to support the --without-tests package transformation. * guix/lint.scm (check-optional-tests): New linter. (%local-checkers)[optional-tests]: Add it. * tests/lint.scm (package-with-phase-changes): New procedure. ("optional-tests: no check phase") ("optional-tests: check hase respects #:tests?") ("optional-tests: check phase ignores #:tests?") ("optional-tests: do not crash when #:phases is invalid") ("optional-tests: allow G-exps (no warning)") ("optional-tests: allow G-exps (warning)") ("optional-tests: complicated 'check' phase") ("optional-tests: 'check' phase is not first phase"): New tests. Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
| * lint: 'github-url' checker gracefully handles networking errors.Ludovic Courtès2021-06-24
| | | | | | | | | | | | | | | | | | | | Fixes <https://bugs.gnu.org/49114>. Reported by Tobias Geerinckx-Rice <me@tobias.gr>. * guix/lint.scm (call-with-networking-fail-safe, with-networking-fail-safe): Move higher in the file. * guix/lint.scm (check-github-url): Wrap call to 'follow-redirects-to-github' in 'with-networking-fail-safe'.
| * lint: 'with-networking-fail-safe' handles 'gnutls-error' exceptions.Ludovic Courtès2021-06-24
| | | | | | | | * guix/lint.scm (call-with-networking-fail-safe): Add clause for 'gnutls-error'.
* | lint: Add 'input-labels' checker.Ludovic Courtès2021-07-11
|/ | | | | | | | * guix/lint.scm (check-input-labels): New procedure. (%local-checkers): Add 'input-labels' checker. * tests/lint.scm ("input labels: no warnings") ("input labels: one warning"): New tests. * doc/guix.texi (Invoking guix lint): Mention it.
* lint: check-patch-headers: Recognize Git diffs.Ludovic Courtès2021-06-18
| | | | * guix/lint.scm (check-patch-headers): Add "diff --git " prefix.
* lint: Check for trailing whitespace in description.Xinglu Chen2021-06-08
| | | | | | | * guix/lint.scm (check-description-style): Check for trailing whitespace. * tests/lint.scm: ("description: trailing whitespace"): New test. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* lint: Check for trailing whitespace in synopsis.Xinglu Chen2021-06-08
| | | | | | | * guix/lint.scm (check-synopsis-style): Check for trailing whitespace. * tests/lint.scm ("synopsis: contains trailing whitespace"): New test. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* lint: tests-true: Check if tests are enabled when cross-compiling.Maxime Devos2021-06-06
| | | | | | | | | | | * guix/lint.scm (check-tests-true): New linter. (%local-checkers)[tests-true]: Add it. * tests/lint.scm ("tests-true: #:tests? must not be set to #t") ("tests-true: absent #:tests? is acceptable") ("tests-true: #:tests? #f is acceptable") ("tests-true: #:tests? #t acceptable when compiling natively"): Test it. Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
* ui, lint: Simplify exception handling in Guile 3 style.Ludovic Courtès2021-06-01
| | | | | | | * guix/lint.scm (check-derivation)[try]: Remove "catch #t" wrapping. * guix/ui.scm (call-with-error-handling): Remove "catch 'system-error" and move 'system-error handling to the &exception-with-kind-and-args clause.
* maint: Require Guile 3.0.Ludovic Courtès2021-06-01
| | | | | | | | | | | | * configure.ac: Require Guile 3.0. * doc/guix.texi (Requirements): Adjust accordingly. * gnu/packages/package-management.scm (guile2.2-guix): Remove. * guix/lint.scm (exception-with-kind-and-args?): Remove 'cond-expand'. * guix/scripts/deploy.scm (deploy-machine*): Likewise. * guix/store.scm (call-with-store): Likewise. * guix/swh.scm (http-get*, http-post*): Likewise. * guix/ui.scm (without-compiler-optimizations, guard*) (call-with-error-handling): Likewise.
* lint: archival: Lookup content in Disarchive database.Ludovic Courtès2021-05-22
| | | | | | | | | | | * guix/lint.scm (lookup-disarchive-spec): New procedure. (check-archival): When 'lookup-content' returns #f, call 'lookup-disarchive-spec'. Call 'lookup-directory' on the result of 'lookup-directory'. * guix/download.scm (%disarchive-mirrors): Make public. * tests/lint.scm ("archival: missing content"): Set '%disarchive-mirrors'. ("archival: content unavailable but disarchive available"): New test.
* lint: Warn about underscores in package names.Xinglu Chen2021-04-16
| | | | | | | | | | | As per section '16.4.2 Package Naming' in the manual, use hyphens instead of underscores in package names. * guix/lint.scm (check-name): Check whether the package name contains underscores. * tests/lint.scm ("name: use underscore in package name"): New test. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* lint: refresh: Warn about missing or dysfunctional updaters.Ludovic Courtès2021-04-06
| | | | | | | This feedback should help us improve updaters. * guix/lint.scm (check-for-updates): Return a warning when PACKAGE lacks an updater or when the updater returns #f.
* lint: Warn about single-character package names.Tobias Geerinckx-Rice via Bug reports for GNU Guix2021-04-01
| | | | | | | A common-sense exception is made for R. * guix/lint.scm (check-name): New procedure. (%local-checkers): Add it.
* lint: archival: Gracefully handle packages with a #f hash value.Ludovic Courtès2021-03-26
| | | | | | | | Fixes <https://bugs.gnu.org/47293>. Reported by Luis Felipe. * guix/lint.scm (check-archival): Check whether 'content-hash-value' returns true.
* upstream: Make the 'updaters' parameter optional.Ludovic Courtès2021-01-07
| | | | | | | | * guix/upstream.scm (lookup-updater, package-latest-release) (package-latest-release*, package-update): Make 'updaters' an optional parameter. * guix/lint.scm (check-for-updates): Remove second argument to 'package-latest-release*'.
* lint: Add 'check-haskell-stackage' checker.Timothy Sample2020-11-21
| | | | | | | | | | | * guix/lint.scm (check-haskell-stackage): New procedure. (%network-dependent-checkers): Add 'haskell-stackage' checker. * guix/import/hackage.scm (%hackage-url): New variable. (hackage-source-url, hackage-cabal-url): Use it in place of a hard-coded string. * guix/import/stackage.scm (%stackage-url): Make it a parameter. (stackage-lts-info-fetch): Update accordingly. * tests/lint.scm ("hackage-stackage"): New test.
* lint: Add 'patch-headers' checker.Ludovic Courtès2020-11-21
| | | | | | | | * guix/lint.scm (check-patch-headers): New procedure. (%local-checkers): Add 'patch-headers' checker. * tests/lint.scm ("patch headers: no warnings") ("patch headers: missing comment", "patch headers: empty") ("patch headers: patch not found"): New tests.
* lint: patch-file-names: Simplify 'search-patch' error handling.Ludovic Courtès2020-11-12
| | | | | | * guix/lint.scm (check-patch-file-names): Remove 'message-condition?' guard, which is useless since d51bfe242fbe6f3f8f71d723e8fe0c7bbe711ba1. Remove call to 'format' in the 'formatted-message?' case.
* lint: cve: Set a connection timeout.Ludovic Courtès2020-10-12
| | | | | | | | | | | | This (notably) works around the fact that nvd.nist.gov is currently inaccessible over IPv6. * guix/cve.scm (fetch-vulnerabilities): Add #:timeout and pass it to 'http-fetch/cached'. (current-vulnerabilities): Add #:timeout and pass it to 'fetch-vulnerabilities'. * guix/lint.scm (current-vulnerabilities*): Pass #:timeout to 'current-vulnerabilities'.
* lint: formatting: Gracefully handle relative file names.Ludovic Courtès2020-08-23
| | | | | | | | | | Fixes <https://bugs.gnu.org/42543>. Reported by Jack Hill <jackhill@jackhill.us>. * guix/lint.scm (check-formatting): Always return a list (previously we would return #f when 'search-path' returns #f). Check whether LOCATION's file is a relative file name. Return a warning if not. * tests/guix-lint.sh: Add test.
* lint: Avoid calls to 'package-field-location' with #f as the field.Ludovic Courtès2020-08-23
| | | | | * guix/lint.scm (%make-warning): Call 'package-field-location' only when FIELD is true.
* guix: lint: Ignore unsupported source URL’s.Lars-Dominik Braun2020-08-01
| | | | | | * guix/lint.scm (check-source): Add match case for #f. Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
* Use 'formatted-message' instead of '&message' where appropriate.Ludovic Courtès2020-07-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * gnu.scm (%try-use-modules): Use 'formatted-message' instead of '&message'. * gnu/machine/digital-ocean.scm (maybe-raise-unsupported-configuration-error): Likewise. * gnu/machine/ssh.scm (machine-check-file-system-availability): Likewise. (machine-check-building-for-appropriate-system): Likewise. (deploy-managed-host): Likewise. (maybe-raise-unsupported-configuration-error): Likewise. * gnu/packages.scm (search-patch): Likewise. * gnu/services.scm (%service-with-default-value): Likewise. (files->etc-directory): Likewise. (fold-services): Likewise. * gnu/system.scm (locale-name->definition*): Likewise. * gnu/system/mapped-devices.scm (check-device-initrd-modules): Likewise. (check-luks-device): Likewise. * guix/channels.scm (latest-channel-instance): Likewise. * guix/cve.scm (json->cve-items): Likewise. * guix/git-authenticate.scm (commit-signing-key): Likewise. (commit-authorized-keys): Likewise. (authenticate-commit): Likewise. (verify-introductory-commit): Likewise. * guix/remote.scm (remote-pipe-for-gexp): Likewise. * guix/scripts/graph.scm (assert-package): Likewise. * guix/scripts/offload.scm (private-key-from-file*): Likewise. * guix/ssh.scm (authenticate-server*): Likewise. (open-ssh-session): Likewise. (remote-inferior): Likewise. * guix/ui.scm (matching-generations): Likewise. * guix/upstream.scm (package-update): Likewise. * tests/channels.scm ("latest-channel-instances, missing introduction for 'guix'"): Catch 'formatted-message?'. ("authenticate-channel, wrong first commit signer"): Likewise. * tests/lint.scm ("patches: not found"): Adjust message string. * tests/packages.scm ("patch not found yields a run-time error"): Catch 'formatted-message?'. * guix/lint.scm (check-patch-file-names): Handle 'formatted-message?'. (check-derivation): Ditto.
* lint: source: Always return a list.Ludovic Courtès2020-07-21
| | | | | | | | | | Fixes a regression introduced in c10526672e515f07c92dc447bbc592808f67238e. Previously we would return *unspecified* for a package whose source is not an origin. * guix/lint.scm (check-source): Add alternate 'if' branch.
* lint: source: Validate URLs of Git references.Ludovic Courtès2020-07-12
| | | | | | | | Until now the 'source' checker would look at URL for 'url-fetch' origins but not for 'git-fetch' origins. * guix/lint.scm (check-source): Add case for 'git-reference?'. * tests/lint.scm ("source, git-reference: 301 -> 200"): New test.
* lint: Do not assume that a package's source is an origin.Ludovic Courtès2020-07-03
| | | | | | * guix/lint.scm (check-source-file-name): Ensure ORIGIN is an origin. (check-patch-file-names)[patches]: Likewise. (check-source): Likewise.
* lint: Adjust 'swh-error exception handler.Ludovic Courtès2020-06-30
| | | | | * guix/lint.scm (check-archival): Change first clause to match only 'swh-error keys.
* lint: Add 'check-for-collisions' checker.Ludovic Courtès2020-06-14
| | | | | | | | | | | | Suggested by Edouard Klein <edk@beaver-labs.com>. * guix/profiles.scm (check-for-collisions): Export. * guix/lint.scm (check-profile-collisions): New procedure. (%local-checkers): Add 'profile-collisions' checker. * tests/lint.scm ("profile-collisions: no warnings") ("profile-collisions: propagated inputs collide") ("profile-collisions: propagated inputs collide, store items"): New tests. * doc/guix.texi (Invoking guix lint): Document it.
* lint: check-patch-file-names: Use origin-actual-file-name.Christopher Baines2020-06-12
| | | | | | | | | This avoids crashes for the patch-file-names checker where a <origin> is used for a patch, but without a value for the file-name field. This is currently the case with the bash package. * guix/lint.scm (check-patch-file-names): Change origin-file-name to origin-actual-file-name.
* guix: lint: Support origins in check-patch-file-names.Chris Marusich2020-06-11
| | | | | | * guix/lint.scm (check-patch-file-names)[starts-with-package-name?]: New procedure, extracted from the existing logic. Using it, add a clause to the match-lambda to handle origin records.
* lint: archival: Use 'origin-hash'.Ludovic Courtès2020-05-22
| | | | | * guix/lint.scm (check-archival): Use 'origin-hash' instead of 'origin-sha256', removing hard-coded "sha256".
* lint: 'check-patch-file-names' restricts to shorter file names.Ludovic Courtès2020-04-10
| | | | * guix/lint.scm (check-patch-file-names): Increase MARGIN.
* lint: Check for inappropriate inputs in propagated-inputs too.Efraim Flashner2020-04-10
| | | | | * guix/lint.scm (check-inputs-should-be-native): Also check the propagated inputs of the package.
* lint: 'm4' is a native input.Marius Bakke2020-04-07
| | | | * guix/lint.scm (check-inputs-should-be-native): Add "m4".
* lint: Add a #:store argument to check-derivationChristopher Baines2020-03-24
| | | | | | | | This can then be used to avoid opening up a store connection each time a package needs checking. * guix/lint.scm (check-derivation): Add a #:store argument, and pull the handling of the store connection out of the try function.
* lint: Mark the derivation checker as requiring a store connection.Christopher Baines2020-03-24
| | | | | * guix/lint.scm (%local-checkers): Mark the derivation checker as requiring a store connection.