aboutsummaryrefslogtreecommitdiff

Tasks

TODO Include one or more C linters in dev-check target {#td-80513275-dbb4-adfd-b029-7403cd5fb7d3}

  • TODO in 2021-10-03

Initial reference: https://github.com/caramelomartins/awesome-linters

TODO Add explanation of directory structure to README.md {#task-a5c8dd18-b180-2731-601a-e26f137a2740}

  • TODO in 2021-08-20

TODO Implement behaviour of test_pick_inexisting_value {#task-06c8ef1b-15ed-5932-3391-8c02ff759e7a}

  • TODO in 2021-06-28

TODO Add test case for unsorted STDIN {#task-f5a3d036-f451-f469-56f6-73274162df8e}

  • TODO in 2021-06-28

DONE test_mkdir_p() is generating randon directories in $PWD instead of /tmp {#task-bd165b74-c559-48ee-1d29-eaa906aa0393}

  • DONE in 2021-06-28

Done in 17a6c7bda9ec97c03153ebfabf3a99c9f66dc7f5. - TODO in 2021-06-27

TODO assert-manpages.sh: ensure that $(manpages) contain everything from $(manpages.en) {#task-20f96d7d-2fd8-7a5f-e861-ded565c3b408}

  • TODO in 2021-06-27

TODO malloc vs calloc {#task-b3261473-9d12-9df4-cbfe-c4017ffed709}

  • TODO in 2021-06-27

TODO Document EXIT_STATUS in manpage for remembering.1 {#task-013534fe-8839-9de1-ec4a-9d63980fc096}

  • TODO in 2021-06-27

TODO Use strtok(3) over manually separating strings {#task-44843686-1328-521a-8281-60dbb05f2d3f}

  • TODO in 2021-06-22

TODO Translate usage/help and manpages {#task-47d98f68-0dec-f9b2-4d5c-bfe822411477}

  • TODO in 2021-06-16

Started at a79ced6f0925526ab41ecbdb9e6e8cac86f8ea75.

DONE Also use inline monospaced font in manpages {#task-f1b27444-f824-353e-6e89-63974dcce550}

  • DONE in 2021-06-14

TIL: use \fC (C for "constant-width") for inlined monospace text, as in: roman text with some \fCcode\fR and more roman text.

Done in 4c4d45bf92b00756739e5e83372c6aa52c83bc09. - TODO in 2021-06-14

DONE Document requirement on STDIN needing to be sorted {#task-ffd35082-5af0-814e-4270-9305f57aa416}

  • DONE in 2021-06-13

I've added only a small sentence, enough to say that it is at least written somewhere.

Done in 22abb6b88f1a6aa8ba9933d220f6bf3710d0a149. - TODO in 2021-06-13

DONE Use inline markings over single line "requests" on troff {#task-cb17c58a-bb00-d554-8ed8-1b53eb12b70d}

  • DONE in 2021-06-12

Done in de7838f0568e0d437822407d46d95e0269a81912. - TODO in 2021-06-12

DONE Use monospace font inside .EX/.EE tags {#task-fe406a67-e406-41a7-df4a-1e006dc636e9}

  • DONE in 2021-06-14

Done in 231dbf7038efd6a5289444108b4ea36962fe4743.

Update (2021-06-14):

Actually the change made in doc/remembering.* was done, but I was using pandoc to visualize it and not groff, and I forgot to update the Makefile accordingly.

Now this was done in fd96f74ebe7032172dbae0056dc399f4bf4a6842. - TODO in 2021-06-07

DONE What about UTF-8? {#task-19f9d131-696a-3417-c052-6312f04a33af}

  • DONE in 2021-06-06

A test_utf8_commands was added to verify the behaviour. Apparently, the current sh code already passes that. Since I'm not doing any significant string manipulation other than splitting by the : separator, it is reasonable to expect it already to work.

This may also be true for the C implementation: by not really manipulating the string, everything after the : separator can be its own thing, and not be handled by remembering at all. The current code does not really implement that, as test/*.sh isn't even run against it. But at least the test is already in place so that it prevents regressions from the reimplementation.

Done in 9a9ec634d560b458b216bd1c2a7033c0b7d78339. - TODO in 2021-06-06


Does the current sh implementation handle it correctly? What about the C implementation?

It would be good to have a test stressing that.

CANCELLED Use POSIX $(CFLAGS) {#task-4686d9a5-3514-e7f2-25de-b3cf66199124}

  • CANCELLED in 2021-06-06

I couldn't actually get the flags to work before claiming it to be DONE.

Instead of just testing on the machines I have at hand right now, it would be much better to have an extensive stress test of portability, compatibility and behaviour across multiple POSIX systems.

Having standardify would definitely address this.

Cancelled in 32c4ad7eaffa7cac6ab2ea784e3bf60a6dfdaff8. - DONE in 2021-06-06

  • -std=c99 is interpreted as -s + td=c99, and a -t flag doesn't exist. Since I'm calling the c99 command, it implies the C99 C standard, and the consumer should make sure of that.
  • -W* doesn't exist, neither for -Wall nor for -Wl,-rpath,$$LIBRARY_PATH;
  • -fPIC doesn't exist;
  • -O3 is optional and "may be supported". I picked -O1 which is defined by the specification, without meaning of which optimizations will be performed;

I can also have all of this overriden in development with make -e, and switch compilers and flags for different errors, warnings, etc.

Consumers can do the same with make CFLAGS='...' and similar strategies.

Done in 107d9fa6012a9312bcee9da0bf86e6fa7a34cfef. - TODO in 2021-06-06


The current values for $(CFLAGS) in the Makefile work on GCC, Clang, TinyCC, but not on POSIX c99.

TODO Can't test getopt {#task-2c3021db-7ede-c835-691a-af240c11f883}

  • TODO in 2021-03-10

For some reason, getopt.3 doesn't read any of the options provided in the test.

Right now the code is disabled with an #ifdef DISABLE guard.

DONE Add --version flag {#task-b001c31a-5053-d317-d8d3-c9647aa34067}

  • DONE In 2021-03-10

Done in f93524f531b9da19dc8f4d46dd4977fbbdc80f58. - TODO in 2021-03-09

TODO Add AddressSanitizer and fuzzer tests {#task-8af5055c-d1e1-beba-128c-4cabc40e8057}

  • TODO in 2021-03-08

Rich discussion on AddressSanitizer and similar tools: https://news.ycombinator.com/item?id=26713037.

Relevant tools: - scan-build - sanitizers - GCC analyzer

DONE Add $HOME and $XDG_DATA_HOME sh test {#task-9291a8c1-4ac3-409d-b490-872b29a719cc}

  • DONE in 2021-03-06

Done in 5d999a92d6e86fd18c9bcd459e4ebf4fb356bfd5. - TODO in 2021-03-03

CANCELLED Rename PROFILE for LABEL? {#task-e3153cfb-b77a-4528-afa0-43b90f267d3d}

  • CANCELLED in 2021-03-06

Nope.

"Profile" is descriptive enough, and, more importantly, it doesn't break anything. - TODO in 2021-01-31


I feel a more descriptive name could be given.

Current candidates are: - tag - label - name

TODO Make test_really_long_list runnable {#task-c1129666-b373-4b9d-8e10-927689048b05}

  • TODO in 2021-01-31

Now test_really_long_list is commented.

Benchmark with yeganesh after this is done.

CANCELLED Improve speed even further {#task-05c7f068-e935-457f-89ea-1f38227e7779}

  • CANCELLED in 2021-03-06

#task-c1129666-b373-4b9d-8e10-927689048b05 supersedes this. And even better: it has runnable code that can be executed for verifying the performance improvement. - TODO in 2021-01-29


Handle 10k+ lists with ease.

CANCELLED Add completion script {#task-daa4a3e7-bcb4-4fe1-a0df-e73c7d17e43c}

  • CANCELLED in 2021-03-06

Since there are only 2 relevant options (-p and -c) and descriptive manpages, the cost/benefit for adding code for handling completion isn't worth it. Worse is better. - TODO in 2021-01-29


How to support multiple shells without duplicating the code?

The major one is Bash, but also consider zsh and fish. Also tcsh and oilsh.

DONE Is tac POSIX {#task-98478c0f-97ac-4667-acdc-9373e2841de9}

  • DONE in 2021-01-26
  • TODO in 2021-01-26

If it isn't, what to replace it with?

With sed.

DONE Add CHANGELOG.md for 0.1.0 {#task-f4258dc4-22aa-408d-a0b1-953f654e0623}

  • DONE in 2021-01-26
  • TODO in 2021-01-24

CANCELLED How to preserve to sort order from STDIN {#task-b2c26218-5f21-4efd-afbd-ff6af57a358a}

  • CANCELLED in 2021-01-24

Don't preserve.

The "blank" order, when remembering doesn't have any date on the input (usually a new profile), is to sort the input data, and it should be this way. Otherwise the sort order that comes from STDIN would have to be included when showing ranked results, and use the STDIN order as a tie breaker.

Not only this would make the code much more complex, but also understanding the behaviour of the program harder. - TODO in 2021-01-24


Keeping the sort order from STDIN, I would have to find a way to merge STDIN with the existing profile.

DONE Make sure to forward status code given by the provided command {#task-47589312-0a4d-46ac-9f13-45309471efeb}

  • DONE in 2021-01-24

Done in commit 6f5e467c6bb3f0369e4220be20ab1461cd9334ce. - TODO in 2021-01-21

CANCELLED Exclude ponctuation from troff markup {#task-03d0e24c-4baf-404f-ac8a-f8d972ec622e}

  • CANCELLED in 2021-01-04

Changed in commit 6748830b5944211104061c6af15612ec270ab5a1. - TODO in 2021-01-21


Things like:

A phrase with the last word
.B bold.

The final period is marked as bold, too.

DONE Add -h and --help flags {#task-8593b78a-a5ac-4b6c-b9cf-74c021d4a8e5}

  • DONE in 2021-01-24

Done in commit b0f64583bf02f84cadcfad9b610d9c02ec6c4ec2. - TODO in 2021-01-21

DONE Optimize for large lists {#task-fec292ff-b9de-4d6c-b156-a9adc4771f35}

  • DONE in 2021-01-26

Instead of using while read VAR < $FILE, and looping through each record, the $MERGED and $FILTERED files are built differently.

Building the $MERGED file exploits the fact that sort -u -k2,2 picks the first entry it sees, regardless of what is in column 1, or other columns. With that, we feed the reversed (with tac) list to it, and $MERGED is built in a single pass of sort.

Building the $FILTERED file is now done with a simple AWK script, that performs much better that a while read VAR < $FILE loop.

Done in commit 000b74b1140f2ac41cb5d00a9070db735abdc9c4. - TODO in 2021-01-21

DONE Add tests {#task-146fab37-e53b-489e-95d0-3fcdd4c3eaef}

  • DONE in 2021-01-24

Finished in commit ee6bc4f2ce6da48f25a29931a178159e5801b5d9. - TODO in 2021-01-21


On plain POSIX sh.

Bugs

Improvements

TODO Respond to UNIX signals {#improvement-971e21e1-1083-7507-2379-8e3127a8e359}

  • TODO in 2021-06-13

TODO Work on portability {#improvement-f7317d52-012d-7f94-e699-aec7c84329b0}

  • TODO in 2021-06-13

Resources on writing portable C code:

TODO Learn about secure programming in C {#improvement-8dfd18cf-2c34-ee29-e6cd-53d300687789}

  • TODO in 2021-06-13

The best reference by far I've found to learn about secure programming in C is the SEI CERT C Coding Standard.

There's also MISRA C but it feels like very corp.

Questions

TODO Use more const in the implementation? {#question-9ad11485-c244-bf17-f83b-b627db09fab4}

  • TODO in 2021-06-15

Resources

Scratch

add why, etc. manpages add -X option, that deletes from the profile what isn't in STDIN FIXME markers manpage footers translations exercise dist.sh repo.sh check spelling.sh check buffer output of tests/*.sh files