Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement pr (resurrection of the resurrected PR) #2300

Merged
merged 64 commits into from May 31, 2021

Conversation

tertsdiepraam
Copy link
Member

A re-resurrection of #1918 by @MaxSem and @tilakpatidar. Let's get this merged after 2.5 years :)

I've brought it up to date with recent changes, fixed clippy lints and cleaned some of the code up. I think we can create a good first issue to move it to clap once this is merged.

pr: Add -h to print custom header instead of file name

pr: Add -n to print line numbers
pr: code refactoring for references
…umbers

pr: Add -l option set number of lines

pr: Refactor opts
pr: Add -F to print line feed character for page separator
pr: Fix number of lines printed per page

pr: Fix first short page getting skipped due to page range
pr: Remove parameter header from build_options

pr: Remove unnecessary get_input_type
pr: Add test for -h option

pr: Add test for -d option
pr: Fix long name for -n

pr: Add -N first line number option

pr: Add -n[char][width] support
pr: Fix page ranges
pr: Add test for -l option

pr: Add test for -r suppress error option
pr: Print fixed padded string for each column

pr: Fix display length vs str length due to tabs
@tertsdiepraam tertsdiepraam marked this pull request as draft May 29, 2021 19:00
@tertsdiepraam
Copy link
Member Author

Marking as draft because code coverage should be improved before merging.

@sylvestre
Copy link
Sponsor Contributor

Expected: the gnu tests aren't running correctly but not a big deal:


2021-05-29T18:48:23.8713639Z 
2021-05-29T18:48:23.8714036Z FAIL: tests/pr/pr-tests
2021-05-29T18:48:23.8714334Z =======================
2021-05-29T18:48:23.8714516Z 
2021-05-29T18:48:23.8714753Z 1b...
2021-05-29T18:48:23.8715137Z pr: test 1b failed: exit status mismatch:  expected 0, got 1
2021-05-29T18:48:23.8715532Z 1b.r...
2021-05-29T18:48:23.8715925Z pr: test 1b.r failed: exit status mismatch:  expected 0, got 1
2021-05-29T18:48:23.8716328Z 1b.p...
[...]

@tertsdiepraam
Copy link
Member Author

It seemed to be missing in the GNUMakefile, which should be fixed now, so hopefully it works now.

@tertsdiepraam tertsdiepraam marked this pull request as ready for review May 31, 2021 13:23
@tertsdiepraam
Copy link
Member Author

tertsdiepraam commented May 31, 2021

Test coverage is not going to be perfect, but a lot will be fixed when we move this to clap. Most options are tested. I tried adding some tests, but got slightly different results than GNU, so it might be better to just open issues instead of making incorrect tests.

@sylvestre
Copy link
Sponsor Contributor

Test coverage is rarely (never?) perfect ;)

@sylvestre
Copy link
Sponsor Contributor

With 64 commits, I think it is time to land it :)

@sylvestre sylvestre merged commit badf7aa into uutils:master May 31, 2021
@tertsdiepraam tertsdiepraam deleted the pr branch June 2, 2021 15:16
flip1995 added a commit to flip1995/coreutils that referenced this pull request Jun 4, 2021
In PR uutils#2300 an old commit got merged putting back utilities that were
already implemented into "To Do". This commit reverts this. In addition
it moves `numfmt` to Semi-Done and sorts the Semi-Done column
alphabetically.

This should now be the up-to-date list of utilities. There are 96
utilities in Done or Semi-Done and `ls -1 src/uu | wc -l` also outputs
96.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants