Commit graph

192 commits

Author SHA1 Message Date
Terts Diepraam
b5ba2fc5ca factor: clap 3 2022-01-11 19:16:47 +01:00
Jeffrey Finkelstein
e9fc964a3e factor: return UResult from uumain() function 2021-12-26 16:06:33 -05:00
Roy Ivy III
f20aa49821 maint/CICD ~ (GHA) fix cargo-udeps false positives (add 'ignore' exceptions to sub-crates) 2021-11-19 17:55:02 -06:00
Roy Ivy III
363453f5e4 tests ~ (factor) refactor divisor() to return quickcheck::TestResult
- return standard quickcheck results
- drop `a == 0 && b == 0` from test domain via TestResult::discard()
- avoid divide by zero panics
- ref: #1589
2021-11-13 14:18:23 -06:00
Roy Ivy III
740d8e9bc5 docs/factor ~ (BENCHMARKING.md) fix formatting, returning missing newlines 2021-11-13 11:07:02 -06:00
nicoo
bed45602a7 factor/Cargo.toml: Document feature pending a MinRustV bump 2021-11-10 15:26:36 +01:00
nicoo
32b0178a72 factor: Update to current versions of smallvec
smallvec 1.0 and later wasn't compatible with Rust 1.33 but the
minimum supported Rust version for coreutils moved on.
2021-11-10 15:12:37 +01:00
Sylvestre Ledru
59e9870c56 Prepare version 0.0.8 2021-10-23 19:21:50 +02:00
Sylvestre Ledru
7eaae75bfc add a github action job to identify unused deps 2021-09-15 12:06:50 +02:00
Jan Verbeek
259f18fcab Update message quoting and filename printing 2021-09-07 19:49:01 +02:00
Jan Verbeek
d06c074829 Run clippy on the full workspace
These lints were cluttering up the "problems" tab in my VS
Code. `--workspace` fixes the disparity.
2021-08-24 17:10:16 +02:00
Michael Debertol
252220e9eb refactor/uucore ~ make util_name and execution_phrase functions
Since util_name and execution_phrase no longer rely on features that are
only available to macros, they may as well be plain functions.
2021-08-14 17:55:18 +02:00
Roy Ivy III
c5792c2a0f refactor ~ use util_name!() as clap::app::App name argument for all utils 2021-08-14 13:53:13 +02:00
Michael Debertol
0edc9b01b9 factor: prevent writing incomplete lines
This makes it possible to execute multiple `factor` instances that write
to the same output in parallel, without having them interfere.
2021-08-10 00:14:51 +02:00
Sylvestre Ledru
26a882551b update the dep to uucore_procs 0.0.6 2021-07-11 21:04:11 +02:00
Sylvestre Ledru
1d8a66b7d3 Update to version 0.0.7 2021-07-11 18:04:56 +02:00
Michael Debertol
2ebca384c6 all utils: enable wrap_help
This makes clap wrap the help text according to the terminal width,
which improves readability for terminal widths < 120 chars,
because clap defaults to a width of 120 chars without this feature.
2021-06-27 16:17:10 +02:00
Michael Debertol
0531153fa6 uutils: move clap::App creation to separate functions 2021-06-25 21:23:45 +02:00
Sylvestre Ledru
d8c06dd6bb use clap::crate_version macro instead of the env variable 2021-06-02 19:00:19 +02:00
Roy Ivy III
1ca44fbbc3 docs/factor ~ fix markdownlint complaints 2021-05-31 08:23:58 -05:00
Roy Ivy III
1a37d502d1 refactor/factor ~ polish spelling (comments, names, and exceptions) 2021-05-31 08:11:32 -05:00
Roy Ivy III
9c0c8eb59f change ~ remove 'main.rs' spell-checker exceptions 2021-05-31 08:11:31 -05:00
Gilad Naaman
17b0939dee Moved factor to use clap
Issue: https://github.com/uutils/coreutils/issues/2121
2021-05-29 15:11:27 +02:00
Jan Scheer
3aeccfd802 fix a lot of clippy warnings 2021-05-29 15:11:22 +02:00
nicoo
a0a103b15e factor::table::chunked: Add test (equivalent to the single-number version) 2021-05-20 17:01:33 +02:00
nicoo
998b3c11d3 factor: Make random Factors instance generatable for tests 2021-05-20 17:00:49 +02:00
nicoo
00322b986b factor: Move benchmarks out-of-crate 2021-05-17 19:43:38 +02:00
nicoo
1cd001f529 factor::benches::table: Match BenchmarkId w/ criterion's conventions
See https://bheisler.github.io/criterion.rs/book/user_guide/comparing_functions.html
2021-05-17 19:43:38 +02:00
nicoo
7c649bc74e factor::benches: Add check against ASLR 2021-05-17 19:43:38 +02:00
nicoo
ddfcd2eb14 factor::benchmarking: Add wishlist / planned work 2021-05-17 19:43:38 +02:00
nicoo
1d75f09743 factor::benchmarking(doc): Add guidance on writing µbenches 2021-05-17 19:43:38 +02:00
nicoo
e9f8194266 factor::benchmarking(doc): Add guidance on running µbenches 2021-05-17 19:43:38 +02:00
nicoo
ae15bf16a8 factor::benches::table: Report throughput (in numbers/s) 2021-05-17 19:43:38 +02:00
nicoo
12efaa6add factor: Add BENCHMARKING.md 2021-05-17 19:43:38 +02:00
nicoo
7c287542c7 factor::table: Fixup microbenchmark
Previous version would perform an amount of work proportional to `CHUNK_SIZE`,
so this wasn't a valid way to benchmark at multiple values of that constant.

