1
0
mirror of https://github.com/stedolan/jq.git synced 2024-05-11 05:55:39 +00:00

1563 Commits

Author SHA1 Message Date
c99981c5b2 Update "tests/man.test" and remove superflous whitespace in manual.yml
tests/man.test was generated incorrectly and had some duplicate tests,
the new CI workflow didn't like that.
2023-07-11 00:24:50 -05:00
c049061084 Fix build_manpage.py with newer markdown versions
The markdown python changed its API for markdown extensions.

Bumping the markdown package version in previous commits broke
docs/build_manpage.py since it was using registering an extension with
the old API.
2023-07-11 00:24:50 -05:00
83d4dd16ad Add CI workflow to make sure the man page and man.test can be built
And that man.test is up to date.
2023-07-11 00:24:50 -05:00
4ff63d9365 Add checksums.txt for release
Add checksums.txt for release
2023-07-10 23:59:07 -05:00
4c125c7ca6 Do not remove manpage prebuild file on build failure 2023-07-10 18:47:14 -05:00
2377972dfe Use jinja2 ==3.0.2 for now
We are using some deprecated jinja2 features that have been removed in
newer versions.
2023-07-10 16:19:52 -05:00
31280c3b50 Revert "Update docs/Pipfile.lock"
This reverts commit 7fba85095b83659e121819b8f55c0a1b90befd13.
2023-07-10 15:33:18 -05:00
7fba85095b Update docs/Pipfile.lock 2023-07-10 15:23:00 -05:00
fc1bef0261 Mark generated manual files as linguist-generated=true 2023-07-10 15:23:00 -05:00
295ff72dd0 Update docs/README.md 2023-07-10 14:35:11 -05:00
1ec8be1422 Update tests/man.test 2023-07-10 14:18:27 -05:00
2a67fc377d Update jq.1.prebuilt 2023-07-10 14:12:32 -05:00
3df8f90c4e Add first fuzzer for integration with OSS-Fuzz.
Signed-off-by: David Korczynski <david@adalogics.com>
2023-07-10 13:57:38 -05:00
6ca7973d49 Allow using { $__loc__ } as shorthand for { __loc__: $__loc__ }
n.b.: { $__loc__: "foo" }  is still not allowed.

