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

Update from upstream #1

Merged
merged 13 commits into from
Apr 5, 2020
Merged

Update from upstream #1

merged 13 commits into from
Apr 5, 2020

Conversation

luilver
Copy link
Owner

@luilver luilver commented Apr 5, 2020

Before submitting a pull request, please make sure the following is done:

  • Fork the repository and create your branch from master.
  • If you've added code that should be tested, add tests!
  • Ensure the test suite passes.
  • Format your code with ShellCheck.
  • Include a human-readable description of what the pull request is trying to accomplish.
  • Steps for the reviewer(s) on how they can manually QA the changes.
  • Have a fixes #XX reference to the issue that this pull request fixes.

karbassi and others added 13 commits March 27, 2020 19:44
* Create GitHub Action
* Remove travis yml to move to github actions.
* Update CI badge in README
- In macOS 10.15, the `date` command adds a "-R" flag. This can be seen in the default error display. Since the flags have changed, the grep command to find which version of macOS date binary we have. Because of this change, we need to do our own check for macOS 10.15.

- Remove windows from the github actions as this tool is not for Windows, currently.
Co-authored-by: Benoit Sagols <benoit.sagols@gmail.com>
* Handle missing EOL in todo.txt

This can happen easily with certain editors (such as Mousepad) that do not automatically add a newline character at the end of a file.
In _addto(), ensure a trailing newline via sed (taken from https://unix.stackexchange.com/a/31955/18876).

Fixes #294

* Tests: Add basic coverage of move

* Handle missing EOL in todo.txt for move, too

This can happen easily with certain editors (such as Mousepad) that do not automatically add a newline character at the end of a file.

* Refactoring: Extract fixMissingEndOfLine()

* FIX: Compatibility: sed \+ multi not supported on MacOS

Use the POSIX \{1,\} instead.

Co-authored-by: Ali Karbassi <ali@karbassi.com>
…ations array and move the comments closer (#273)

There's too much distance between the comments that describe the various transformations that are done on the referenced task, and the corresponding sed expressions.
By using a local Bash array, we can collect the arguments and have the comments close by.

Co-authored-by: Ali Karbassi <ali@karbassi.com>
* add highlighting of dates, item numbers, and metadata

* add test for highlighting of dates, item numbers, and metadata

Co-authored-by: Ali Karbassi <ali@karbassi.com>
…259)

* Fix the Makefile to work with the install instructions in the README

* Put back DEST_DIR

* Add simple ifdef checks to see if the user has set custom dirs via the commandline

* Update README to match Makefile
…xt) (#289)

* Set default files name

* Add test for minimal config file
…actions (#270)

* Refactoring: Use regular expression match instead of case globbing for actions taking a SRC argument

Making it consistent with the test for MOVE_COMMAND_PATTERN, and allowing to extend the pattern with custom actions in the future.

* Refactoring: Move the anchoring and grouping out of MOVE_COMMAND_PATTERN

So that additional (custom) add-on actions can be configured in the future.

* ENH: Enable file completion for add-on actions via _todo_file{1,2,3}_actions

Allowing completion of todo files directly after the add-on action (1), with one (2) / two (3) arguments in between. This should handle most cases.

In order to configure the add-on completion, the corresponding configuration variable has to be defined in the user's shell (e.g. via ~/.bashrc):
_todo_file1_actions='myaction|anotheraction'
…and @context (#271)

* ENH: Allow to customize what can be before / inside / after +project and @context

I noticed that todo.sh mistakenly picks up some random stuff as projects and contexts. The todo.txt specification is very lenient in what makes those (allowing any length of non-whitespace characters), but in practice, every user has its own idea of the set of used words. This change allows (expert) users to tweak the pattern (via TODOTXT_SIGIL_VALID_PATTERN), to be able to reduce the amount of "false positives" that listproj and listcon show.
Additionally, there's a (mainly unspecified) extension mechanism in the form of key:value, which often is used to implement custom "markers", like w:something to make a task blocked and waiting for "something". It would be nice to be able to refer to @contexts (and maybe also +projects), but the default syntax (which requires whitespace around those) doesn't allow it, and these context then don't show up in searches, which is unfortunate. The added TODOTXT_SIGIL_BEFORE_PATTERN and TODOTXT_SIGIL_AFTER_PATTERN allow to tweak the syntax to accommodate this.
The implementation just exchanges grep with a corresponding sed pipeline step, which shouldn't negatively affect the performance at all (as sed is one of the main commands used thoughout the script), but which allows for the additional matching flexibility.

* FIX: Compatibility: sed \? multi not supported on MacOS

Use the POSIX \{0,1\} instead.

* FIX: Compatibility: sed \| multi not supported on MacOS

Concatenate both alternatives as optional matches; this is only an approximation but satisfies the test case here. It would probably be better if the entire sed code used extended regular expression syntax (-E) instead of basic ones (-e), but that change would also affect all add-ons. As this is an optional customization feature, uses who really need this either also have to work around, or supply a GNU sed port on MacOS.

* FIX: Compatibility: sed \+ multi not supported on MacOS

Use the POSIX \{1,\} instead.

Co-authored-by: Ali Karbassi <ali@karbassi.com>
@luilver luilver merged commit 4347858 into luilver:master Apr 5, 2020
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.

5 participants