aboutsummaryrefslogtreecommitdiff
path: root/guix/lint.scm
Commit message (Collapse)AuthorAge
* lint: archival: Trigger “Save Code Now” for VCSes other than Git.Ludovic Courtès2024-03-09
| | | | | | | | | | | | | | | Until now, ‘save-origin’ would be called only when given a <git-reference>. With this change, ‘save-origin’ gets called for other version control systems as well. * guix/lint.scm (swh-response->warning): New procedure, formerly in ‘check-archival’. (vcs-origin, save-package-source): New procedures. (check-archival)[response->warning]: Remove. Call ‘save-package-source’ in both the Git and the non-Git cases. * tests/lint.scm ("archival: missing svn revision"): New test. Change-Id: I535e4ec89488faf83bfa544d5e4935fa73ef54fb
* lint: archival: Fix crash in non-Git case.Ludovic Courtès2024-03-09
| | | | | | | | | | Fixes a bug introduced in 29f3089c841f00144f24f5c32296aebf22d752cc where ‘guix lint -c archival guile-wisp’ (for instance) would crash with a match error because ‘lookup-by-nar-hash’ returns a string. * guix/lint.scm (check-archival): Add SWHID case in the non-Git case. Change-Id: I66fb060172d372041df47d90a14df168b0fa762d
* lint: Switch to SRFI-71.Ludovic Courtès2024-03-09
| | | | | | * guix/lint.scm: Switch from SRFI-11 to SRFI-71. Change-Id: I62e6cd304ad73570bd12bd67f7051566205596bb
* lint: archival: Check with ‘lookup-directory-by-nar-hash’.Ludovic Courtès2024-02-12
| | | | | | | | | | | | | | | | | While this method is new and nar-sha256 ExtIDs are currently available only for new visits, it is fundamentally more reliable than the other methods, which is why it comes first. * guix/lint.scm (check-archival)[lookup-by-nar-hash]: New procedure. Call ‘lookup-by-nar-hash’ before the other lookup methods. * tests/lint.scm ("archival: content available") ("archival: content unavailable but disarchive available") ("archival: missing revision") ("archival: revision available"): Add a 404 response corresponding to the ‘lookup-external-id’ request. * tests/lint.scm ("archival: nar-sha256 extid available"): New test. Change-Id: I4a81d6e022a3b72e6484726549d7fbae627f8e73
* lint: Speed up the formatting linter.Christopher Baines2023-11-05
| | | | | | | | | | By using go-to-location which caches the number of bytes to seek by to get to specific lines in a file. * guix/lint.scm (report-formatting-issues): Use go-to-location. Change-Id: I34e4d3acfbb1e14e026d2e7f712ba8d22b56c147 Signed-off-by: Christopher Baines <mail@cbaines.net>
* lint: Check that (cc-for-target) and friends are used.Maxime Devos2023-09-08
| | | | | | | | | | | | | | | | | | "CC=gcc" is almost always incorrect; people often just don't notice the incorrectness because they are compiling natively. For an exception, see tzdata. "guix style" partially made things worse, so I partially ignored it. * guix/lint.scm (check-compiler-for-target): New linter. * tests/lint.scm ("compiler-for-target: unconditional CC=gcc is unacceptable") ("compiler-for-target: looks through G-expressions") ("compiler-for-target: (cc-for-target) is acceptable") ("compiler-for-target: CC=gcc is acceptable when target=#false"): Test it. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* gnu: Deprecate `texlive-tiny'.Nicolas Goaziou2023-07-18
| | | | | | | | | | | | | | | | | | | | | | | | | | At this point, there are three equivalent TeX Live sub-systems: texlive-scheme-basic, texlive-tiny, and (texlive-updmap.cfg). It is confusing to keep so many around. * doc/contributing.texi (Submitting Patches): Remove reference to TEXLIVE-TINY. * gnu/packages/algebra.scm (pari-gp)[native-inputs]: (giac)[native-inputs]: * gnu/packages/chez.scm (chez-sockets)[native-inputs]: * gnu/packages/engineering.scm (fastcap)[native-inputs]: * gnu/packages/gettext.scm (po4a)[native-inputs]: * gnu/packages/maths.scm (cddlib)[native-inputs]: (gnuplot)[native-inputs]: (itpp)[native-inputs]: * gnu/packages/ocaml.scm (unison)[native-inputs]: * gnu/packages/pdf.scm (extractpdfmark)[native-inputs]: * gnu/packages/photo.scm (enblend-enfuse): Replace TEXLIVE-TINY with a call to TEXLIVE-UPDMAP.CFG. * gnu/packages/radio.scm (gnuradio)[native-inputs]: Remove unnecessary TEXLIVE-TINY. * gnu/packages/tex.scm (texlive-tiny): Deprecate it in favor of TEXLIVE-SCHEME-BASIC. (texlive-makecmds)[native-inputs]: Replace TEXLIVE-TINY with a call to TEXLIVE-UPDMAP.CFG. * guix/lint.scm (check-inputs-should-be-native): Check only for "texlive-updmap.cfg" input name.
* guix: Add linter warning about texlive-updmap.cfg and texlive-tiny.Nicolas Goaziou2023-07-18
| | | | | * guix/lint.scm (check-inputs-should-be-native): Warn when TEXLIVE-UPDMAP.CFG and TEXLIVE-TINY are not native inputs.
* lint: archival: Warn against non-origin package sources.Ludovic Courtès2023-05-06
| | | | | | | | | Suggested by Maxim Cournoyer <maxim.cournoyer@gmail.com> and Simon Tournier <zimon.toutoune@gmail.com>. * guix/lint.scm (check-archival): Add 'local-file?' clause. Clarify message in case (package-source package) is not an origin. * tests/lint.scm ("archival: not an origin"): New test.
* Merge branch 'master' into core-updates.Maxim Cournoyer2023-04-14
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: gnu/local.mk gnu/packages/build-tools.scm gnu/packages/certs.scm gnu/packages/check.scm gnu/packages/compression.scm gnu/packages/cups.scm gnu/packages/fontutils.scm gnu/packages/gnuzilla.scm gnu/packages/guile.scm gnu/packages/ibus.scm gnu/packages/image-processing.scm gnu/packages/linux.scm gnu/packages/music.scm gnu/packages/nss.scm gnu/packages/pdf.scm gnu/packages/python-xyz.scm gnu/packages/qt.scm gnu/packages/ruby.scm gnu/packages/shells.scm gnu/packages/tex.scm gnu/packages/video.scm gnu/packages/vulkan.scm gnu/packages/web.scm gnu/packages/webkit.scm gnu/packages/wm.scm
| * Revert "lint: Append "/info/refs" to git-reference-url."Maxim Cournoyer2023-03-28
| | | | | | | | | | | | | | This reverts commit c9af27d4ca733b20f09019f1465d3e5fdc1ec724. The change causes 'guix lint' to print URI not reachable (403) errors for GitHub every URLs.
| * lint: Append "/info/refs" to git-reference-url.Felix Lechner2023-03-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * lint: Prevent inlining of 'package-vulnerabilities'.Ludovic Courtès2023-03-27
| | | | | | | | * guix/lint.scm (package-vulnerabilities): Prevent inlining.
| * guix: Run check-synopsis-style with other local checks.Sergey Trofimov2023-03-21
| | | | | | | | | | | | | | * guix/lint.scm (%network-dependent-checkers): Move check-synopsis-style to... (%local-checkers): ... here. Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
* | Merge remote-tracking branch 'origin/master' into core-updatesAndreas Enge2023-03-20
|\|
| * guix: Strip #:use-module lists.Ludovic Courtès2023-03-13
| | | | | | | | | | | | | | | | | | | | | | | | 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.
| * lint: Check that python-pre-commit is not an input.Antero Mejr2023-03-12
| | | | | | | | | | | | | | | | | | | | 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>
* | Merge remote-tracking branch 'origin/master' into core-updatesEfraim Flashner2023-01-30
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: doc/guix.texi gnu/local.mk gnu/packages/admin.scm gnu/packages/base.scm gnu/packages/chromium.scm gnu/packages/compression.scm gnu/packages/databases.scm gnu/packages/diffoscope.scm gnu/packages/freedesktop.scm gnu/packages/gnome.scm gnu/packages/gnupg.scm gnu/packages/guile.scm gnu/packages/inkscape.scm gnu/packages/llvm.scm gnu/packages/openldap.scm gnu/packages/pciutils.scm gnu/packages/ruby.scm gnu/packages/samba.scm gnu/packages/sqlite.scm gnu/packages/statistics.scm gnu/packages/syndication.scm gnu/packages/tex.scm gnu/packages/tls.scm gnu/packages/version-control.scm gnu/packages/xml.scm guix/build-system/copy.scm guix/scripts/home.scm
| * Remove now unnecessary uses of (guix grafts).Ludovic Courtès2022-10-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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).
| * lint: source: Handle <svn-multi-reference> origins.Ludovic Courtès2022-10-20
| | | | | | | | | | | | | | | | | | 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.
| * lint: source: Add check for <svn-reference> over HTTP(S).Ludovic Courtès2022-10-17
| | | | | | | | | | | | | | * 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.
| * lint: 'probe-uri' honors the 'userinfo' part of URIs.Ludovic Courtès2022-10-17
| | | | | | | | * guix/lint.scm (probe-uri): Honor the 'userinfo' part of URI.
* | Merge branch 'staging' into core-updatesMaxim Cournoyer2022-09-27
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts resolved in: gnu/local.mk gnu/packages/cran.scm gnu/packages/gnome.scm gnu/packages/gtk.scm gnu/packages/icu4c.scm gnu/packages/java.scm gnu/packages/machine-learning.scm gnu/packages/tex.scm
| * lint: Extract logic of 'check-mirror-url'.Maxime Devos2022-09-26
| | | | | | | | | | | | | | | | | | | | 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>
* | Merge branch 'staging' into core-updatesMarius Bakke2022-08-11
|\|
| * gnu: qttools: Rename to qttools-5.Maxim Cournoyer2022-07-31
| | | | | | | | | | | | | | Automated with: git grep -l qttools | xargs sed 's/\bqttools\b/\0-5/g' -i git checkout NEWS
* | Merge branch 'master' into core-updatesLudovic Courtès2022-06-08
|\|
| * gnu: Remove python2-setuptools.Maxim Cournoyer2022-05-31
| | | | | | | | | | | | | | * 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.
| * gnu: Remove python2-mccabe.Maxim Cournoyer2022-05-31
| | | | | | | | * gnu/packages/python-xyz.scm (python2-mccabe): Delete variable.
| * lint: check-derivation: Catch all exceptions.Christopher Baines2022-05-23
| | | | | | | | | | | | | | | | | | | | 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.
* | Merge branch 'staging' into core-updates.Maxim Cournoyer2022-03-21
|\|
| * lint: check-tests-true: Allow #:tests? #t for some build systems.Maxime Devos2022-03-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge branch 'staging' into core-updates.Maxim Cournoyer2022-01-25
|\| | | | | | | | | | | | | | | | | | | With "conflicts" resolved in (mostly in favor of master/staging): gnu/packages/admin.scm gnu/packages/gnuzilla.scm gnu/packages/gtk.scm gnu/packages/kerberos.scm gnu/packages/linux.scm guix/lint.scm
| * guix: lint: Fix comment per TODO.Maxim Cournoyer2022-01-10
| | | | | | | | * guix/lint.scm (check-wrapper-inputs): Address TODO in comment.
* | Merge branch 'master' into core-updatesEfraim Flashner2021-12-19
|\|
| * 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.
* | | lint: check-wrapper-inputs: Remove mentions of core-updates.Maxime Devos2021-10-02
|/ / | | | | | | | | | | | | | | | | | | The #:sh argument of 'wrap-program' and 'wrap-qt-program' is now in the current branch, so some comments aren't relevant anymore. * guix/lint.scm (check-wrapper-inputs)[check-procedure-body]: Remove mentions of core-updates. Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
* | 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'.