Commit graph

96 commits

Author SHA1 Message Date
John Kerl
eb972e19eb
Use GOCC fork for performance improvement (#1934)
* Use GOCC fork for performance improvement

* fix versions
2026-01-10 16:48:53 -05:00
John Kerl
b8db798a2f
Miller 6.16.0 (#1930)
* Miller 6.16.0

* make dev
2026-01-02 13:57:59 -05:00
John Kerl
3b9f169162
Support -o jsonl as well as --ojsonl (#1879)
* `mlr sort -b` feature

* mlr regtest -p test/cases/cli-help && make dev

* Support `-o jsonl` as well as `--ojsonl`
2025-09-02 16:47:19 -04:00
Andrea Borruso
120e977c1e
Update subs.go (#1868)
If I read “Convert all field names,” I think the verb acts on the field names. I think it would be better to write “Convert all fields.”
2025-08-20 10:11:34 -07:00
John Kerl
3c2d4b22d2
Miller 6.15.0-dev (#1862)
* 6.15.0-dev

* make dev
2025-08-15 19:55:46 -04:00
John Kerl
d2925aafe5 error-handling in the CSV-reader's constructor 2025-08-15 19:52:37 -04:00
John Kerl
4d83e88ff6 Note that comment prefix for CSV must be single-character 2025-08-15 19:45:18 -04:00
John Kerl
4ebef873d2
Miller 6.15.0 (#1860)
* miller 6.15.0

* make dev
2025-08-14 18:00:22 -04:00
John Kerl
06e16ea3ee
Don't parse CSV comments (#1859)
* `mlr sort -b` feature

* mlr regtest -p test/cases/cli-help && make dev

* Don't parse CSV comments

* Add tests for PR 1346

* Add tests for PR 1787

* Add test CSV files
2025-08-13 18:07:32 -04:00
John Kerl
19e72f9dac
Preserve file mods on mlr -I (#1849)
* extract a helper function

* Preserve file mode on mlr -I
2025-08-05 18:11:27 -05:00
John Kerl
9445046bfe
Force decimal formatting for ints on JSON output (#1840)
* Force decimal formatting for ints on JSON output

* update a test case
2025-07-20 17:42:37 -04:00
John Kerl
fccdf215e6
DKVP --incr-key option (#1839)
* Code support for --incr-key

* Add source code for online help for new flag

* Run `make dev`
2025-07-20 17:05:24 -04:00
John Kerl
e7fe363d9a
mlr sort -b feature (#1833)
* `mlr sort -b` feature

* mlr regtest -p test/cases/cli-help && make dev
2025-07-11 12:41:04 -04:00
John Kerl
0ba6710a79 Update main version to 6.14.0-dev 2025-07-04 15:10:26 -04:00
John Kerl
7a6958926d
Miller 6.14.0 (#1828) 2025-07-04 13:55:56 -04:00
John Kerl
99a98b0dc7
Add -c, -t, -j to doc matrix in PR 1824 (#1826)
* Add `-c`, `-t`, `-j` to doc matrix in PR 1824

* Run `make dev`
2025-07-03 19:23:38 -04:00
Balki
d6cd981c87
Add Keystroke savers for same format (#1824) 2025-07-03 19:01:17 -04:00
Balki
e67bdef98e
cut: Consider -o flag even when using regexes with -r (#1823)
* cut: Consider `-o` flag even when using regexes with `-r`

* update doc for cut -r flag
2025-07-03 18:54:09 -04:00
John Kerl
d30501a69b
Argument parsing is different in mlr -s scripts (#1817) 2025-06-13 13:54:34 -04:00
John Kerl
ea242a242a
Docs for new surv verb (#1807) 2025-05-15 19:41:58 -04:00
Christian G. Warden
df73ad8ec0
Add surv Verb to Estimate a Survival Curve (#1788)
Add a surv verb to estimate a survival curve using Kaplan-Meier.  It
requires duration and status (event or censored) columns, and outputs
each distinct duration and corresponding probability of survival.
2025-05-15 18:17:08 -04:00
John Kerl
ca7d47454d
Improve help message on non-existent verb (#1798) 2025-05-05 09:33:03 -04:00
John Kerl
34bc8a1c3d
Fix print within begin{}/end{} (#1795)
* codemod per se

* unit-test coverage

* lint
2025-05-01 17:18:17 -04:00
John Kerl
100166532c
Fix joinv with "" separator (#1794)
* codemod per se

* unit-test coverage
2025-05-01 17:08:55 -04:00
John Kerl
9963df4090
Switch to generics (#1763)
* gradually replace list.List with slices

* gradually replace list.List with slices

* more

* more

* more
2025-03-05 08:19:15 -05:00
Michel Lind
bd2497a285
Fix non-constant format string errors with Go 1.24 (#1745)
Use `errors.New` instead of `fmt.Errorf` and `fmt.Fprint` instead of
`fmt.Fprintf` if a non-constant string is used

Signed-off-by: Michel Lind <salimma@fedoraproject.org>
2025-02-05 08:32:23 -05:00
John Kerl
cc1cd954ea
Fix unflatten with field names like . .x or x..y (#1735)
* Fix unflatten with field name like `.` `.x` or `x..y`

* docs & test data
2024-12-23 12:27:08 -05:00
John Kerl
9f77bbe096
Add help strings for -a/-r in sub/gsub/ssub (#1721)
* Help strings for `-a`/`-r` in `sub`/`gsub`/`ssub`

* `mlr regtest -p test/cases/cli-help` to update expected outputs

* artifacts from `make dev`
2024-11-23 10:13:36 -05:00
John Kerl
5424e753a4
Static-check fixes from @lespea #1657, batch 8/n (#1710) 2024-10-27 12:16:49 -04:00
John Kerl
41649bf4f9
Static-check fixes from @lespea #1657, batch 7/n (#1709) 2024-10-27 12:11:28 -04:00
John Kerl
b4ff26a7d0
Static-check fixes from @lespea #1657, batch 6/n (#1708)
* Static-check fixes from @lespea #1657, batch 2/n

* Static-check fixes from @lespea #1657, batch 3/n

* Static-check fixes from @lespea #1657, batch 4/n

* Static-check fixes from @lespea #1657, batch 5/n

* Static-check fixes from @lespea #1657, batch 6/n
2024-10-27 12:06:17 -04:00
John Kerl
02bd5344b9
Static-check fixes from @lespea #1657, batch 5/n (#1707)
* Static-check fixes from @lespea #1657, batch 2/n

* Static-check fixes from @lespea #1657, batch 3/n

* Static-check fixes from @lespea #1657, batch 4/n

* Static-check fixes from @lespea #1657, batch 5/n
2024-10-27 12:05:48 -04:00
John Kerl
8c791f5466
Static-check fixes from @lespea #1657, batch 4/n (#1706)
* Static-check fixes from @lespea #1657, batch 2/n

* Static-check fixes from @lespea #1657, batch 3/n

* Static-check fixes from @lespea #1657, batch 4/n
2024-10-27 12:00:25 -04:00
John Kerl
04a9b9decd
Static-check fixes from @lespea #1657, batch 3/n (#1705)
* Static-check fixes from @lespea #1657, batch 2/n

* Static-check fixes from @lespea #1657, batch 3/n
2024-10-27 11:55:38 -04:00
John Kerl
cc8a3c4b4e
Static-check fixes from @lespea #1657, batch 2/n (#1704) 2024-10-27 11:50:15 -04:00
John Kerl
047cb4bc28
Static-check fixes from @lespea #1657, batch 1/n (#1703) 2024-10-27 11:42:43 -04:00
John Kerl
05aa16cfcf
Join docs wrong link (#1695)
* Fix join-docs link in online help

* run `make dev` and commit the artifacts
2024-10-17 09:11:03 -04:00
Stephen Kitt
7a0320fc27
Typo fix: programmatically (#1679)
Signed-off-by: Stephen Kitt <steve@sk2.org>
2024-10-06 17:30:12 -04:00
John Kerl
a0d65c3035 6.13.0-dev 2024-10-05 10:47:43 -04:00
John Kerl
c66094a184 miller 6.13.0 2024-10-05 09:32:15 -04:00
John Kerl
31d6164181
Fix 1668 error-source (#1672)
* Fix 1668 error-source

* run `make dev`
2024-10-05 09:25:47 -04:00
John Kerl
4a2f349289
Update source material for #1665 (#1666)
* Fix source info for #1665

* run `make dev`
2024-10-02 08:46:27 -04:00
Adam Lesperance
085e831668
The package version must match the major tag version (#1654)
* Update package version

* Update makefile targets

* Update readme packages

* Remaining old packages via rg/sd
2024-09-20 12:10:11 -04:00
Balki
d1767e7c18
Fix local time when TZ is not set (#1649)
Do not override time.Local when TZ is empty or unset. It is already set correctly by go standard library.
2024-09-17 10:58:09 -04:00
John Kerl
f33c0b2cd6
Error in splita/splitax when field contains a single non-string value (#1629) 2024-08-25 19:00:24 -04:00
John Kerl
73e2117b43
Misc. codespell findings (#1628) 2024-08-25 17:40:57 -04:00
John Kerl
1015f18e7b
Fix prepipe handling when filenames have whitespace (#1627)
* Fix prepipe handling when filenames have whitespace

* unit-test data

* Windows-only unit-test item

* Fix Windows fails; neaten
2024-08-25 17:40:07 -04:00
John Kerl
16a898cff4
Fix binary data in JSON output (#1626) 2024-08-25 15:00:51 -04:00
John Kerl
6bee4ebbf2
RS aliases for ASCII top-of-table control characters are misnamed (#1620)
* Fix misnames of ASCII control-character aliases

* artifacts from `make dev`
2024-08-16 10:25:25 -04:00
Eng Zer Jun
3966a6a0a1
lib/regex: use string version of regexp methods to reduce allocs (#1614)
Both `(*Regexp).Match` and `(*Regexp).FindAllSubmatchIndex` have
string-based equivalents: `(*Regexp).MatchString` and
`(*Regexp).FindAllStringSubmatchIndex`. We should use the string version
to avoid unnecessary `[]byte` conversions.

Benchmark:

var regex = regexp.MustCompile("foo.*")

func BenchmarkMatch(b *testing.B) {
	for i := 0; i < b.N; i++ {
		if match := regex.Match([]byte("foo bar baz")); !match {
			b.Fail()
		}
	}
}

func BenchmarkMatchString(b *testing.B) {
	for i := 0; i < b.N; i++ {
		if match := regex.MatchString("foo bar baz"); !match {
			b.Fail()
		}
	}
}

func BenchmarkFindAllSubmatchIndex(b *testing.B) {
	for i := 0; i < b.N; i++ {
		if match := regex.FindAllSubmatchIndex([]byte("foo bar baz"), -1); len(match) == 0 {
			b.Fail()
		}
	}
}

func BenchmarkFindAllStringSubmatchIndex(b *testing.B) {
	for i := 0; i < b.N; i++ {
		if match := regex.FindAllStringSubmatchIndex("foo bar baz", -1); len(match) == 0 {
			b.Fail()
		}
	}
}

goos: linux
goarch: amd64
pkg: github.com/johnkerl/miller/pkg/lib
cpu: AMD Ryzen 7 PRO 4750U with Radeon Graphics
BenchmarkMatch-16                         	 2198350	       517.5 ns/op	      16 B/op	       1 allocs/op
BenchmarkMatchString-16                   	 3143605	       371.5 ns/op	       0 B/op	       0 allocs/op
BenchmarkFindAllSubmatchIndex-16          	  921711	      1199 ns/op	     273 B/op	       3 allocs/op
BenchmarkFindAllStringSubmatchIndex-16    	 1212321	       981.0 ns/op	     257 B/op	       2 allocs/op
PASS
coverage: 0.0% of statements
ok  	github.com/johnkerl/miller/pkg/lib	6.576s

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2024-08-09 13:09:53 -04:00