The `TryInto` implementation for `&mut [T]` to `&mut [T; N]` relies on `const`
generics, and is available in (stable) Rust v1.51 and later.
2021-05-17 19:43:38 +02:00
nicoo
1fd5f9da25 factor::table::factor_chunk: Turn loop inside-out
This keeps the traversal of `P_INVS_U64` (a large table) to a single pass
in-order, rather than `CHUNK_SIZE` passes.
2021-05-17 19:43:38 +02:00
nicoo
cd047425aa factor::table: Add chunked implementation and microbenchmarks
The factor_chunk implementation is a strawman, but getting it in place allows us
to set up the microbenchmarking etc.
2021-05-17 19:43:38 +02:00
nicoo
c68c83c6dd factor::table: Take mutable refs
This will be easier to adapt to working with multiple numbers to process at once.
2021-05-17 19:43:38 +02:00
Jan Scheer
4ac75898c3 fix clippy warnings 2021-05-10 15:48:32 +02:00
Sylvestre Ledru
e723b8db43 factor: unneeded statement 2021-05-02 09:35:59 +02:00
Sylvestre Ledru
d2913f8080 rustfmt the recent change 2021-05-01 13:12:10 +02:00
nicoo
b89978a4c9
factor: Add annotations for coz, the causal profiler (#2142)
* factor: Add annotations for coz, the causal profiler

* Update Cargo.lock

Generated with `nix-shell -p rustup --run 'cargo +1.40.0 update'`
2021-04-29 15:56:56 +02:00
Christopher Regali
368e984fac
Change unchecked unwrapping to unwrap_or_default for Args-trait (#1845) (#1852)
* Change unchecked unwrapping to unwrap_or_default for argument parsing (resolving #1845)

* Added unit-testing for the collect_str function on invalid utf8 OsStrs

* Added a warning-message for identification purpose to the collect_str method.

* - Add removal of wrongly encoded empty strings to basename
- Add testing of broken encoding to basename
- Changed UCommand to use collect_str in args method to allow for integration testing of that method
- Change UCommand to use unwarp_or_default in arg method to match the behaviour of collect_str

* Trying out a new pattern for convert_str for getting a feeling of how the API feels with more control

* Adding convenience API for compact calls

* Add new API to everywhere, fix test for basename

* Added unit-testing for the conversion options

* Added unit-testing for the conversion options for windows

* fixed compilation and some merge hiccups

* Remove windows tests in order to make merge request build

* Fix formatting to match rustfmt for the merged file

* Improve documentation of the collect_str method and the unit-tests

* Fix compilation problems with test

Co-authored-by: Christopher Regali <chris.vdop@gmail.com>
Co-authored-by: Sylvestre Ledru <sylvestre@debian.org>
2021-04-25 23:28:42 +02:00
Sylvestre Ledru
f37284129e new release 0.0.6 to address the cat issue 2021-04-03 16:06:58 +02:00
Sylvestre Ledru
ac031dffa4 new release 0.0.5 2021-04-03 10:30:07 +02:00
Sylvestre Ledru
4d7ad77433 rustfmt the recent change 2021-04-02 23:31:22 +02:00
est31
14a49edd1c
Use Iterator::copied() in sieve.rs (#1774) 2021-04-02 23:30:07 +02:00
nicoo
8b9ac0c7c3
Revert #1571 “perf/factor ~ deduplicate divisors” (#1842)
It was a draft PR, not ready for merging, and its premature inclusion
caused repeated issues, see 368f47381b & friends.

Close #1841.

This reverts commits 3743a3e1e7,
                     ce218e01b6, and
                     b7b0c76b8e.
2021-03-20 11:46:58 +01:00
nicoo
955fa74a42
factor::tests: Check that powers of known-factorization numbers are factored correctly (#1831)
* factor::tests::recombines_factors: Minor refactor (skip useless bool)

* factor::tests: Check factorizations of powers of factored numbers

* factor::Factors: Add debug assertions to (Factor ^ Exponent)

* factor::tests: Drop obsoleted tests

`factor_correctly_recombines_prior_test_failures` was replaced with
`factor_2044854919485649` as this was the only test not subsumed.

* factor::tests::2044854919485649: Check the expected factorisation
2021-03-17 13:58:53 +01:00
Sylvestre Ledru
6ad8528b99 update of the uucore dep to 0.0.7 2021-03-07 11:29:38 +01:00