summaryrefslogtreecommitdiff
path: root/guix/lint.scm
AgeCommit message (Collapse)Author
2023-03-27lint: Append "/info/refs" to git-reference-url.Felix Lechner
For the atftp package added in the preceeding commit, lint produced this warning: gnu/packages/networking.scm:2924:5: atftp@0.8.0: URI https://git.code.sf.net/p/atftp/code not reachable: 404 ("Not Found") Thanks to Sergey Trofimov for suggesting a fix! [1] [1] https://issues.guix.gnu.org/62156#3 It was implemented here, and the warning disappeared. * guix/lint.scm (check-source): Append "/info/refs" to git-reference-url. Co-authored-by: Sergey Trofimov <sarg@sarg.org.ru> Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2023-03-27lint: Prevent inlining of 'package-vulnerabilities'.Ludovic Courtès
* guix/lint.scm (package-vulnerabilities): Prevent inlining.
2023-03-21guix: Run check-synopsis-style with other local checks.Sergey Trofimov
* guix/lint.scm (%network-dependent-checkers): Move check-synopsis-style to... (%local-checkers): ... here. Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
2023-03-13guix: Strip #:use-module lists.Ludovic Courtès
This was obtained by setting up this environment: guix shell -D guix --with-input=guile@3.0.9=guile-next \ --with-commit=guile-next=e2ed33ef0445c867fe56c247054aa67e834861f2 -- make -j5 then adding 'unused-module' to (@@ (guix build compiler) %warnings), building, and checking all the "unused module" warnings and removing those that were definitely unused.
2023-03-12lint: Check that python-pre-commit is not an input.Antero Mejr
pre-commit should never be a native-input of python packages, it's a package manager for commit linting that is irrelevant to builds. * guix/lint.scm (check-inputs-should-not-be-an-input-at-all): Add entry for python-pre-commit. Signed-off-by: Lars-Dominik Braun <lars@6xq.net>
2022-10-22Remove now unnecessary uses of (guix grafts).Ludovic Courtès
These modules would use (guix grafts) just to access '%graft?' and related bindings, which are now in (guix store). * gnu/ci.scm, guix/gexp.scm, guix/lint.scm, guix/scripts.scm, guix/scripts/archive.scm, guix/scripts/build.scm, guix/scripts/challenge.scm, guix/scripts/deploy.scm, guix/scripts/environment.scm, guix/scripts/home.scm, guix/scripts/pack.scm, guix/scripts/package.scm, guix/scripts/pull.scm, guix/scripts/size.scm, guix/scripts/system.scm, guix/scripts/weather.scm, tests/builders.scm, tests/channels.scm, tests/cpan.scm, tests/derivations.scm, tests/gexp.scm, tests/graph.scm, tests/guix-daemon.sh, tests/monads.scm, tests/pack.scm, tests/packages.scm, tests/profiles.scm, tests/system.scm: Remove #:use-module (guix grafts).
2022-10-20lint: source: Handle <svn-multi-reference> origins.Ludovic Courtès
This is a followup to 2383e145185efb2e6f99931707ec93d65d166432. * guix/lint.scm (svn-reference-uri-with-userinfo): Accept REF being an <svn-multi-reference> record. (check-source): Handle 'svn-multi-reference?' origins like 'svn-reference?' origins.
2022-10-17lint: source: Add check for <svn-reference> over HTTP(S).Ludovic Courtès
* guix/lint.scm (svn-reference-uri-with-userinfo): New procedure. (check-source): Add 'svn-reference?' clause. * tests/lint.scm ("source: svn-reference, HTTP 200") ("source: svn-reference, HTTP 404"): New tests.
2022-10-17lint: 'probe-uri' honors the 'userinfo' part of URIs.Ludovic Courtès
* guix/lint.scm (probe-uri): Honor the 'userinfo' part of URI.
2022-09-26lint: Extract logic of 'check-mirror-url'.Maxime Devos
It will be useful for fixing <https://issues.guix.gnu.org/57477>. * guix/lint.scm (check-mirror-url): Extract mirror://-constructing code to ... * guix/gnu-maintenance.scm (uri-mirror-rewrite): ... here, tweaking the API and implementation in anticipation of future users. Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2022-07-31gnu: qttools: Rename to qttools-5.Maxim Cournoyer
Automated with: git grep -l qttools | xargs sed 's/\bqttools\b/\0-5/g' -i git checkout NEWS
2022-05-31gnu: Remove python2-setuptools.Maxim Cournoyer
* gnu/packages/python-xyz.scm (python2-setuptools): Delete variable. (python-setuptools)[properties]: Delete field. * gnu/packages/syncthing.scm (syncthing-gtk): Delete commented native input. * guix/lint.scm (check-inputs-should-not-be-an-input-at-all): Remove obsolete entries.
2022-05-31gnu: Remove python2-mccabe.Maxim Cournoyer
* gnu/packages/python-xyz.scm (python2-mccabe): Delete variable.
2022-05-23lint: check-derivation: Catch all exceptions.Christopher Baines
Rather than raising the exception. I'm looking at this as the linux-module-build-system is broken in such a way that this causes the derivation linter to error. With this change, it correctly reports the issue. * guix/lint.scm (check-derivation): Catch all exceptions.
2022-03-11lint: check-tests-true: Allow #:tests? #t for some build systems.Maxime Devos
emacs-build-system sets #:tests? #f by default, so the linter shouldn't warn if #:tests? #t is set for packages using emacs-build-system. Likewise for texlive-build-system. * guix/lint.scm (check-tests-true): Do not warn if the build system is emacs-build-system or texlive-build-system. * tests/lint.scm ("tests-true: #:tests? #t acceptable for emacs packages") ("tests-true: #:tests? #t acceptable for texlive packages"): New tests. Fixes: <https://issues.guix.gnu.org/50299> Reported-by: Maxim Cournoyer <maxim.cournoyer@gmail.com> Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
2022-01-10guix: lint: Fix comment per TODO.Maxim Cournoyer
* guix/lint.scm (check-wrapper-inputs): Address TODO in comment.
2021-12-17lint: Adjust patch file length check.Vagrant Cascadian
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.
2021-12-16lint: 'kdoctools' is typically used only while building.Leo Famulari
* guix/lint.scm (check-inputs-should-be-native): Add kdoctools.
2021-10-31Merge remote-tracking branch 'origin/master' into core-updates-frozenEfraim Flashner
2021-10-24lint: Add description check for common typos.Vagrant Cascadian
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".
2021-10-18Merge remote-tracking branch 'signed/master' into core-updatesMathieu Othacehe
2021-10-15lint: archival: Remove extra newline in warning.Ludovic Courtès
* guix/lint.scm (check-archival): Remove extra newline in message.
2021-09-17Merge branch 'master' into core-updates-frozenMarius Bakke
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
2021-09-10lint: archival: Warn about non-origin sources.Ludovic Courtès
* guix/lint.scm (check-archival): Warn about non-origin sources.
2021-07-18Merge branch 'master' into core-updatesLudovic Courtès
2021-07-13lint: Check for leading whitespace in description.Brice Waegeneire
* guix/lint.scm (check-description-style): Check for leading whitespace. * tests/lint.scm: ("description: leading whitespace"): New test.
2021-07-11lint: Add 'input-labels' checker.Ludovic Courtès
* 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.
2021-07-07lint: Lint usages of 'wrap-program' without a "bash" input.Maxime Devos
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>
2021-07-07lint: Define some procedures for analysing code in phases.Maxime Devos
* 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>
2021-06-30lint: Verify if #:tests? is respected in the 'check' phase.Maxime Devos
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>
2021-06-24lint: 'github-url' checker gracefully handles networking errors.Ludovic Courtès
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'.
2021-06-24lint: 'with-networking-fail-safe' handles 'gnutls-error' exceptions.Ludovic Courtès
* guix/lint.scm (call-with-networking-fail-safe): Add clause for 'gnutls-error'.
2021-06-18lint: check-patch-headers: Recognize Git diffs.Ludovic Courtès
* guix/lint.scm (check-patch-headers): Add "diff --git " prefix.
2021-06-08lint: Check for trailing whitespace in description.Xinglu Chen
* 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>
2021-06-08lint: Check for trailing whitespace in synopsis.Xinglu Chen
* 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>
2021-06-06lint: tests-true: Check if tests are enabled when cross-compiling.Maxime Devos
* 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>
2021-06-01ui, lint: Simplify exception handling in Guile 3 style.Ludovic Courtès
* 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.
2021-06-01maint: Require Guile 3.0.Ludovic Courtès
* 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.
2021-05-22lint: archival: Lookup content in Disarchive database.Ludovic Courtès
* 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.
2021-04-16lint: Warn about underscores in package names.Xinglu Chen
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>
2021-04-06lint: refresh: Warn about missing or dysfunctional updaters.Ludovic Courtès
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.
2021-04-01lint: Warn about single-character package names.Tobias Geerinckx-Rice via Bug reports for GNU Guix
A common-sense exception is made for R. * guix/lint.scm (check-name): New procedure. (%local-checkers): Add it.
2021-03-26lint: archival: Gracefully handle packages with a #f hash value.Ludovic Courtès
Fixes <https://bugs.gnu.org/47293>. Reported by Luis Felipe. * guix/lint.scm (check-archival): Check whether 'content-hash-value' returns true.
2021-01-07upstream: Make the 'updaters' parameter optional.Ludovic Courtès
* 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*'.
2020-11-21lint: Add 'check-haskell-stackage' checker.Timothy Sample
* 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.
2020-11-21lint: Add 'patch-headers' checker.Ludovic Courtès
* 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.
2020-11-12lint: patch-file-names: Simplify 'search-patch' error handling.Ludovic Courtès
* 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.
2020-10-12lint: cve: Set a connection timeout.Ludovic Courtès
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'.
2020-08-23lint: formatting: Gracefully handle relative file names.Ludovic Courtès
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.
2020-08-23lint: Avoid calls to 'package-field-location' with #f as the field.Ludovic Courtès
* guix/lint.scm (%make-warning): Call 'package-field-location' only when FIELD is true.