1
0
mirror of https://git.savannah.gnu.org/git/guix.git synced 2026-04-06 13:10:33 +02:00

guix: lint: Check for misplaced argument flags.

* guix/lint.scm (check-misplaced-flags): New procedure.
(%local-checkers): Register new lint-checker.
* doc/guix.texi (Invoking guix lint): Add entry for misplaced-flags.
* tests/lint.scm (misplaced-flags: make-flag is incorrect,
misplaced-flags: configure-flag is incorrect, misplaced-flags: cargo
feature flags, misplaced-flags: flags without g-exp is incorrect,
misplaced-flags: build-type set correctly): New tests.

Change-Id: Ia8abbe787e26bffc65ee5c763326c7e271c189a4
This commit is contained in:
Efraim Flashner
2025-07-09 09:58:46 +03:00
parent fb8574b148
commit 54717bb5b3
3 changed files with 128 additions and 1 deletions

View File

@@ -33,7 +33,7 @@ Copyright @copyright{} 2015, 2016, 2017, 2019, 2020, 2021, 2023, 2025 Leo Famula
Copyright @copyright{} 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023 Ricardo Wurmus@*
Copyright @copyright{} 2016 Ben Woodcroft@*
Copyright @copyright{} 2016, 2017, 2018, 2021 Chris Marusich@*
Copyright @copyright{} 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023 Efraim Flashner@*
Copyright @copyright{} 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023, 2025 Efraim Flashner@*
Copyright @copyright{} 2016 John Darrington@*
Copyright @copyright{} 2016, 2017 Nikita Gillmann@*
Copyright @copyright{} 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024, 2025 Janneke Nieuwenhuizen@*
@@ -15797,6 +15797,27 @@ Parse the @code{source} URL to determine if a tarball from GitHub is
autogenerated or if it is a release tarball. Unfortunately GitHub's
autogenerated tarballs are sometimes regenerated.
@item misplaced-flags
Parse the @code{make-flags} and @code{configure-flags} to check for any
flags which should be set with another flag as part of the build-system.
For example,
@lisp
(build-system cmake-build-system)
(arguments
(list #:configure-flags #~(list "-DCMAKE_BUILD_TYPE=RELEASE"
"-DTESTS=ON")))
@end lisp
should instead be written as:
@lisp
(build-system cmake-build-system)
(arguments
(list #:build-type "RELEASE"
#:configure-flags #~(list "-DTESTS=ON")))
@end lisp
@item derivation
Check that the derivation of the given packages can be successfully
computed for all the supported systems (@pxref{Derivations}).