$__loc__ cannot be overwritten, and it is always an object.
Using { $x: "foo" } where $x is not a string is an error, so there is
not much of a point in supporting that.
2023-07-10 12:04:54 -05:00
841445eea7 Build Docker image using pre-built executables (#2686) 2023-07-10 16:15:01 +09:00
8345a8a62b manual.yml: further tweaks re map and map_values
Further tweaks, e.g. i.f.o. explicitness:

`map_values(f)` outputs an array if given an array,
or an object if given an object.
2023-07-10 00:06:58 -05:00
39cf2fb7a6 manual.yml: further tweaks re map and map_values
A more systematic exposition
2023-07-10 00:06:58 -05:00
d710324ef8 manual.yml: clarify explanation of map_values, including description of new behavior
#2466
2023-07-10 00:06:58 -05:00
ce3701fe52 Cross compile for Linux, MacOS and Windows on CI (#2665) 2023-07-10 08:05:25 +09:00
193f432e08 Lex $foo as a single token, instead of using '$' IDENT
Previously, bindings were parsed as the combination of two tokens:
  '$' IDENT

This meant that using a keyword as variable name (e.g. $then, $label)
did not work.
Attempts were made to allow $keyword to work by adding some '$' Keyword
rules in the parser, but this did not allow $keyword in all places:

  jq --arg label foo -n '$label'  # ok

  jq -n '"foo" as $label | .'     # error

Treating $foo as a single token is much simpler, in my opinion.

This patch also changes how LOC is lexed: "$__loc__" instead of as
"__loc__" that gets combined with '$' in the parser.

This patch also disallows having spaces after '$' when recalling a
variable  `$ foo'  since that was probably just an unintentional side
effect of the implementation, and it was not documented.

Fixes #2675
2023-07-09 17:23:19 -05:00
c08ecbaf23 Mark src/{parser,lexer}.{c,h} as generated files in .gitattributes
This should hide edit to those files in PR diffs making PRs easier to
review.
2023-07-09 14:38:17 -05:00
600e602548 Fix empty regular expression matches (fix #2565) 2023-07-09 12:51:53 -05:00
cac216a39c Fix manual on paths/1 to use boolean filter for its argument 2023-07-09 10:54:13 -05:00
ab1a68144d Support .a.[] and .a.[]? each syntax
Fixes #1699
2023-07-09 10:08:31 -05:00
d8072564c2 Fix nth/2 to emit empty on index out of range 2023-07-08 23:13:15 -05:00
e2bc8de8bb Fix the latest manual on string multiplication by zero 2023-07-08 23:10:07 -05:00
cac3ea3726 Fix string multiplication by 0 (and less than 1) to emit empty string 2023-07-08 22:25:22 -05:00
88b45771bd Fix string multiplication with a value between 0.0 and 1.0
This commit fixes a regression of 6306ac89667c.
2023-07-08 22:25:22 -05:00
af57893bc2 Optimize appending deletion path in modify 2023-07-07 20:11:10 -05:00
371abc73ba Fix deletion using assigning empty against arrays (fix #2051) 2023-07-07 20:11:10 -05:00
cd8898d5b9 exit immediately after halt or halt_error is called
Instead of continuing to the next input, and only exiting if there are
no more inputs.

Closes #2533
2023-07-07 11:13:28 -05:00
0ecededefa Remove deprecated filters: leaf_paths, recurse_down 2023-07-07 10:53:40 -05:00
6944d81bc8 Fix dumping large floating numbers (fix #2367) (#2661) 2023-07-06 21:44:17 +09:00
c68ad08805 manual.yml: pick(pathexps)
Change formal parameter name
2023-07-05 23:48:31 -05:00
37225a9a07 builtin.jq: def pick(pathexps):
Change the name of the formal parameter.
2023-07-05 23:48:31 -05:00
416e8ada7d builtin: add pick(stream)
pick(stream) works on both arrays and objects

Restrictions on the dot-paths are specified in manual.yml

See #2578
2023-07-05 23:48:31 -05:00
a881532b29 Fix exit code on JSON parse error (#2654) 2023-07-06 10:01:59 +09:00
95625c3fdb Validate JSON for --jsonarg
Fixes #2572
2023-07-05 16:30:14 -05:00
c077b95ba2 Remove outdated CI badges from README.md (#2653) 2023-07-05 07:51:25 +09:00
9014c212e8 Release Docker image to GitHub Container Registry (#2652) 2023-07-05 04:33:57 +09:00
886a9b18b1 Make 0 divided by 0 results in NaN consistently (#2253) 2023-07-05 04:28:08 +09:00
dfd440f0de Setup path correctly after stream parsing a key:value object pair (#2642) 2023-07-05 04:23:52 +09:00
7d424fd52e Fix release workflow tag trigger pattern (#2651) 2023-07-04 16:00:25 +09:00
2270e208d2 Improve Dockerfile: update base image and optimize image size (#2649)
Also, drop ineffectual flags from configure.
2023-07-04 16:00:04 +09:00
12ce4e3b54 Support optional else-branch for if-then-elif-end (#2598) 2023-07-04 07:51:29 +09:00
4dc2a2fb9d Implement scan/2 filter (#1961) 2023-07-04 07:48:29 +09:00
83f375cc83 Revamp sub/3 to resolve most issues with gsub (and sub with "g") (#2641)
The primary purpose of this commit is to rectify most problems with
`gsub` (and also `sub` with the `g` option), in particular fix #1425 ('\b'),
fix #2354 (lookahead), and fix #2532 (regex == `"^(?!cd ).*$|^cd "`).

This commit also partly resolves #2148 and resolves #1206 in that
`gsub` no longer loops infinitely; however, because the new `gsub`
depends critically on `match/2`, the behavior when regex == `""` is
sometimes non-standard.

The documentation has been updated to reflect the fact that `sub`
and `gsub` are intended to be regular in the second argument.

Also, `_nwise/1` has been tweaked to take advantage of TCO.
2023-07-04 07:46:29 +09:00
edb0d88e3b Fix duplicate entry in .gitignore 2023-07-03 23:05:51 +09:00
3847ebb699 Create dist and upload on release also disable docs on build (#2648) 2023-07-03 21:05:21 +09:00
3c76a5b3f3 manual.yml: fix references to javascript, and clarify semantics of == (#2645)
remove inaccurate and confusing references to javascript; clarify semantics of ==
2023-07-03 12:35:41 +09:00