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")"
es/maven.scm, gnu/packages/mes.scm, gnu/packages/messaging.scm, gnu/packages/monitoring.scm, gnu/packages/mpd.scm, gnu/packages/music.scm, gnu/packages/networking.scm, gnu/packages/node-xyz.scm, gnu/packages/ocaml.scm, gnu/packages/ocr.scm, gnu/packages/onc-rpc.scm, gnu/packages/opencl.scm, gnu/packages/opencog.scm, gnu/packages/pantheon.scm, gnu/packages/password-utils.scm, gnu/packages/patchutils.scm, gnu/packages/pdf.scm, gnu/packages/perl6.scm, gnu/packages/phabricator.scm, gnu/packages/popt.scm, gnu/packages/printers.scm, gnu/packages/prolog.scm, gnu/packages/protobuf.scm, gnu/packages/pulseaudio.scm, gnu/packages/python-crypto.scm, gnu/packages/python-web.scm, gnu/packages/python-xyz.scm, gnu/packages/qt.scm, gnu/packages/radio.scm, gnu/packages/rails.scm, gnu/packages/rdf.scm, gnu/packages/rednotebook.scm, gnu/packages/rpc.scm, gnu/packages/rsync.scm, gnu/packages/ruby.scm, gnu/packages/rust.scm, gnu/packages/scheme.scm, gnu/packages/screen.scm, gnu/packages/security-token.scm, gnu/packages/selinux.scm, gnu/packages/serialization.scm, gnu/packages/shells.scm, gnu/packages/shellutils.scm, gnu/packages/simh.scm, gnu/packages/sml.scm, gnu/packages/ssh.scm, gnu/packages/statistics.scm, gnu/packages/stenography.scm, gnu/packages/sync.scm, gnu/packages/syncthing.scm, gnu/packages/synergy.scm, gnu/packages/telephony.scm, gnu/packages/terminals.scm, gnu/packages/tex.scm, gnu/packages/texinfo.scm, gnu/packages/text-editors.scm, gnu/packages/textutils.scm, gnu/packages/time.scm, gnu/packages/tmux.scm, gnu/packages/tor.scm, gnu/packages/toys.scm, gnu/packages/version-control.scm, gnu/packages/video.scm, gnu/packages/vim.scm, gnu/packages/virtualization.scm, gnu/packages/vlang.scm, gnu/packages/vnc.scm, gnu/packages/vpn.scm, gnu/packages/web-browsers.scm, gnu/packages/web.scm, gnu/packages/wireservice.scm, gnu/packages/wm.scm, gnu/packages/wxwidgets.scm, gnu/packages/xdisorg.scm, gnu/packages/xml.scm, gnu/packages/xorg.scm, tests/lint.scm: Remove trailing ".git" from 'git-reference' URL. Ludovic Courtès 2020-07-09gnu: gphotofs: Fix typo in description....* gnu/packages/file-systems.scm (gphotofs)[synopsis, description]: Fix typo. Tobias Geerinckx-Rice 2020-07-09gnu: mergerfs: Fix typo in description....* gnu/packages/file-systems.scm (mergerfs)[synopsis, description]: Fix typo. Tobias Geerinckx-Rice 2020-07-05gnu: bcachefs-tools: Display the correct version....* gnu/packages/file-systems.scm (bcachefs-tools)[arguments]: Add VERSION to make-flags. Tobias Geerinckx-Rice 2020-06-27gnu: Add autofs....* gnu/packages/file-systems.scm (autofs): New public variable. Co-authored-by: Oleg Pykhalov <go.wigust@gmail.com> Tobias Geerinckx-Rice 2020-06-10gnu: fsarchiver: Use HTTPS home page URI....* gnu/packages/file-systems.scm (fsarchiver)[home-page]: Use HTTPS URI. Nicolas Goaziou 2020-06-03gnu: Add mergerfs-tools....* gnu/packages/storage.scm (mergerfs-tools): New variable. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Lars-Dominik Braun 2020-06-03gnu: Add mergerfs....* gnu/packages/storage.scm (mergerfs): New variable. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Lars-Dominik Braun 2020-05-28gnu: Add exfatprogs....* gnu/packages/file-systems.scm (exfatprogs): New public variable. Signed-off-by: Leo Famulari <leo@famulari.name> Tobias Geerinckx-Rice 2020-05-27gnu: apfs-fuse: Update to 0.0.0-1.7b89418....* gnu/packages/file-systems.scm (apfs-fuse): Update to 0.0.0-1.7b89418. [arguments]: Install the README. Select FUSE 2 in #:configure-flags. Leo Famulari 2020-05-25gnu: disorderfs: Update to 0.5.10....* gnu/packages/file-systems (disorderfs): Update to 0.5.10. Vagrant Cascadian 2020-05-13gnu: fsarchiver: Edit synopsis & description....* gnu/packages/file-systems.scm (fsarchiver)[synopsis, description]: Fix spelling (file system, lose, …). Edit for grammar and style (‘…allows you to…’). Provide more information about the package. Tobias Geerinckx-Rice 2020-05-13gnu: fsarchiver: Move to (gnu packages file-systems)....* gnu/packages/disk.scm (fsarchiver): Move this variable… * gnu/packages/file-systems.scm (fsarchiver): …here. Tobias Geerinckx-Rice 2020-05-09gnu: zfs: Add missing input....Reported by ecbrown on IRC. * gnu/packages/file-systems.scm (zfs)[native-inputs]: Add kmod. Efraim Flashner 2020-05-08Merge branch 'core-updates'Marius Bakke 2020-05-08gnu: Add gphotofs....* gnu/packages/file-systems.scm (gphotofs): New variable. Signed-off-by: Danny Milosavljevic <dannym@scratchpost.org> Raghav Gururajan 2020-04-19Merge branch 'master' into core-updatesMarius Bakke 2020-04-16gnu: disorderfs: Update to 0.5.9....* gnu/packages/file-systems (disorderfs): Update to 0.5.9. Vagrant Cascadian 2020-02-14Merge branch 'master' into core-updatesMarius Bakke 2020-02-05gnu: disoderfs: Update to 0.5.8....* gnu/packages/file-systems (disorderfs): Update to 0.5.8. [home-page]: Update. Vagrant Cascadian 2020-02-03Merge branch 'staging' into core-updatesMarius Bakke 2020-01-30gnu: bcachefs-tools: Fix spelling of "utilities"....* gnu/packages/file-systems (bcachefs-tools): Fix typo. Vagrant Cascadian 2020-01-28gnu: Add bcachefs-tools....* gnu/packages/file-systems.scm (bcachefs-tools): New public variable. Tobias Geerinckx-Rice 2020-01-15gnu: util-linux: Move libraries to separate output....Fixes <https://bugs.gnu.org/37732>. Reported by Diego Nicola Barbato <dnbarbato@posteo.de>. * gnu/packages/linux.scm (util-linux)[outputs]: Add "lib". [arguments]: Update #:configure-flags and the "move-static-libraries" phase accordingly. Add phases "patch-build-scripts" and "adjust-pkg-config-files". (e2fsprogs, psm, mtd-utils, f2fs-tools, f2fs-tools-1.7, eudev, xfsprogs)[inputs]: Change to the "lib" output of UTIL-LINUX. (btrfs-progs)[inputs]: Remove duplicate UTIL-LINUX inputs and change to use the "lib" output. * gnu/packages/admin.scm (pam-mount)[inputs]: Add UTIL-LINUX:LIB. (testdisk)[inputs]: Change to the "lib" output of UTIL-LINUX. * gnu/packages/android.scm (abootimg)[inputs]: Likewise. * gnu/packages/audio.scm (jack-1)[propagated-inputs]: Likewise. * gnu/packages/bootloaders.scm (syslinux, vboot-utils)[inputs]: Likewise. * gnu/packages/chez.scm (chez-scheme)[inputs]: Likewise. * gnu/packages/cryptsetup.scm (cryptsetup, cryptsetup-static)[inputs]: Likewise. * gnu/packages/databases.scm (postgresql, 4store)[inputs]: Likewise. * gnu/packages/disk.scm (ndctl, gptfdisk, fdisk, gparted, rmlint, volume-key)[inputs]: Likewise. (parted)[inputs]: Likewise. [native-inputs]: Add UTIL-LINUX. * gnu/packages/efi.scm (sbsigntools)[inputs]: Add UTIL-LINUX:LIB. * gnu/packages/engineering.scm (lib3mf)[inputs]: Change to the "lib" output of UTIL-LINUX. * gnu/packages/enlightenment.scm (efl)[propagated-inputs]: Likewise. * gnu/packages/file-systems.scm (glusterfs, jfsutils, zfs)[inputs]: Likewise. * gnu/packages/firmware.scm (ovmf)[inputs]: Likewise. * gnu/packages/fontutils.scm (fontconfig)[propagated-inputs]: Likewise. * gnu/packages/freedesktop.scm (localed)[inputs]: Likewise. * gnu/packages/glib.scm (glib, appstream-glib)[propagated-inputs]: Likewise. * gnu/packages/gnome.scm (tracker, gnome-terminal)[inputs]: Likewise. * gnu/packages/jupyter.scm (xeus)[inputs]: Likewise. * gnu/packages/kde.scm (kpmcore)[inputs]: Likewise. * gnu/packages/kodi.scm (crossguid)[inputs]: Likewise. * gnu/packages/lighting.scm (ola)[inputs]: Likewise. * gnu/packages/music.scm (libgig)[inputs]: Likewise. * gnu/packages/nfs.scm (nfs-utils)[inputs]: Likewise. * gnu/packages/opencog.scm (opencog)[inputs]: Likewise. * gnu/packages/package-management.scm (msitools)[inputs]: Change to the "lib" output of UTIL-LINUX. * gnu/packages/password-utils.scm (pwsafe)[inputs]: Likewise. * gnu/packages/telephony.scm (pjproject)[propagated-inputs]: Likewise. * gnu/packages/rdf.scm (rasqal)[inputs]: Likewise. * gnu/packages/search.scm (xapian)[inputs]: Likewise. * gnu/packages/sssd.scm (sssd)[native-inputs]: Likewise. * gnu/packages/storage.scm (ceph)[inputs]: Add UTIL-LINUX:LIB. * gnu/packages/task-management.scm (taskwarrior)[inputs]: Change to the "lib" output of UTIL-LINUX. * gnu/packages/virtualization.scm (libvirt, xen)[inputs]: Likewise. * gnu/packages/xorg.scm (libsm)[inputs]: Likewise. Marius Bakke 2020-01-03gnu: Add jfs_fsck-static....* gnu/packages/file-systems.scm (jfs_fsck-static): New public variable. Tobias Geerinckx-Rice 2020-01-03gnu: Add jfsutils-static....gnu/packages/file-systems.scm (jfsutils/static): New public variable. Tobias Geerinckx-Rice 2019-12-31gnu: Add jfsutils....* gnu/packages/file-systems.scm (jfsutils): New public variable. Tobias Geerinckx-Rice 2019-12-26gnu: Add zfs....* gnu/packages/file-systems.scm (zfs): New variable. Efraim Flashner 2019-12-19gnu: httpfs2: Don't use NAME in source URI....* gnu/packages/file-systems.scm (httpfs2)[source]: Hard-code NAME. Tobias Geerinckx-Rice