aboutsummaryrefslogtreecommitdiff
path: root/tests/guix-style.sh
blob: 2de879d5e33d00233202d25b4d962c6d5bf50757 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# GNU Guix --- Functional package management for GNU
# Copyright © 2022 Ludovic Courtès <ludo@gnu.org>
#
# This file is part of GNU Guix.
#
# GNU Guix is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or (at
# your option) any later version.
#
# GNU Guix is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

#
# Test 'guix style'.
#

set -e

guix style --version

tmpdir="guix-style-$$"
trap 'rm -r "$tmpdir"' EXIT

tmpfile="$tmpdir/os.scm"
mkdir "$tmpdir"
cat > "$tmpfile" <<EOF
;;; This is a header with three semicolons.
;;;

(define-module (foo bar)
  #:use-module (guix)
  #:use-module (gnu))

;; One blank line and a page break.


;; And now, the OS.
(operating-system
  (host-name "komputilo")
  (locale "eo_EO.UTF-8")

  ;; User accounts.
  (users (cons (user-account
                 (name "alice")
                 (comment "Bob's sister")
                 (group "users")

                 ;; Groups fit on one line.
                 (supplementary-groups '("wheel" "audio" "video")))
               %base-user-accounts))

  ;; The services.
  (services
   (cons (service mcron-service-type) %base-services)))
EOF

cp "$tmpfile" "$tmpfile.bak"

initial_hash="$(guix hash "$tmpfile")"

guix style -f "$tmpfile"
if test "$initial_hash" != "$(guix hash "$tmpfile")"
then
    cat "$tmpfile"
    diff -u "$tmpfile.bak" "$tmpfile"
    false
fi

# Introduce random changes and try again.
sed -i "$tmpfile" -e's/ \+/ /g'
test "$initial_hash" != "$(guix hash "$tmpfile")"

guix style -f "$tmpfile"
test "$initial_hash" = "$(guix hash "$tmpfile")"
d divergence in the i686 and x86_64 kernel configurations. * gnu/packages/aux-files/linux-libre/6.1-i686.conf, gnu/packages/aux-files/linux-libre/6.5-i686.conf: Set CONFIG_DRM_SIMPLEDRM=m. * gnu/packages/aux-files/linux-libre/6.1-x86_64.conf, gnu/packages/aux-files/linux-libre/6.5-x86_64.conf: Likewise, and set CONFIG_SYSFB_SIMPLEFB=y and CONFIG_GOOGLE_FRAMEBUFFER_COREBOOT=m. Change-Id: I707a293b58f7502cf107057ee0fa0b23d5630696 Tobias Geerinckx-Rice 2023-07-23gnu: Remove linux-libre 6.4....* gnu/packages/linux.scm (linux-libre-6.4-version, linux-libre-6.4-gnu-revision, deblob-scripts-6.4, linux-libre-6.4-pristine-source, linux-libre-6.4-source, linux-libre-headers-6.4, linux-libre-6.4): Remove variables. * gnu/packages/aux-files/linux-libre/6.4-arm.conf, gnu/packages/aux-files/linux-libre/6.4-arm64.conf, gnu/packages/aux-files/linux-libre/6.4-i686.conf, gnu/packages/aux-files/linux-libre/6.4-x86_64.conf: Delete files. * Makefile.am (AUX_FILES): Remove them. Leo Famulari 2023-07-23gnu: Add linux-libre 6.5....* gnu/packages/linux.scm (linux-libre-6.5-version, linux-libre-6.5-gnu-revision, deblob-scripts-6.5, linux-libre-6.5-pristine-source, linux-libre-6.5-source, linux-libre-headers-6.5, linux-libre-6.5): New variables. * gnu/packages/aux-files/linux-libre/6.5-arm.conf, gnu/packages/aux-files/linux-libre/6.5-arm64.conf, gnu/packages/aux-files/linux-libre/6.5-i686.conf, gnu/packages/aux-files/linux-libre/6.5-x86_64.conf: New files. * Makefile.am (AUX_FILES): Add them. Leo Famulari 2023-09-07gnu: guix-emacs: Reword docstrings....The current documentation strings cause compilation warnings; thus improve them. * gnu/packages/aux-files/emacs/guix-emacs.el (guix-emacs-autoload-regexp) (guix-emacs-find-autoloads, guix-emacs-autoload-packages): Make do without quoting 'autoload'. Reserve quotation to variables and functions. Liliana Marie Prikler 2023-09-07gnu: emacs: Reload subdirs.el files in ‘guix-emacs-autoload-packages’....This fixes a regression introduced with 79cfe30f3 ("build-system: emacs: Use subdirectories again.") which caused the 'guix-emacs-autoload-packages' to no longer be able to autoload all packages. * gnu/packages/aux-files/emacs/guix-emacs.el (guix-emacs-autoload-packages): Reload subdirs.el files unless NO-RELOAD is provided. Update docstring. * doc/guix.texi (Application Setup): Document that ‘guix-emacs-autoload-packages’ can be invoked interactively to auto-reload newly installed Emacs packages. * gnu/packages/emacs.scm (emacs)[arguments]<#:phases>: Call guix-emacs-autoload-packages with an argument in the site-start.el file. Signed-off-by: Liliana Marie Prikler <liliana.prikler@gmail.com> Maxim Cournoyer 2023-09-07gnu: emacs: Allow producing verbose messages when loading autoloads....* gnu/packages/aux-files/emacs/guix-emacs.el: Expound commentary. (guix-emacs-verbose): New variable. (guix-emacs--load-file-no-error): New procedure. (guix-emacs-autoload-packages): Use it. Signed-off-by: Liliana Marie Prikler <liliana.prikler@gmail.com> Maxim Cournoyer 2023-09-07gnu: emacs: Factorize a ‘guix-emacs--subdirs-files’ procedure....* gnu/packages/aux-files/emacs/guix-emacs.el (guix-emacs--subdirs-files): New procedure. (guix-emacs-load-package-descriptors): Use it. Signed-off-by: Liliana Marie Prikler <liliana.prikler@gmail.com> Maxim Cournoyer 2023-09-07gnu: emacs: Use lexical binding for guix-emacs.el startup library....* gnu/packages/aux-files/emacs/guix-emacs.el: Declare LEXCICAL-BINDING file variable to true. Signed-off-by: Liliana Marie Prikler <liliana.prikler@gmail.com> Maxim Cournoyer 2023-07-23gnu: Remove linux-libre 6.3....This kernel series is no longer supported upstream. * gnu/packages/linux.scm (linux-libre-6.3-version, linux-libre-6.3-gnu-revision, deblob-scripts-6.3, linux-libre-6.3-pristine-source, linux-libre-6.3-source, linux-libre-headers-6.3, linux-libre-6.3): Remove variables. * gnu/packages/aux-files/linux-libre/6.3-arm.conf, gnu/packages/aux-files/linux-libre/6.3-arm64.conf, gnu/packages/aux-files/linux-libre/6.3-i686.conf, gnu/packages/aux-files/linux-libre/6.3-x86_64.conf: Delete files. * Makefile.am (AUX_FILES): Remove them. * gnu/packages/patches/linux-libre-wireguard-postup-privkey.patch: Delete file. * gnu/local.mk (dist_patch_DATA): Remove it. Leo Famulari 2023-07-15gnu: Add linux-libre 6.4...* gnu/packages/linux.scm (linux-libre-6.4-version, linux-libre-6.4-gnu-revision, deblob-scripts-6.4, linux-libre-6.4-pristine-source, linux-libre-6.4-source, linux-libre-headers-6.4, linux-libre-6.4: New variables. * gnu/packages/aux-files/linux-libre/6.4-arm.conf, * gnu/packages/aux-files/linux-libre/6.4-arm64.conf, * gnu/packages/aux-files/linux-libre/6.4-i686.conf, * gnu/packages/aux-files/linux-libre/6.4-x86_64.conf: New files. * Makefile.am (AUX_FILES): Add them. Leo Famulari 2023-05-31gnu: Remove linux-libre 6.2....This kernel series is no longer supported upstream. * gnu/packages/linux.scm (linux-libre-6.2-version, linux-libre-6.2-gnu-revision, deblob-scripts-6.2, linux-libre-6.2-pristine-source, linux-libre-6.2-source, linux-libre-headers-6.2, linux-libre-6.2): Remove variables. * gnu/packages/aux-files/linux-libre/6.2-arm.conf, gnu/packages/aux-files/linux-libre/6.2-arm64.conf, gnu/packages/aux-files/linux-libre/6.2-i686.conf, gnu/packages/aux-files/linux-libre/6.2-x86_64.conf: Delete files. * Makefile.am (AUX_FILES): Remove them. Leo Famulari 2023-05-16gnu: Add linux-libre 6.3....* gnu/packages/linux.scm (linux-libre-6.3-version, linux-libre-6.3-gnu-revision, deblob-scripts-6.3, linux-libre-6.3-pristine-source, linux-libre-6.3-source, linux-libre-headers-6.3, linux-libre-6.3): New variables. * gnu/packages/aux-files/linux-libre/6.3-arm.conf, gnu/packages/aux-files/linux-libre/6.3-arm64.conf, gnu/packages/aux-files/linux-libre/6.3-i686.conf, gnu/packages/aux-files/linux-libre/6.3-x86_64.conf: New files. * Makefile.am (AUX_FILES): Add them. Leo Famulari 2023-04-21gnu: docbook-xml-4.1.2: Add missing catalog.xml....* gnu/packages/aux-files/xml/docbook-xml/catalog-4.1.2.xml: New file. * Makefile.am: Register it. * gnu/packages/docbook.scm (docbook-xml-4.1.2)[arguments]: Use prebuilt catalog.xml. [native-inputs]: Add libxml2. Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com> Bruno Victal 2023-04-21gnu: docbook-xml: Use XSLT to patch catalog.xml....(sxml transforms) are unsuited here due to guile-bug #20339. * gnu/packages/aux-files/xml/patch-catalog-xml.xsl: New file. * Makefile.am: Register it. * gnu/packages/docbook.scm (docbook-xml-5)[native-inputs]: Add libxslt. [arguments]: Add phase to patch catalog.xml using XSLT. Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com> Bruno Victal 2023-04-14maint: Merge sanity-check-next.py into sanity-check.py....* gnu/packages/aux-files/python/sanity-check-next.py: Rename to... * gnu/packages/aux-files/python/sanity-check.py: ... this. * guix/build-system/pyproject.scm (sanity-check.py): Adjust file name. * Makefile.am (AUX_FILES): De-register sanity-check-next.py. Maxim Cournoyer 2023-03-19gnu: linux-libre: Update kernel configs for 6.2.7....* gnu/packages/aux-files/linux-libre/6.2-arm.conf, gnu/packages/aux-files/linux-libre/6.2-arm64.conf, gnu/packages/aux-files/linux-libre/6.2-i686.conf, gnu/packages/aux-files/linux-libre/6.2-x86_64.conf: Set some new configuration options. Leo Famulari 2023-03-06gnu: Add linux-libre 6.2....* gnu/packages/linux.scm (linux-libre-6.2-version, linux-libre-6.2-gnu-revision, deblob-scripts-6.2, linux-libre-6.2-pristine-source, linux-libre-6.2-source, linux-libre-headers-6.2, linux-libre-6.2): New variables. * gnu/packages/aux-files/linux-libre/6.2-arm.conf, gnu/packages/aux-files/linux-libre/6.2-arm64.conf, gnu/packages/aux-files/linux-libre/6.2-i686.conf, gnu/packages/aux-files/linux-libre/6.2-x86_64.conf: New files. * Makefile.am (AUX_FILES): Add them. Leo Famulari 2023-02-19gnu: linux-libre: Consistently provide the drop_monitor module....This is needed by, e.g., <https://github.com/nhorman/dropwatch>. Build it as a module everywhere for consistency. * gnu/packages/aux-files/linux-libre/4.14-i686.conf: Set CONFIG_NET_DROP_MONITOR=m. * gnu/packages/aux-files/linux-libre/4.14-x86_64.conf: Likewise. * gnu/packages/aux-files/linux-libre/4.19-i686.conf: Likewise. * gnu/packages/aux-files/linux-libre/4.19-x86_64.conf: Likewise. * gnu/packages/aux-files/linux-libre/5.10-arm.conf: Likewise. * gnu/packages/aux-files/linux-libre/5.10-arm64.conf: Likewise. * gnu/packages/aux-files/linux-libre/5.10-i686.conf: Likewise. * gnu/packages/aux-files/linux-libre/5.10-x86_64.conf: Likewise. * gnu/packages/aux-files/linux-libre/5.15-arm.conf: Likewise. * gnu/packages/aux-files/linux-libre/5.15-arm64.conf: Likewise. * gnu/packages/aux-files/linux-libre/5.15-i686.conf: Likewise. * gnu/packages/aux-files/linux-libre/5.15-x86_64.conf: Likewise. * gnu/packages/aux-files/linux-libre/5.4-arm.conf: Likewise. * gnu/packages/aux-files/linux-libre/5.4-arm64.conf: Likewise. * gnu/packages/aux-files/linux-libre/5.4-i686.conf: Likewise. * gnu/packages/aux-files/linux-libre/5.4-x86_64.conf: Likewise. * gnu/packages/aux-files/linux-libre/6.1-arm.conf: Likewise. * gnu/packages/aux-files/linux-libre/6.1-arm64.conf: Likewise. * gnu/packages/aux-files/linux-libre/6.1-i686.conf: Likewise. * gnu/packages/aux-files/linux-libre/6.1-x86_64.conf: Likewise. Reported by mirai in #guix. Tobias Geerinckx-Rice 2023-02-12gnu: linux-libre: Disable unprivileged BPF by default....* gnu/packages/aux-files/linux-libre/5.15-arm.conf: Set CONFIG_BPF_UNPRIV_DEFAULT_OFF=y. * gnu/packages/aux-files/linux-libre/5.15-arm64.conf: Likewise. * gnu/packages/aux-files/linux-libre/5.15-i686.conf: Likewise. * gnu/packages/aux-files/linux-libre/5.15-x86_64.conf: Likewise. * gnu/packages/aux-files/linux-libre/6.1-arm.conf: Likewise. * gnu/packages/aux-files/linux-libre/6.1-arm64.conf: Likewise. * gnu/packages/aux-files/linux-libre/6.1-i686.conf: Likewise. * gnu/packages/aux-files/linux-libre/6.1-x86_64.conf: Likewise. Tobias Geerinckx-Rice 2023-02-11gnu: emacs: Add TREE_SITTER_GRAMMAR_PATH support....gnu/packages/emacs.scm (emacs)[native-search-paths]: Add a search-path for tree-sitter grammars. gnu/packages/aux-files/emacs/guix-emacs.el: Add directories from TREE_SITTER_GRAMMAR_PATH to treesit-extra-load-path. Andrew Tropin 2023-01-13gnu: Remove linux-libre 6.0....This kernel series is no longer supported upstream. * gnu/packages/linux.scm (linux-libre-6.0-version, linux-libre-6.0-gnu-revision, deblob-scripts-6.0, linux-libre-6.0-pristine-source, linux-libre-6.0-source, linux-libre-headers-6.0, linux-libre-6.0): Remove variables. * gnu/packages/aux-files/linux-libre/6.0-arm.conf, gnu/packages/aux-files/linux-libre/6.0-arm64.conf, gnu/packages/aux-files/linux-libre/6.0-i686.conf, gnu/packages/aux-files/linux-libre/6.0-x86_64.conf: Delete files. * Makefile.am (AUX_FILES): Remove them. Leo Famulari 2023-01-08gnu: Remove linux-libre 4.9....This kernel series is no longer supported upstream: https://lkml.iu.edu/hypermail/linux/kernel/2301.0/06398.html https://www.kernel.org/category/releases.html * gnu/packages/aux-files/linux-libre/4.9-i686.conf, gnu/packages/aux-files/linux-libre/4.9-x86_64.conf: Delete files. * Makefile.am (AUX_FILES): Remove them. * gnu/packages/linux.scm (linux-libre-4.9-version, linux-libre-4.9-gnu-revision, deblob-scripts-4.9, linux-libre-4.9-pristine-source, linux-libre-4.9-source, linux-libre-headers-4.9, linux-libre-4.9): Remove variables. * gnu/tests/base.scm (%test-linux-libre-4.9): Likewise. Leo Famulari 2023-01-03gnu: Add linux-libre 6.1....* gnu/packages/linux.scm (linux-libre-6.1-version, linux-libre-6.1-gnu-revision, deblob-scripts-6.1, linux-libre-6.1-source, linux-libre-headers-6.1, linux-libre-6.1): New variables. * gnu/packages/aux-files/linux-libre/6.1-arm.conf, gnu/packages/aux-files/linux-libre/6.1-arm64.conf, gnu/packages/aux-files/linux-libre/6.1-i686.conf, gnu/packages/aux-files/linux-libre/6.1-x86_64.conf: New files. * Makefile.am (AUX_FILES): Add them. Leo Famulari