Commit Graph
100 Commits
Author SHA1 Message Date
itchyny 81f4f883ac Remove non-standard pow10 filter in favor of exp10 (#3059)
The pow10 function was a glibc extension removed in 2.27. Use exp10 filter instead.
2024-03-20 18:23:08 +09:00
itchyny ce0e788ce2 improve tonumber/0 performance by parsing input as number literal
Previously, the tonumber/0 filter parses the input as JSON values, but
this is less-performant on large non-number strings. Parsing the input
string as number literal fixes the performance issue. Also, this fix
changes the filter to reject numbers with white spaces.
2024-03-01 16:33:17 +01:00
itchyny 56828b6d04 Always build Docker image on CI, group Dependabot PRs for official actions (#2997)
* Always build docker image on CI

* Revert "Bump actions/download-artifact from 3 to 4"

This reverts commit 9e2695e117.

* Group Dependabot PRs for official actions
2023-12-19 17:54:53 +09:00
itchyny d14393f552 Keep releasing executables with legacy names 2023-11-28 22:51:20 +01:00
itchyny 07149397d1 Reject U+001F in string literals (fix #2909) 2023-09-26 12:53:44 -05:00
itchyny e526df15fe Correct typo in README.md: compilation (#2912) 2023-09-26 19:49:07 +02:00
itchyny 5ea1a4ab3b Disable core.autocrlf on Windows to prevent submodule diffs (fix #2886) (#2888) 2023-09-15 20:08:20 +09:00
itchyny 70807e2b1b Include more updates to NEWS.md and AUTHORS for 1.7 2023-08-23 15:59:19 -05:00
itchyny 080471b2a0 Add src/config_opts.inc to .gitignore 2023-08-21 16:06:58 +02:00
itchyny 7d64381016 Fix overflow on numeric comparison (#2849)
Although #2839 fixed the overflow of exponent subtraction,
there still is possibility of overflow in the `D2U` macro.
This patch fixes the overflow in the `D2U` macro, and also
truncates the maximum digits to `DEC_MAX_DIGITS`.
2023-08-17 15:56:57 +09:00
itchyny 0733fd3d58 Add a regression test for negative indices and fix a pick/1 test 2023-08-16 17:49:44 -05:00
itchyny f85c9fcb78 Revert "Allow .[-1] in path expressions"
This reverts commit 086a156ec3.

This commit leads to negative indexing wraps twice.
2023-08-16 17:49:44 -05:00
itchyny 3fa10e8cc1 Fix crash on numeric comparison again (ref #2825)
The decNumber library subtracts the exponents of two numbers,
we make sure to limit the number of digits not to make it overflows.
Since the maximum adjusted exponent is `emax` and the minimum is
`emin - digits + 1`, we follow `emax - (emin - digits + 1) <= INT32_MAX`.
2023-08-13 14:17:25 +02:00
itchyny f86566b263 Rename jv_type_private.h to jv_private.h, move jvp_number_is_nan there 2023-08-13 14:16:02 +02:00
itchyny a692060129 Change the default color of null to Bright Black 2023-08-05 23:21:12 -05:00
itchyny 949d38e6dc Fix crash on numeric comparison (ref #2804) (#2818) 2023-08-03 23:19:52 +09:00
itchyny fd0d475694 Fix a test case added in #2790 2023-08-02 22:33:09 +09:00
itchynyandLeonid S. Usov 680baeffeb Fix rounding small (but not too small) numbers to zero on calculation
Co-authored-by: Leonid S. Usov <leonid.s.usov@gmail.com>
2023-08-02 00:32:32 -05:00
itchyny 0f80921268 Fix constant folding of division and reminder with zero divisor
Previously constant folding of zero division (e.x. 1/0) produces a
compile error. This was incorrectly implemented by checking if the
division result is infinite, so produces wrong results compared to the
query where no constant folding is processed (e.x. 1e308/0.1). This
patch delays the operation when the divisor is zero. This makes the
results more consistent, but changes the exit code on zero division from
3 to 5. Also 0/0 now produces the zero division error, not NaN.

This patch also fixes the modulo operation. Previously constant folding
logic does not take care of the % operator, but now it folds if the both
dividend and divisor are safe numbers to cast to the integer type, and
the divisor is not zero. This patch also fixes some code that relies on
undefined cast behaviors in C. The modulo operation produces NaN if
either the dividend or divisor is NaN.
2023-07-31 15:39:13 -05:00
itchyny c8e28da129 Redesign website (#2628)
* Bump up Bootstrap to v5.3.1, Bootstrap Icon to v1.10.5.
* Use autoComplete.js to drop dependency on jQuery and typeahead.js.
* Support dark mode.
* New svg logo and icon with responsive color mode support.
* Normalize section ids to lower kebab-case for easiness of linking.
* Use relative paths for links for local development (--root /output).
* Various markup cleanups and accessibility improvements.
2023-07-31 09:52:52 +09:00
itchyny d319eb2187 Fix PR creation by using fully qualified refname on release 2023-07-28 17:47:51 +09:00
itchyny 5b9d0750db Fix PR creation by specifying the branch on release 2023-07-28 10:25:06 +09:00
itchyny b33725c96e Fix gh pr create option on release 2023-07-28 10:04:35 +09:00
itchyny 72f147e82e Fix release job to create a pull request for signatures 2023-07-27 19:18:16 -05:00
itchyny 4160a36fb5 Commit GPG signatures on release 2023-07-27 17:01:24 -05:00
itchyny 668607e305 Enable gamma, drem on macOS 2023-07-26 23:56:01 -05:00
itchyny a1e791acf8 Rename --nul-output to --raw-output0, abort on string containing NUL
The option naming --nul-output was confusing, especially when we have a
similar option for input stream in the future (--nul-input vs --null-input).
Based on the observation of other command line tools, we rename the option
to --raw-output0. We also drop the short option -0 to avoid confusion on
introducing the NUL-delimited input option.

Unlike the other command line tools outputting file names with NUL delimiter,
jq deals with JSON, and its strings may contain NUL character. To protect
users from the risk of injection attacks, we abort the program and print an
error message before outputting strings including NUL character. Closes #2683.
2023-07-26 23:55:00 -05:00
itchyny a29ac81de1 Remove deprecated --argfile option 2023-07-25 10:21:01 -05:00
itchyny 4705a22c7d Reorder the command line options in the manual (#2766) 2023-07-25 15:24:54 +09:00
itchyny 5300fbda58 Add decnum workflow to test building without decNumber support 2023-07-24 11:53:51 -05:00
itchyny c4d5ba954d Improve USE_DECNUM check position 2023-07-24 11:53:51 -05:00
itchyny ed334b536f Improve manual in various ways (inputs, sort_by, foreach sections, etc.) (#2744)
- Add error/0 and mentions null input behavior (close #2231)
- Explain value iterator suffix syntax .foo[] (close #1047)
- Mention array slicing is also zero-based (close #2094)
- Add examples of input and inputs filters (close #2216, close #2470)
- Improve sort_by about multiple values (close #2103, close #2467, close #2474)
- Improve foreach section and simplify examples (close #1148, close #2169)
- Fix recurse/1 document on how it is identical using recurse/2 (close #2036, close #2412)
- Add non-string examples of index/1, rindex/1 (close #1422)
- Simplify the example of truncate_stream/1 (close #1736)
2023-07-24 20:24:44 +09:00
itchyny 98f709d0c1 Fix stderr to output string with no decoration (fix #2063) 2023-07-23 17:06:00 -05:00
itchyny dfdce8c6e7 Add checksum signature of old release artifacts (close #1999) 2023-07-23 12:24:59 -05:00
itchyny 123c780607 Enable significand on macOS 2023-07-23 03:28:07 -05:00
itchyny 99a381b5aa Improve --help to mention all the command options 2023-07-23 03:26:44 -05:00
itchyny 575372222a Add importlib_resources dependency for older Python (fix #2753) (#2754) 2023-07-23 15:01:16 +09:00
itchyny 34629ed223 Fix manual source code to follow the schema definition 2023-07-22 19:00:16 -05:00
itchyny 9044f540bb Validate manual schema 2023-07-22 19:00:16 -05:00
itchyny c9c45d7f03 Add tests for --arg, --argjson, and similar options 2023-07-22 12:29:24 -05:00
itchyny 649d6b5f5e Update AUTHOR for the next release 2023-07-22 11:53:43 -05:00
itchyny e0e1b2293e Enable verbose output of make check 2023-07-21 19:49:48 -05:00
itchyny 3ed928954a Fail quickly if not in git repository in scripts/version 2023-07-21 08:59:17 -05:00
itchyny 4732dd82c0 Remove AppVeyor configuration (#2741) 2023-07-21 22:45:45 +09:00
itchyny 7c2bf9bd17 Clarify the Docker image location (close #1864) (#2740) 2023-07-21 20:42:11 +09:00
itchyny 99a77f724b Add a regression test for #2000 2023-07-21 09:01:28 +09:00
itchyny f1c49473a3 Avoid getpwuid for static linking 2023-07-19 09:56:41 -05:00
itchyny f0306405c1 Add notes on NO_COLOR environment variable to the manual 2023-07-19 09:56:01 -05:00
itchyny 0615d4982c Respect NO_COLOR environment variable to disable color output 2023-07-19 00:05:41 -05:00
itchyny 87e3dfddb8 Enable valgrind in oniguruma workflow 2023-07-19 06:45:09 +02:00
0b558f6ed4 Make object key color configurable (close #1739, #1791, #2638)
Co-authored-by: David Haguenauer <ml@kurokatta.org>
Co-authored-by: Eric Pruitt <eric.pruitt@gmail.com>
2023-07-18 17:53:29 -05:00
itchyny 0e3c3913d8 Add oniguruma workflow to test regex options 2023-07-18 14:28:16 -05:00
itchyny 9e4c71558a Split man.test to make tests pass without oniguruma (#2722) 2023-07-18 08:17:21 +09:00
itchyny 1cb9ba3533 Fix autoreconf warnings 2023-07-16 00:02:46 -05:00
itchyny 24871fb4a3 Fix memory leak on halt_error/1 2023-07-14 13:39:21 +02:00
itchyny 092fef740a Make sure distcheck passes and run dist job on Pull Request 2023-07-13 10:20:04 -05:00
itchyny 481167c8f1 Update jinja2 to fix deprecation warnings on building website (#2711) 2023-07-14 00:06:53 +09:00
itchyny 689a4e660b Fix uri format to follow RFC 3986 (#2157) 2023-07-13 23:23:23 +09:00
itchyny b5c4c3d67d Fix has(nan) on arrays to output false 2023-07-12 09:40:05 -05:00
itchyny 14e5e630ed Revert unexpected changes in decNumber code (ref #2031) 2023-07-11 18:36:36 -05:00
itchyny 4c125c7ca6 Do not remove manpage prebuild file on build failure 2023-07-10 18:47:14 -05:00
itchyny 841445eea7 Build Docker image using pre-built executables (#2686) 2023-07-10 16:15:01 +09:00
itchyny 600e602548 Fix empty regular expression matches (fix #2565) 2023-07-09 12:51:53 -05:00
itchyny cac216a39c Fix manual on paths/1 to use boolean filter for its argument 2023-07-09 10:54:13 -05:00
itchyny d8072564c2 Fix nth/2 to emit empty on index out of range 2023-07-08 23:13:15 -05:00
itchyny e2bc8de8bb Fix the latest manual on string multiplication by zero 2023-07-08 23:10:07 -05:00
itchyny cac3ea3726 Fix string multiplication by 0 (and less than 1) to emit empty string 2023-07-08 22:25:22 -05:00
itchyny 88b45771bd Fix string multiplication with a value between 0.0 and 1.0
This commit fixes a regression of 6306ac8966.
2023-07-08 22:25:22 -05:00
itchyny af57893bc2 Optimize appending deletion path in modify 2023-07-07 20:11:10 -05:00
itchyny 371abc73ba Fix deletion using assigning empty against arrays (fix #2051) 2023-07-07 20:11:10 -05:00
itchyny 0ecededefa Remove deprecated filters: leaf_paths, recurse_down 2023-07-07 10:53:40 -05:00
itchyny 6944d81bc8 Fix dumping large floating numbers (fix #2367) (#2661) 2023-07-06 21:44:17 +09:00
itchyny a881532b29 Fix exit code on JSON parse error (#2654) 2023-07-06 10:01:59 +09:00
itchyny c077b95ba2 Remove outdated CI badges from README.md (#2653) 2023-07-05 07:51:25 +09:00
itchyny 9014c212e8 Release Docker image to GitHub Container Registry (#2652) 2023-07-05 04:33:57 +09:00
itchyny 886a9b18b1 Make 0 divided by 0 results in NaN consistently (#2253) 2023-07-05 04:28:08 +09:00
itchyny 7d424fd52e Fix release workflow tag trigger pattern (#2651) 2023-07-04 16:00:25 +09:00
itchyny 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
itchyny 4dc2a2fb9d Implement scan/2 filter (#1961) 2023-07-04 07:48:29 +09:00
itchyny edb0d88e3b Fix duplicate entry in .gitignore 2023-07-03 23:05:51 +09:00
itchyny 3847ebb699 Create dist and upload on release also disable docs on build (#2648) 2023-07-03 21:05:21 +09:00
itchyny 4b5fcb936f Fix the default search paths and documentation (#2093) 2023-07-03 09:12:22 +09:00
itchyny 5ae04c0f52 Strip debug information from executables (fix #1221) (#2647) 2023-07-03 08:46:35 +09:00
itchyny f88c4e5888 Move an example to the manual and regenerate man.test (#2639) 2023-06-30 07:45:29 +09:00
itchyny 03db5509cb Remove unused function: jv_mem_invalidate, jv_mem_uninit_setup (#2636) 2023-06-28 22:59:41 +09:00
itchyny d829524680 Remove deleted README file from jq.spec (#2637) 2023-06-28 22:37:31 +09:00
itchyny 6d694a4a58 Validate module metadata to be an object (#2357) 2023-06-28 17:59:46 +09:00
itchyny 5dacc6b3a1 Fix bison warnings on incompatibilities with POSIX Yacc (#2634) 2023-06-28 17:56:53 +09:00
itchyny 82d5602230 Fix "writing output failed" error of non ASCII output on Windows (#2633) 2023-06-28 17:54:40 +09:00
itchyny 7c1efd67ff Update oniguruma submodule (June 2023) (#2635) 2023-06-28 17:04:42 +09:00
itchyny 98835eec24 Fix halt_error to print message without prefix in raw mode (fix #1902) (#2632) 2023-06-27 07:33:21 +09:00
itchyny e468eaa396 Fix glibc warning about _BSD_SOURCE and redefined _GNU_SOURCE (fix #1978) (#2631) 2023-06-27 07:25:55 +09:00
itchyny 44c89ad3da Ignore error of outdated manual test when docs disabled (fix #2310) (#2630) 2023-06-27 07:25:24 +09:00
itchyny 73966c80ec Fix number lexer to avoid conflict with object indexing (#2254) 2023-06-27 07:24:49 +09:00
itchyny fac5553b22 Fix overflow exception of the modulo operator (fix #1176) (#2629) 2023-06-27 07:23:41 +09:00
itchyny 6864aa8630 Fix manual section titles, minor typos, and improve inline codes (#2626) 2023-06-22 08:31:38 +09:00
itchyny 9a590427db Improve Download page: drop versions for each package manager (#2619) 2023-06-20 08:23:42 +09:00
itchyny 2e5c3f490c Fix regular expression section on PCRE (fix #2439), also improve example format (#2613) 2023-06-14 07:36:06 +09:00
itchyny 433b79dddf Fix version scripts for some shallow clone situations (fix #1549) (#2608) 2023-06-14 07:33:25 +09:00
itchyny e5414e6828 docs: Fix coding style of Python scripts using YAPF (#2606) 2023-06-08 19:04:19 +09:00