From 62c17ab41152a24430b77044a41dea2a21b2a8cd Mon Sep 17 00:00:00 2001 From: "Dustin J. Mitchell" Date: Mon, 14 Jun 2021 10:57:44 -0400 Subject: [PATCH 01/20] Fix arg parsing on Windows --- cli/src/lib.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/cli/src/lib.rs b/cli/src/lib.rs index b247bfee6..8b61c12f8 100644 --- a/cli/src/lib.rs +++ b/cli/src/lib.rs @@ -31,8 +31,7 @@ For the public TaskChampion Rust API, see the `taskchampion` crate. */ -use std::os::unix::ffi::OsStringExt; -use std::string::FromUtf8Error; +use std::ffi::OsString; // NOTE: it's important that this 'mod' comes first so that the macros can be used in other modules mod macros; @@ -63,8 +62,8 @@ pub fn main() -> Result<(), Error> { // parse the command line into a vector of &str, failing if // there are invalid utf-8 sequences. let argv: Vec = std::env::args_os() - .map(|oss| String::from_utf8(oss.into_vec())) - .collect::>() + .map(|oss| oss.into_string()) + .collect::>() .map_err(|_| Error::for_arguments("arguments must be valid utf-8"))?; let argv: Vec<&str> = argv.iter().map(|s| s.as_ref()).collect(); From fbc97c871bee77bb949c92715dc3cb568d9a6925 Mon Sep 17 00:00:00 2001 From: dbr Date: Tue, 15 Jun 2021 12:13:15 +1000 Subject: [PATCH 02/20] Test on Windows+macOS --- .github/workflows/tests.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1ea9f23c0..f526447ee 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -16,8 +16,12 @@ jobs: rust: - "1.47" # MSRV - "stable" + os: + - ubuntu-latest + - macOS-latest + - windows-latest - name: "Test - Rust ${{ matrix.rust }}" + name: "Test - Rust ${{ matrix.rust }} on ${{ matrix.os }" steps: - uses: actions/checkout@v1 From 41c5cc842d41f893b2324b2c6f6c6e9c0d69bff5 Mon Sep 17 00:00:00 2001 From: dbr Date: Tue, 15 Jun 2021 12:16:09 +1000 Subject: [PATCH 03/20] Typo --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f526447ee..b756ab0eb 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -21,7 +21,7 @@ jobs: - macOS-latest - windows-latest - name: "Test - Rust ${{ matrix.rust }} on ${{ matrix.os }" + name: "Test - Rust ${{ matrix.rust }} on ${{ matrix.os }}" steps: - uses: actions/checkout@v1 From 5769b2070289cfc86c88f15ce8bfc3321ecd9e2b Mon Sep 17 00:00:00 2001 From: dbr Date: Tue, 15 Jun 2021 12:20:55 +1000 Subject: [PATCH 04/20] Important missing line to make CI actually run on matrix.os --- .github/workflows/tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b756ab0eb..0e4836a2a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -22,6 +22,7 @@ jobs: - windows-latest name: "Test - Rust ${{ matrix.rust }} on ${{ matrix.os }}" + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v1 From 2a2aef2b25c37b48fe5077bed1321ccf7b8e52d9 Mon Sep 17 00:00:00 2001 From: dbr Date: Tue, 15 Jun 2021 12:25:04 +1000 Subject: [PATCH 05/20] Maybe this time --- .github/workflows/tests.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0e4836a2a..6baef4519 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -9,8 +9,6 @@ on: jobs: test: - runs-on: ubuntu-latest - strategy: matrix: rust: From 8e84bf04465eebf5b86e71357d811acafdefd1ce Mon Sep 17 00:00:00 2001 From: "Dustin J. Mitchell" Date: Sun, 13 Jun 2021 15:36:18 -0400 Subject: [PATCH 06/20] Create a new doc if necessary in `ta config set` --- cli/src/settings/settings.rs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/cli/src/settings/settings.rs b/cli/src/settings/settings.rs index 95d0e4d2e..440e6cb4a 100644 --- a/cli/src/settings/settings.rs +++ b/cli/src/settings/settings.rs @@ -184,10 +184,16 @@ impl Settings { .ok_or_else(|| anyhow!("Could not determine config file name"))? }; - let mut document = fs::read_to_string(filename.clone()) - .context("Could not read existing configuration file")? - .parse::() - .context("Could not parse existing configuration file")?; + let exists = filename.exists(); + + let mut document = if exists { + fs::read_to_string(filename.clone()) + .context("Could not read existing configuration file")? + .parse::() + .context("Could not parse existing configuration file")? + } else { + Document::new() + }; // set the value as the correct type match key { From cc5240eeec3c55a8d65091b73c109e0a794faf32 Mon Sep 17 00:00:00 2001 From: "Dustin J. Mitchell" Date: Sun, 13 Jun 2021 15:40:57 -0400 Subject: [PATCH 07/20] Create config directory if necessary --- cli/src/settings/settings.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cli/src/settings/settings.rs b/cli/src/settings/settings.rs index 440e6cb4a..83f8938ae 100644 --- a/cli/src/settings/settings.rs +++ b/cli/src/settings/settings.rs @@ -186,6 +186,14 @@ impl Settings { let exists = filename.exists(); + // try to create the parent directory if the file does not exist + if !exists { + if let Some(dir) = filename.parent() { + fs::create_dir_all(dir)?; + } + } + + // start with the existing document, or a blank document let mut document = if exists { fs::read_to_string(filename.clone()) .context("Could not read existing configuration file")? From cae03c6d7e974a1d711021ec0a5d5213ed765294 Mon Sep 17 00:00:00 2001 From: dbr Date: Sun, 20 Jun 2021 22:13:57 +1000 Subject: [PATCH 08/20] Initial changelog Also simple process/script to manage entries in PR's without merge conflicts: 1. Unreleased entries area stored as text files in ".changelogs/" 2. On release these are concatenated together and put in CHANGELOG.md Script basically just add line of text to a "YYYY-MM-DD-branch.txt" formatted file --- CHANGELOG.md | 20 ++++++++++++++ scripts/changelog.py | 64 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 84 insertions(+) create mode 100644 CHANGELOG.md create mode 100755 scripts/changelog.py diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 000000000..3f4b0775c --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,20 @@ +# Changelog + +## [Unreleased] + +Note: unreleased change log entries are kept in `.changelogs/` directory in repo root, and can be added with `./script/changelog.py add "Added thing for reason" + +## 0.3.0 - 2021-01-11 +- Flexible named reports +- Updates to the TaskChampion crate API +- Usability improvements + +## 0.2.0 - 2020-11-30 + +This release is the first "MVP" version of this tool. It can do basic task operations, and supports a synchronization. Major missing features are captured in issues, but briefly: + + better command-line API, similar to TaskWarrior + authentication of the replica / server protocol + encryption of replica data before transmission to the server + lots of task features (tags, annotations, dependencies, ..) + lots of CLI features (filtering, modifying, ..) diff --git a/scripts/changelog.py b/scripts/changelog.py new file mode 100755 index 000000000..5775d99c0 --- /dev/null +++ b/scripts/changelog.py @@ -0,0 +1,64 @@ +#!/usr/bin/env python3 +import os +import argparse +import datetime +import subprocess +from typing import List + +def ymd(): + return datetime.datetime.now().strftime("%Y-%m-%d") + +def git_current_branch() -> str : + out = subprocess.check_output(["git", "branch", "--show-current"]) + return out.strip().decode("utf-8") + +def get_dir() -> str: + here = os.path.dirname(os.path.abspath(__file__)) + return os.path.join( + here, + "../.changelogs") + +def get_changefiles() -> List[str]: + changedir = get_dir() + changefiles = [] + for f in os.listdir(changedir): + if f.endswith(".txt") and not f.startswith("."): + changefiles.append(os.path.join(changedir, f)) + + return changefiles + +def cmd_add(args): + text = args.text.strip() + if not text.startswith("- "): + text = "- %s" % text + + timestamp = ymd() + branchname = git_current_branch() + fname = os.path.join(get_dir(), "%s-%s.txt" % (timestamp, branchname)) + with open(fname, "a") as f: + f.write(text) + f.write("\n") + +def cmd_build(args): + print("## x.y.z - %s" % (ymd())) + for e in get_changefiles(): + print(open(e).read().strip()) + +def main() -> None: + parser = argparse.ArgumentParser() + subparsers = parser.add_subparsers(title='Sub commands', dest='command') + subparsers.required = True + + parser_add = subparsers.add_parser('add') + parser_add.add_argument("text") + parser_add.set_defaults(func=cmd_add) + + parser_build = subparsers.add_parser('build') + parser_build.set_defaults(func=cmd_build) + + args = parser.parse_args() + args.func(args) + + +if __name__ == "__main__": + main() From 4a3b19bba608c521cc37ccb91dd7ee5520e70e2d Mon Sep 17 00:00:00 2001 From: Ravi Sawlani Date: Tue, 24 Aug 2021 22:26:30 +0530 Subject: [PATCH 09/20] added common business date acronyms --- cli/src/argparse/args/time.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cli/src/argparse/args/time.rs b/cli/src/argparse/args/time.rs index 4581d0a41..029cfa8e1 100644 --- a/cli/src/argparse/args/time.rs +++ b/cli/src/argparse/args/time.rs @@ -154,11 +154,18 @@ fn named_date( move |input: &str| { let local_today = now.with_timezone(&local).date(); let remaining = &input[input.len()..]; + let day_index = local_today.weekday().num_days_from_monday(); match input { "yesterday" => Ok((remaining, local_today - Duration::days(1))), "today" => Ok((remaining, local_today)), "tomorrow" => Ok((remaining, local_today + Duration::days(1))), // TODO: lots more! + "eod"=>Ok((remaining,local_today+Duration::days(1))), + "sod"=>Ok((remaining,local_today)), + "eow"=> Ok((remaining,local_today+Duration::days((6-day_index).into()))), + "eoww"=>Ok((remaining,local_today+Duration::days((5-day_index).into()))), + "sow"=>Ok((remaining,local_today+Duration::days((6-day_index).into()))), + "soww"=>Ok((remaining,local_today+Duration::days((7-day_index).into()))), _ => Err(Err::Error(Error::new(input, ErrorKind::Tag))), } .map(|(rem, dt)| (rem, dt.and_hms(0, 0, 0).with_timezone(&Utc))) From 90b06df30f31b5c08b7b8a1ecd69bc80da3319f1 Mon Sep 17 00:00:00 2001 From: Ravi Sawlani Date: Tue, 24 Aug 2021 22:38:27 +0530 Subject: [PATCH 10/20] refactor --- cli/src/argparse/args/time.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cli/src/argparse/args/time.rs b/cli/src/argparse/args/time.rs index 029cfa8e1..dab4f0372 100644 --- a/cli/src/argparse/args/time.rs +++ b/cli/src/argparse/args/time.rs @@ -160,12 +160,12 @@ fn named_date( "today" => Ok((remaining, local_today)), "tomorrow" => Ok((remaining, local_today + Duration::days(1))), // TODO: lots more! - "eod"=>Ok((remaining,local_today+Duration::days(1))), - "sod"=>Ok((remaining,local_today)), - "eow"=> Ok((remaining,local_today+Duration::days((6-day_index).into()))), - "eoww"=>Ok((remaining,local_today+Duration::days((5-day_index).into()))), - "sow"=>Ok((remaining,local_today+Duration::days((6-day_index).into()))), - "soww"=>Ok((remaining,local_today+Duration::days((7-day_index).into()))), + "eod" => Ok((remaining,local_today+Duration::days(1))), + "sod" => Ok((remaining,local_today)), + "eow" => Ok((remaining,local_today+Duration::days((6-day_index).into()))), + "eoww" => Ok((remaining,local_today+Duration::days((5-day_index).into()))), + "sow" => Ok((remaining,local_today+Duration::days((6-day_index).into()))), + "soww" => Ok((remaining,local_today+Duration::days((7-day_index).into()))), _ => Err(Err::Error(Error::new(input, ErrorKind::Tag))), } .map(|(rem, dt)| (rem, dt.and_hms(0, 0, 0).with_timezone(&Utc))) From c5e18aec318c1df898cacd89707d463d3994c55a Mon Sep 17 00:00:00 2001 From: Ravi Sawlani Date: Tue, 24 Aug 2021 22:41:45 +0530 Subject: [PATCH 11/20] lint issue --- cli/src/argparse/args/time.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cli/src/argparse/args/time.rs b/cli/src/argparse/args/time.rs index dab4f0372..1fe9565d6 100644 --- a/cli/src/argparse/args/time.rs +++ b/cli/src/argparse/args/time.rs @@ -160,12 +160,12 @@ fn named_date( "today" => Ok((remaining, local_today)), "tomorrow" => Ok((remaining, local_today + Duration::days(1))), // TODO: lots more! - "eod" => Ok((remaining,local_today+Duration::days(1))), + "eod" => Ok((remaining,local_today + Duration::days(1))), "sod" => Ok((remaining,local_today)), - "eow" => Ok((remaining,local_today+Duration::days((6-day_index).into()))), - "eoww" => Ok((remaining,local_today+Duration::days((5-day_index).into()))), - "sow" => Ok((remaining,local_today+Duration::days((6-day_index).into()))), - "soww" => Ok((remaining,local_today+Duration::days((7-day_index).into()))), + "eow" => Ok((remaining,local_today + Duration::days((6-day_index).into()))), + "eoww" => Ok((remaining,local_today + Duration::days((5-day_index).into()))), + "sow" => Ok((remaining,local_today + Duration::days((6-day_index).into()))), + "soww" => Ok((remaining,local_today + Duration::days((7-day_index).into()))), _ => Err(Err::Error(Error::new(input, ErrorKind::Tag))), } .map(|(rem, dt)| (rem, dt.and_hms(0, 0, 0).with_timezone(&Utc))) From f824d6123c6a6a6ebb41a6ecdef89f0089f4dfd5 Mon Sep 17 00:00:00 2001 From: Ravi Sawlani Date: Wed, 25 Aug 2021 12:42:37 +0530 Subject: [PATCH 12/20] added tests --- cli/src/argparse/args/time.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cli/src/argparse/args/time.rs b/cli/src/argparse/args/time.rs index 1fe9565d6..47a82e1fc 100644 --- a/cli/src/argparse/args/time.rs +++ b/cli/src/argparse/args/time.rs @@ -308,6 +308,12 @@ mod test { #[case::today_from_evening(ldt(2021, 3, 1, 21, 30, 30), "today", ld(2021, 3, 1))] #[case::tomorrow(ld(2021, 3, 1), "tomorrow", ld(2021, 3, 2))] #[case::tomorow_from_evening(ldt(2021, 3, 1, 21, 30, 30), "tomorrow", ld(2021, 3, 2))] + #[case::end_of_week(ld(2021,8,25,), "eow", ld(2021,8,29))] + #[case::end_of_work_week(ld(2021,8,25), "eoww", ld(2021,8,28))] + #[case::start_of_week(ld(2021,8,25), "sow", ld(2021,8,29))] + #[case::start_of_work_week(ld(2021,8,25), "soww", ld(2021,8,30))] + #[case::end_of_today(ld(2021,8,25), "eod", ld(2021,8,26))] + #[case::start_of_today(ld(2021,8,25), "sod", ld(2021,8,25))] fn test_local_timestamp( #[case] now: Box DateTime>, #[values(*IST, *UTC_FO, *HST)] tz: FixedOffset, From e8a4d8029b961daf6a1eefc95e8992fb27eba7c9 Mon Sep 17 00:00:00 2001 From: dbr Date: Thu, 26 Aug 2021 19:56:53 +1000 Subject: [PATCH 13/20] Update contribute+release docs regarding changelog --- .changelogs/.gitignore | 0 CONTRIBUTING.md | 24 +++++++++++++++++++----- RELEASING.md | 1 + 3 files changed, 20 insertions(+), 5 deletions(-) create mode 100644 .changelogs/.gitignore diff --git a/.changelogs/.gitignore b/.changelogs/.gitignore new file mode 100644 index 000000000..e69de29bb diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 568878926..658c0957f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -7,6 +7,10 @@ It also means that things are changing quickly, and lots of stuff is planned tha If you would like to work on TaskChampion, please contact the developers (via the issue tracker) before spending a lot of time working on a pull request. Doing so may save you some wasted time and frustration! +A good starting point might be one of the issues tagged with ["good first issue"][first]. + +[first]: https://github.com/taskchampion/taskchampion/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22 + # Other Ways To Help The best way to help this project to grow is to help spread awareness of it. @@ -15,7 +19,6 @@ Tell your friends, post to social media, blog about it -- whatever works best! Other ideas; * Improve the documentation where it's unclear or lacking some information * Build and maintain tools that integrate with TaskChampion - * Devise a nice TaskChampion logo # Development Guide @@ -44,8 +47,19 @@ You may be able to limit the scope of what you need to understand to just one cr You can generate the documentation for the `taskchampion` crate with `cargo doc --release --open -p taskchampion`. - ## Making a Pull Request +## Making a Pull Request - We expect contributors to follow the [GitHub Flow](https://guides.github.com/introduction/flow/). - Aside from that, we have no particular requirements on pull requests. - Make your patch, double-check that it's complete (tests? docs? documentation comments?), and make a new pull request. +We expect contributors to follow the [GitHub Flow](https://guides.github.com/introduction/flow/). +Aside from that, we have no particular requirements on pull requests. +Make your patch, double-check that it's complete (tests? docs? documentation comments?), and make a new pull request. + +Any non-trivial change (particularly those that change the behaviour of the application, or change the API) should be noted in the projects changelog. +In order to manage this, changelog entries are stored as text files in the `.changelog/` directory at the repository root. + +To add a new changelog entry, you can simply run `python3 ./script/changelog.py add "Fixed thingo to increase zorbloxification [Issue #2](http://example.com)` + +This creates a file named `./changelogs/yyyy-mm-dd-branchname.txt` (timestamp, current git branch) which contains a markdown snippet. + +If you don't have a Python 3 intepreter installed, you can simply create this file manually. It should contain a list item like `- Fixed thingo [...]` + +Periodically (probably just before release), these changelog entries are concatenated combined together and added into the `CHANGELOG.md` file. diff --git a/RELEASING.md b/RELEASING.md index e58e51da7..3617abd76 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -1,5 +1,6 @@ # Release process +1. Ensure the changelog is updated with everything from the `.changelogs` directory. `python3 ./script/changelog.py build` will output a Markdown snippet to include in `CHANGELOG.md` then `rm .changelog/*.txt` 1. Run `git pull upstream main` 1. Run `cargo test` 1. Run `cargo clean && cargo clippy` From f013233c88c8822b36aa6b48aa665b72faaae31a Mon Sep 17 00:00:00 2001 From: Ravi Sawlani Date: Sat, 28 Aug 2021 00:59:09 +0530 Subject: [PATCH 14/20] document changes --- docs/src/time.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/docs/src/time.md b/docs/src/time.md index b82e1b2e1..7b7380a8f 100644 --- a/docs/src/time.md +++ b/docs/src/time.md @@ -28,3 +28,18 @@ Some of the units allow an adjectival form, such as `daily` or `annually`; this [ISO 8601 standard durations](https://en.wikipedia.org/wiki/ISO_8601#Durations) are also allowed. While the standard does not specify the length of "P1Y" or "P1M", Taskchampion treats those as 365 and 30 days, respectively. + + +## Named Timestamps + +Some commonly used named timestamps + + * `today` Start of today + * `yesterday` Start of yesterday + * `tomorrow` Start of tomorrow + * `sod` Start of today + * `eod` End of today + * `sow` Start of the next week + * `eow` End of the week + * 'eoww End of work week + * `soww` Start of the next work week \ No newline at end of file From d001b5dbc931860161a8a4f888f9bf2d5859f9df Mon Sep 17 00:00:00 2001 From: Ravi Sawlani Date: Sat, 28 Aug 2021 01:01:02 +0530 Subject: [PATCH 15/20] update doc --- docs/src/time.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/time.md b/docs/src/time.md index 7b7380a8f..28ab9b735 100644 --- a/docs/src/time.md +++ b/docs/src/time.md @@ -41,5 +41,5 @@ Some commonly used named timestamps * `eod` End of today * `sow` Start of the next week * `eow` End of the week - * 'eoww End of work week + * `eoww` End of work week * `soww` Start of the next work week \ No newline at end of file From 3edf45d238ec85c3e81882071e9b603e72391787 Mon Sep 17 00:00:00 2001 From: Ravi Sawlani Date: Sat, 28 Aug 2021 01:47:50 +0530 Subject: [PATCH 16/20] added ref pic --- docs/assets/cgi/name_timestamp.png | Bin 0 -> 8194 bytes docs/src/time.md | 5 ++++- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 docs/assets/cgi/name_timestamp.png diff --git a/docs/assets/cgi/name_timestamp.png b/docs/assets/cgi/name_timestamp.png new file mode 100644 index 0000000000000000000000000000000000000000..d829039b72ece8d2cd64cc2b3548ec9376d72ce8 GIT binary patch literal 8194 zcmdUUc{J4R|MzH-7DX#1MA~E<409JUW-&9&FlNk{gc&o;jM>b>%n%iY(4s6!x|L{? zL`jjoLM3%;RkF27_UI=4uBrQZ&i8rF?{}W_e9!ay<2lEfbA7JQ^?6_K>wUeK*Xu3G zi-6HyuzCRm0@230BS{d5MgXIl(YHw3bu?9`deCv!dgb~#S1JbUJiIS z>qwFX7i_8CHG(aXaz(=5%WQxkOWWTsWJ)pn_biJY!3}1sXKhj7K>uhCzUBU-D~jps zp|a&!P_T?(7#~LTia=6-3lTB|{|NB{>RQrBeHi^cEt9*Gjk-#j72wO76lV+>JM3O_%p;RAXsHa>R7KXD!qQEyw zA`Z{Nv9NY5G>*au4in)NP!wH;3G>F{|GCNdn%^Wb(AunO+$CkjC;2w>>o;3~HX22O((BdBOG($n6L z%vXX(oQ-{`yTVrB?x-Z9nMkyagRL8z8;*@|7yAX<3q)jZo?K1~6#}UU5-C#YArw+b z=rHd{C5ni`5#UUe2#a(h24he%CL0%O2keKyFjT@YC>hOw@zvV6V^C~~B*cqK0BTYE zxFVj4!{jRIbPfy^=8d9<0yS*#RK7|OLJDK}_<~Q6K4Azh1t6_DCv4=kSO?Jf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N!2Z^opIyJ+UGW3A3pi+~eA#Qo1Ka+?|}QnxlIMhrJb+)X=sbL?%@;O2!ZKzzgg zWv``+G`+pO_xAR(^7Her_I7umSF(|}e{0zBH-PCTmM{6e>SL*r5BSFZcvm}n&aAyf sIV%NeG>hgJi~lX?_kYtHE&8buKXPGXJwuEF|J#RPQ3T`_M9{wf00T~@V*mgE literal 0 HcmV?d00001 diff --git a/docs/src/time.md b/docs/src/time.md index 28ab9b735..dc3ba28a4 100644 --- a/docs/src/time.md +++ b/docs/src/time.md @@ -42,4 +42,7 @@ Some commonly used named timestamps * `sow` Start of the next week * `eow` End of the week * `eoww` End of work week - * `soww` Start of the next work week \ No newline at end of file + * `soww` Start of the next work week + + +![named timestamp](/docs/assets/cgi/named_timestamp.jpg) From 037807e3acc104e17be7be38d2a6590a6af1b098 Mon Sep 17 00:00:00 2001 From: Ravi Sawlani Date: Sat, 28 Aug 2021 02:06:33 +0530 Subject: [PATCH 17/20] update image ref --- docs/{assets/cgi => src/images}/name_timestamp.png | Bin docs/src/time.md | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename docs/{assets/cgi => src/images}/name_timestamp.png (100%) diff --git a/docs/assets/cgi/name_timestamp.png b/docs/src/images/name_timestamp.png similarity index 100% rename from docs/assets/cgi/name_timestamp.png rename to docs/src/images/name_timestamp.png diff --git a/docs/src/time.md b/docs/src/time.md index dc3ba28a4..4053aea29 100644 --- a/docs/src/time.md +++ b/docs/src/time.md @@ -45,4 +45,4 @@ Some commonly used named timestamps * `soww` Start of the next work week -![named timestamp](/docs/assets/cgi/named_timestamp.jpg) +![named timestamp](images/name_timestamp.png) From 8ca7f70cef5e094c034043abe447d78eaf78d942 Mon Sep 17 00:00:00 2001 From: dbr Date: Sun, 5 Sep 2021 17:02:48 +1000 Subject: [PATCH 18/20] Store changelog snippets as .md --- CONTRIBUTING.md | 2 +- scripts/changelog.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 658c0957f..2adfeba3e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -58,7 +58,7 @@ In order to manage this, changelog entries are stored as text files in the `.cha To add a new changelog entry, you can simply run `python3 ./script/changelog.py add "Fixed thingo to increase zorbloxification [Issue #2](http://example.com)` -This creates a file named `./changelogs/yyyy-mm-dd-branchname.txt` (timestamp, current git branch) which contains a markdown snippet. +This creates a file named `./changelogs/yyyy-mm-dd-branchname.md` (timestamp, current git branch) which contains a markdown snippet. If you don't have a Python 3 intepreter installed, you can simply create this file manually. It should contain a list item like `- Fixed thingo [...]` diff --git a/scripts/changelog.py b/scripts/changelog.py index 5775d99c0..0eac4fa35 100755 --- a/scripts/changelog.py +++ b/scripts/changelog.py @@ -22,7 +22,7 @@ def get_changefiles() -> List[str]: changedir = get_dir() changefiles = [] for f in os.listdir(changedir): - if f.endswith(".txt") and not f.startswith("."): + if f.endswith(".md") and not f.startswith("."): changefiles.append(os.path.join(changedir, f)) return changefiles @@ -34,7 +34,7 @@ def cmd_add(args): timestamp = ymd() branchname = git_current_branch() - fname = os.path.join(get_dir(), "%s-%s.txt" % (timestamp, branchname)) + fname = os.path.join(get_dir(), "%s-%s.md" % (timestamp, branchname)) with open(fname, "a") as f: f.write(text) f.write("\n") From 72b494148515371e917d50231e5a7505160e0141 Mon Sep 17 00:00:00 2001 From: "Dustin J. Mitchell" Date: Sun, 5 Sep 2021 21:55:09 +0000 Subject: [PATCH 19/20] fix new clippy warnings --- cli/src/invocation/mod.rs | 2 +- cli/src/invocation/modify.rs | 4 ++-- cli/src/settings/report.rs | 2 +- cli/src/settings/settings.rs | 2 +- sync-server/src/storage/kv.rs | 8 ++++---- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/cli/src/invocation/mod.rs b/cli/src/invocation/mod.rs index b2335a345..640925a69 100644 --- a/cli/src/invocation/mod.rs +++ b/cli/src/invocation/mod.rs @@ -125,7 +125,7 @@ fn get_server(settings: &Settings) -> anyhow::Result> { settings.server_origin.as_ref(), settings.encryption_secret.as_ref(), ) { - let client_key = Uuid::parse_str(&client_key)?; + let client_key = Uuid::parse_str(client_key)?; log::debug!("Using sync-server with origin {}", origin); log::debug!("Sync client ID: {}", client_key); diff --git a/cli/src/invocation/modify.rs b/cli/src/invocation/modify.rs index dd943fdd1..2e27fba74 100644 --- a/cli/src/invocation/modify.rs +++ b/cli/src/invocation/modify.rs @@ -30,11 +30,11 @@ pub(super) fn apply_modification( } for tag in modification.add_tags.iter() { - task.add_tag(&tag)?; + task.add_tag(tag)?; } for tag in modification.remove_tags.iter() { - task.remove_tag(&tag)?; + task.remove_tag(tag)?; } if let Some(wait) = modification.wait { diff --git a/cli/src/settings/report.rs b/cli/src/settings/report.rs index 1911bf84e..78650ffe3 100644 --- a/cli/src/settings/report.rs +++ b/cli/src/settings/report.rs @@ -130,7 +130,7 @@ impl TryFrom<&toml::Value> for Report { .map(|(i, v)| { v.as_str() .ok_or_else(|| anyhow!(".filter[{}]: not a string", i)) - .and_then(|s| Condition::parse_str(&s)) + .and_then(|s| Condition::parse_str(s)) .map_err(|e| anyhow!(".filter[{}]: {}", i, e)) }) .collect::>>()?, diff --git a/cli/src/settings/settings.rs b/cli/src/settings/settings.rs index 83f8938ae..e1809091f 100644 --- a/cli/src/settings/settings.rs +++ b/cli/src/settings/settings.rs @@ -97,7 +97,7 @@ impl Settings { "server_dir", "reports", ]; - let table = table_with_keys(&config_toml, &table_keys)?; + let table = table_with_keys(config_toml, &table_keys)?; fn get_str_cfg( table: &Table, diff --git a/sync-server/src/storage/kv.rs b/sync-server/src/storage/kv.rs index bd5fa3502..19218a235 100644 --- a/sync-server/src/storage/kv.rs +++ b/sync-server/src/storage/kv.rs @@ -86,7 +86,7 @@ impl<'t> StorageTxn for Txn<'t> { let bucket = self.clients_bucket(); let kvtxn = self.kvtxn(); - let client = match kvtxn.get(&bucket, key) { + let client = match kvtxn.get(bucket, key) { Ok(buf) => buf, Err(Error::NotFound) => return Ok(None), Err(e) => return Err(e.into()), @@ -101,7 +101,7 @@ impl<'t> StorageTxn for Txn<'t> { let bucket = self.clients_bucket(); let kvtxn = self.kvtxn(); let client = Client { latest_version_id }; - kvtxn.set(&bucket, key, Msgpack::to_value_buf(client)?)?; + kvtxn.set(bucket, key, Msgpack::to_value_buf(client)?)?; Ok(()) } @@ -122,7 +122,7 @@ impl<'t> StorageTxn for Txn<'t> { let key = version_db_key(client_key, parent_version_id); let bucket = self.versions_bucket(); let kvtxn = self.kvtxn(); - let version = match kvtxn.get(&bucket, key) { + let version = match kvtxn.get(bucket, key) { Ok(buf) => buf, Err(Error::NotFound) => return Ok(None), Err(e) => return Err(e.into()), @@ -147,7 +147,7 @@ impl<'t> StorageTxn for Txn<'t> { parent_version_id, history_segment, }; - kvtxn.set(&bucket, key, Msgpack::to_value_buf(version)?)?; + kvtxn.set(bucket, key, Msgpack::to_value_buf(version)?)?; Ok(()) } From 91b2e1164f59a5cf7ac0240a4e7c266618d69586 Mon Sep 17 00:00:00 2001 From: "Dustin J. Mitchell" Date: Sun, 5 Sep 2021 21:57:34 +0000 Subject: [PATCH 20/20] run clippy on the MSRV --- .github/workflows/checks.yml | 7 +++++++ .github/workflows/tests.yml | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index dc11d46a8..3c96dafb7 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -27,6 +27,13 @@ jobs: path: target key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }} + - uses: actions-rs/toolchain@v1 + with: + # Fixed version for clippy lints. Bump this as necesary. It must not + # be older than the MSRV in tests.yml. + toolchain: "1.54" + override: true + - uses: actions-rs/cargo@v1.0.1 with: command: check diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6baef4519..78a0e183e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -12,7 +12,8 @@ jobs: strategy: matrix: rust: - - "1.47" # MSRV + # MSRV; most not be higher than the clippy rust version in checks.yml + - "1.47" - "stable" os: - ubuntu-latest