replace_index: { options = { arguments: true, evaluate: true, properties: true, } input: { console.log(arguments && arguments[0]); (function() { console.log(arguments[1], arguments["1"], arguments["foo"]); })("bar", 42); (function(a, b) { console.log(arguments[1], arguments["1"], arguments["foo"]); })("bar", 42); (function(arguments) { console.log(arguments[1], arguments["1"], arguments["foo"]); })("bar", 42); (function() { var arguments; console.log(arguments[1], arguments["1"], arguments["foo"]); })("bar", 42); } expect: { console.log(arguments && arguments[0]); (function() { console.log(arguments[1], arguments[1], arguments.foo); })("bar", 42); (function(a, b) { console.log(b, b, arguments.foo); })("bar", 42); (function(arguments) { console.log(arguments[1], arguments[1], arguments.foo); })("bar", 42); (function() { var arguments; console.log(arguments[1], arguments[1], arguments.foo); })("bar", 42); } expect_stdout: [ "undefined", "42 42 undefined", "42 42 undefined", "a a undefined", "42 42 undefined", ] } replace_index_keep_fargs: { options = { arguments: true, evaluate: true, keep_fargs: false, properties: true, } input: { console.log(arguments && arguments[0]); (function() { console.log(arguments[1], arguments["1"], arguments["foo"]); })("bar", 42); (function(a, b) { console.log(arguments[1], arguments["1"], arguments["foo"]); })("bar", 42); (function(arguments) { console.log(arguments[1], arguments["1"], arguments["foo"]); })("bar", 42); (function() { var arguments; console.log(arguments[1], arguments["1"], arguments["foo"]); })("bar", 42); } expect: { console.log(arguments && arguments[0]); (function(argument_0, argument_1) { console.log(argument_1, argument_1, arguments.foo); })("bar", 42); (function(a, b) { console.log(b, b, arguments.foo); })("bar", 42); (function(arguments) { console.log(arguments[1], arguments[1], arguments.foo); })("bar", 42); (function() { var arguments; console.log(arguments[1], arguments[1], arguments.foo); })("bar", 42); } expect_stdout: [ "undefined", "42 42 undefined", "42 42 undefined", "a a undefined", "42 42 undefined", ] } modified: { options = { arguments: true, } input: { (function(a, b) { var c = arguments[0]; var d = arguments[1]; a = "foo"; b++; console.log(a, b, c, d, arguments[0], arguments[1]); })("bar", 42); } expect: { (function(a, b) { var c = a; var d = b; a = "foo"; b++; console.log(a, b, c, d, a, b); })("bar", 42); } expect_stdout: "foo 43 bar 42 foo 43" } n;...* tests/guix-archive.sh, tests/guix-build-branch.sh, tests/guix-build.sh, tests/guix-daemon.sh, tests/guix-download.sh, tests/guix-environment.sh, tests/guix-gc.sh, tests/guix-git-authenticate.sh, tests/guix-graph.sh, tests/guix-hash.sh, tests/guix-lint.sh, tests/guix-pack-relocatable.sh, tests/guix-pack.sh, tests/guix-package-aliases.sh, tests/guix-package-net.sh, tests/guix-package.sh: Use the shell '!' keyword to negate command exit status in place of 'if ...; then false; else true; fi' Eric Bavier 2020-08-23lint: formatting: Gracefully handle relative file names....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. Ludovic Courtès 2019-12-08lint: Add '--load-path' option....* guix/scripts/lint.scm (%options): Add '--load-path' option. * doc/guix.texi: Document it. * tests/guix-lint.sh: Test it. Signed-off-by: Ludovic Courtès <ludo@gnu.org> zimoun