Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package zk for openSUSE:Factory checked in at 2023-06-11 19:55:35 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/zk (Old) and /work/SRC/openSUSE:Factory/.zk.new.15902 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "zk" Sun Jun 11 19:55:35 2023 rev:5 rq:1092052 version:0.14.0 Changes: -------- --- /work/SRC/openSUSE:Factory/zk/zk.changes 2023-02-14 16:45:37.986517279 +0100 +++ /work/SRC/openSUSE:Factory/.zk.new.15902/zk.changes 2023-06-11 19:58:17.404248724 +0200 @@ -1,0 +2,12 @@ +Sat Jun 10 15:10:11 UTC 2023 - Andrea Manzini <[email protected]> + +- Update to version 0.14.0: + * Added + + New tool.shell configuration key to set a custom shell (contributed by @lsvmello). + + New notebook.dir configuration key to set the default notebook (contributed by @lsvmello). + * Changed + + The note.ignore configuration property was renamed to note.exclude, to be more consistent with the CLI flags. + * Fixed + + Fixed LSP positions using UTF-16 offsets (contributed by @wrvsrx). + +------------------------------------------------------------------- Old: ---- zk-0.13.0.tar.gz New: ---- zk-0.14.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ zk.spec ++++++ --- /var/tmp/diff_new_pack.GJ5x6d/_old 2023-06-11 19:58:17.880251594 +0200 +++ /var/tmp/diff_new_pack.GJ5x6d/_new 2023-06-11 19:58:17.884251618 +0200 @@ -17,7 +17,7 @@ Name: zk -Version: 0.13.0 +Version: 0.14.0 Release: 0 Summary: Plain text note-taking assistant for markdown License: BSD-2-Clause ++++++ vendor.tar.zstd ++++++ Binary files /var/tmp/diff_new_pack.GJ5x6d/_old and /var/tmp/diff_new_pack.GJ5x6d/_new differ ++++++ zk-0.13.0.tar.gz -> zk-0.14.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zk-0.13.0/.github/DISCUSSION_TEMPLATE/help.yml new/zk-0.14.0/.github/DISCUSSION_TEMPLATE/help.yml --- old/zk-0.13.0/.github/DISCUSSION_TEMPLATE/help.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/zk-0.14.0/.github/DISCUSSION_TEMPLATE/help.yml 2023-05-20 15:05:27.000000000 +0200 @@ -0,0 +1,19 @@ +title: "[Help] " +body: + - type: checkboxes + id: checks + attributes: + label: Verify + options: + - label: I searched the existing discussions for help + required: true + - type: textarea + id: help + attributes: + label: How can we help you? + validations: + required: true + - type: markdown + attributes: + value: | + :warning: Unfortunately, my time is limited and I can't offer reliable user support. I might answer if you catch me on a slow day, or hopefully someone else will. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zk-0.13.0/.github/DISCUSSION_TEMPLATE/ideas.yml new/zk-0.14.0/.github/DISCUSSION_TEMPLATE/ideas.yml --- old/zk-0.13.0/.github/DISCUSSION_TEMPLATE/ideas.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/zk-0.14.0/.github/DISCUSSION_TEMPLATE/ideas.yml 2023-05-20 15:05:27.000000000 +0200 @@ -0,0 +1,14 @@ +body: + - type: checkboxes + id: checks + attributes: + label: Verify + options: + - label: I searched the existing discussions for similar ideas + required: true + - type: textarea + id: help + attributes: + label: Share your idea or feature request + validations: + required: true diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zk-0.13.0/.github/ISSUE_TEMPLATE/bug_report.yml new/zk-0.14.0/.github/ISSUE_TEMPLATE/bug_report.yml --- old/zk-0.13.0/.github/ISSUE_TEMPLATE/bug_report.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/zk-0.14.0/.github/ISSUE_TEMPLATE/bug_report.yml 2023-05-20 15:05:27.000000000 +0200 @@ -0,0 +1,65 @@ +name: Bug report +description: File a bug report to help improve zk. +body: + - type: markdown + attributes: + value: | + Thank you for filing a bug report! + - type: checkboxes + id: checks + attributes: + label: Check if applicable + description: | + :warning: My time is limited and if I don't plan on fixing the reported bug myself, I might close this issue. No hard feelings. + :heart: But if you would like to contribute a fix yourself, **I'll be happy to guide you through the codebase and review a pull request**. + options: + - label: I have searched the existing issues (**required**) + required: true + - label: I'm willing to help fix the problem and contribute a pull request + - type: textarea + id: bug-description + attributes: + label: Describe the bug + description: Also tell me, what did you expect to happen? + placeholder: A clear and concise description of what the bug is. + validations: + required: true + - type: textarea + id: bug-steps + attributes: + label: How to reproduce? + description: | + Step by step explanation to reproduce the issue. + + If you can, drag and drop: + - a zipped sample notebook + - screenshots or a screencast showing the issue + placeholder: | + 1. Add a note with the content "..." + 2. Run `zk edit --interactive` + 3. See error + ... + validations: + required: true + - type: textarea + id: vim-config + attributes: + label: zk configuration + description: | + Paste the minimal `zk` configuration file (`.zk/config.toml`) reproducing the issue. + render: toml + validations: + required: true + - type: textarea + id: bug-environment + attributes: + label: Environment + description: | + Run the following shell commands and paste the result here: + ``` + zk --version && echo "system: `uname -srmo`" + ``` + placeholder: | + zk 0.13.0 + system: Darwin 22.5.0 arm64 + render: bash diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zk-0.13.0/.github/ISSUE_TEMPLATE/feature_request.yml new/zk-0.14.0/.github/ISSUE_TEMPLATE/feature_request.yml --- old/zk-0.13.0/.github/ISSUE_TEMPLATE/feature_request.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/zk-0.14.0/.github/ISSUE_TEMPLATE/feature_request.yml 2023-05-20 15:05:27.000000000 +0200 @@ -0,0 +1,10 @@ +name: Feature request +description: Suggest an idea for this project. +body: + - type: checkboxes + id: checks + attributes: + label: If you have an idea, open a discussion + options: + - label: I will [create a new discussion](https://github.com/mickael-menu/zk/discussions/new?category=ideas) instead of an issue. + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zk-0.13.0/.github/ISSUE_TEMPLATE/support.yml new/zk-0.14.0/.github/ISSUE_TEMPLATE/support.yml --- old/zk-0.13.0/.github/ISSUE_TEMPLATE/support.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/zk-0.14.0/.github/ISSUE_TEMPLATE/support.yml 2023-05-20 15:05:27.000000000 +0200 @@ -0,0 +1,13 @@ +name: User support +description: You need help? +body: + - type: markdown + attributes: + value: | + :warning: Unfortunately, my time is limited and I can't offer reliable user support. I might answer if you catch me on a slow day, or hopefully someone else will. + - type: checkboxes + id: checks + attributes: + label: If you need help, open a discussion + options: + - label: I will [create a new discussion](https://github.com/mickael-menu/zk/discussions/new?category=help) instead of an issue. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zk-0.13.0/.github/workflows/build.yml new/zk-0.14.0/.github/workflows/build.yml --- old/zk-0.13.0/.github/workflows/build.yml 2023-02-13 08:23:21.000000000 +0100 +++ new/zk-0.14.0/.github/workflows/build.yml 2023-05-20 15:05:27.000000000 +0200 @@ -16,7 +16,7 @@ lfs: 'true' - name: Set up Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v4 with: go-version: 1.18 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zk-0.13.0/CHANGELOG.md new/zk-0.14.0/CHANGELOG.md --- old/zk-0.13.0/CHANGELOG.md 2023-02-13 08:23:21.000000000 +0100 +++ new/zk-0.14.0/CHANGELOG.md 2023-05-20 15:05:27.000000000 +0200 @@ -4,6 +4,21 @@ <!--## Unreleased--> +## 0.14.0 + +### Added + +* New [`tool.shell`](docs/tool-shell.md) configuration key to set a custom shell (contributed by [@lsvmello](https://github.com/mickael-menu/zk/pull/302)). +* New [`notebook.dir`](docs/config-notebook.md) configuration key to set the default notebook (contributed by [@lsvmello](https://github.com/mickael-menu/zk/pull/304)). + +### Changed + +* The `note.ignore` configuration property was renamed to `note.exclude`, to be more consistent with the CLI flags. + +### Fixed + +* Fixed LSP positions using UTF-16 offsets (contributed by [@wrvsrx](https://github.com/mickael-menu/zk/pull/317)). + ## 0.13.0 ### Added diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zk-0.13.0/docs/config-alias.md new/zk-0.14.0/docs/config-alias.md --- old/zk-0.13.0/docs/config-alias.md 2023-02-13 08:23:21.000000000 +0100 +++ new/zk-0.14.0/docs/config-alias.md 2023-05-20 15:05:27.000000000 +0200 @@ -6,9 +6,10 @@ ## Configuring aliases -Command aliases are declared in your [configuration file](config.md), under the `[alias]` section. They are executed with `$SHELL -c`, which allows you to: +Command aliases are declared in your [configuration file](config.md), under the `[alias]` section. They are executed with [your default shell](tool-shell.md), which allows you to: * expand arguments with `$@` or `$*` + * [it is recommended to wrap `$@` in quotes](https://github.com/mickael-menu/zk/issues/316#issuecomment-1543564168) * expand environment variables * run several commands with `&&` * pipe several commands with `|` @@ -17,7 +18,7 @@ ```toml [alias] -edit = "zk edit --interactive $@" +edit = 'zk edit --interactive "$@"' ``` When running an alias, the `ZK_NOTEBOOK_DIR` environment variable is set to the absolute path of the current notebook. You can use it to run commands working no matter the location of the working directory. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zk-0.13.0/docs/config-note.md new/zk-0.14.0/docs/config-note.md --- old/zk-0.13.0/docs/config-note.md 2023-02-13 08:23:21.000000000 +0100 +++ new/zk-0.14.0/docs/config-note.md 2023-05-20 15:05:27.000000000 +0200 @@ -14,8 +14,8 @@ * `template` (string) * Path to the [template](template.md) used to generate the note content. * Either an absolute path, or relative to `.zk/templates/`. -* `ignore` (list of strings) - * List of [path globs](https://en.wikipedia.org/wiki/Glob_\(programming\)) ignored during note indexing. +* `exclude` (list of strings) + * List of [path globs](https://en.wikipedia.org/wiki/Glob_\(programming\)) excluded during note indexing. * `id-charset` (string) * Characters set used to [generate random IDs](note-id.md). * You can use: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zk-0.13.0/docs/config-notebook.md new/zk-0.14.0/docs/config-notebook.md --- old/zk-0.13.0/docs/config-notebook.md 1970-01-01 01:00:00.000000000 +0100 +++ new/zk-0.14.0/docs/config-notebook.md 2023-05-20 15:05:27.000000000 +0200 @@ -0,0 +1,15 @@ +# Notebook configuration + +The `[notebook]` section from the [configuration file](config.md) is used to set the default notebook directory. +If the path starts with `~` it will be replaced with the user home directory (`$HOME`). This property also supports environment variables. + +```toml +[notebook] +dir = "~/notebook" # same as "$HOME/notebook" +``` + + The following properties are customizable: + +* `dir` (string) + * Path of the default notebook. + * Only available in the global config file (`~/.config/zk/config.toml`). diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zk-0.13.0/docs/config.md new/zk-0.14.0/docs/config.md --- old/zk-0.13.0/docs/config.md 2023-02-13 08:23:21.000000000 +0100 +++ new/zk-0.14.0/docs/config.md 2023-05-20 15:05:27.000000000 +0200 @@ -2,12 +2,14 @@ Each [notebook](notebook.md) contains a configuration file used to customize your experience with `zk`. This file is located at `.zk/config.toml` and uses the [TOML format](https://github.com/toml-lang/toml). It is composed of several optional sections: +* `[notebook]` configures the [default notebook](config-notebook.md) * `[note]` sets the [note creation rules](config-note.md) * `[extra]` contains free [user variables](config-extra.md) which can be expanded in templates * `[group]` defines [note groups](config-group.md) with custom rules * `[format]` configures the [note format settings](note-format.md), such as Markdown options * `[tool]` customizes interaction with external programs such as: * [your default editor](tool-editor.md) + * [your default shell](tool-shell.md) * [your default pager](tool-pager.md) * [`fzf`](tool-fzf.md) * `[lsp]` setups the [Language Server Protocol settings](config-lsp.md) for [editors integration](editors-integration.md) @@ -25,6 +27,10 @@ Here's an example of a complete configuration file: ```toml +# NOTEBOOK SETTINGS +[notebook] +dir = "~/notebook" + # NOTE SETTINGS [note] @@ -63,10 +69,10 @@ # GROUP OVERRIDES -[dir.journal] +[group.journal] paths = ["journal/weekly", "journal/daily"] -[dir.journal.note] +[group.journal.note] filename = "{{format-date now}}" @@ -84,6 +90,9 @@ # Default editor used to open notes. editor = "nvim" +# Default shell used by aliases and commands. +shell = "/bin/bash" + # Pager used to scroll through long output. pager = "less -FIRX" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zk-0.13.0/docs/notebook.md new/zk-0.14.0/docs/notebook.md --- old/zk-0.13.0/docs/notebook.md 2023-02-13 08:23:21.000000000 +0100 +++ new/zk-0.14.0/docs/notebook.md 2023-05-20 15:05:27.000000000 +0200 @@ -6,6 +6,8 @@ Most `zk` commands are operating "Git-style" on the notebook containing the current working directory (or one of its parents). However, you can explicitly set which notebook to use with `--notebook-dir` or the `ZK_NOTEBOOK_DIR` environment variable. Setting `ZK_NOTEBOOK_DIR` in your shell configuration (e.g. `~/.profile`) can be used to define a default notebook which `zk` commands will use when the working directory is not in another notebook. +If the [default notebook](config-notebook.md) is set it will be used as `ZK_NOTEBOOK_DIR`, unless this environment variable is not already set. + ## Anatomy of a notebook Similarly to Git, a notebook is identified by the presence of a `.zk` directory at its root. This directory contains the only `zk`-specific files in your notebook: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zk-0.13.0/docs/tool-shell.md new/zk-0.14.0/docs/tool-shell.md --- old/zk-0.13.0/docs/tool-shell.md 1970-01-01 01:00:00.000000000 +0100 +++ new/zk-0.14.0/docs/tool-shell.md 2023-05-20 15:05:27.000000000 +0200 @@ -0,0 +1,14 @@ +# Setting your default shell + +This is *currently* not supported on Windows (that defaults always to `cmd`). + +You can customize which shell to use to run aliases and commands either from the [configuration file](config.md) or environment variables. In order of precedence, `zk` will use: + +1. `ZK_SHELL` environment variable +2. `shell` configuration property + ```toml + [tool] + shell = "/bin/bash" + ``` +3. `SHELL` environment variable +4. `sh` as fallback diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zk-0.13.0/go.mod new/zk-0.14.0/go.mod --- old/zk-0.13.0/go.mod 2023-02-13 08:23:21.000000000 +0100 +++ new/zk-0.14.0/go.mod 2023-05-20 15:05:27.000000000 +0200 @@ -10,16 +10,17 @@ github.com/aymerick/raymond v2.0.2+incompatible github.com/bmatcuk/doublestar/v4 v4.0.2 github.com/fatih/color v1.13.0 - github.com/go-testfixtures/testfixtures/v3 v3.6.2 + github.com/go-testfixtures/testfixtures/v3 v3.6.1 github.com/google/go-cmp v0.5.8 github.com/gosimple/slug v1.12.0 github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 github.com/lestrrat-go/strftime v1.0.6 github.com/mattn/go-isatty v0.0.14 - github.com/mattn/go-sqlite3 v2.0.3+incompatible + github.com/mattn/go-sqlite3 v1.14.16 github.com/mickael-menu/pretty v0.2.3 github.com/mvdan/xurls v1.1.0 github.com/pelletier/go-toml v1.9.5 + github.com/pkg/errors v0.9.1 github.com/relvacode/iso8601 v1.1.0 github.com/rvflash/elapsed v0.2.0 github.com/schollz/progressbar/v3 v3.8.6 @@ -41,16 +42,15 @@ github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d // indirect github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db // indirect github.com/petermattis/goid v0.0.0-20220526132513-07eaf5d0b9f4 // indirect - github.com/pkg/errors v0.9.1 // indirect github.com/rivo/uniseg v0.2.0 // indirect github.com/rogpeppe/go-internal v1.8.1 // indirect github.com/sasha-s/go-deadlock v0.3.1 // indirect github.com/sourcegraph/jsonrpc2 v0.1.0 // indirect github.com/zchee/color/v2 v2.0.6 // indirect golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e // indirect - golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a // indirect + golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f // indirect golang.org/x/term v0.0.0-20220526004731-065cf7ba2467 // indirect - golang.org/x/text v0.3.7 // indirect + golang.org/x/text v0.3.8 // indirect gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/yaml.v2 v2.4.0 // indirect ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zk-0.13.0/go.sum new/zk-0.14.0/go.sum --- old/zk-0.13.0/go.sum 2023-02-13 08:23:21.000000000 +0100 +++ new/zk-0.14.0/go.sum 2023-05-20 15:05:27.000000000 +0200 @@ -10,19 +10,31 @@ github.com/aymerick/raymond v2.0.2+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g= github.com/bmatcuk/doublestar/v4 v4.0.2 h1:X0krlUVAVmtr2cRoTqR8aDMrDqnB36ht8wpWTiQ3jsA= github.com/bmatcuk/doublestar/v4 v4.0.2/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc= +github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ= +github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/creack/pty v1.1.17/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4= github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/denisenkom/go-mssqldb v0.10.0 h1:QykgLZBorFE95+gO3u9esLd0BmbvpWp0/waNNZfHBM8= +github.com/denisenkom/go-mssqldb v0.10.0/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU= github.com/denisenkom/go-mssqldb v0.12.0 h1:VtrkII767ttSPNRfFekePK3sctr+joXgO58stqQbtUA= github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE= +github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/go-testfixtures/testfixtures/v3 v3.6.1 h1:n4Fv95Exp0D05G6l6CAZv22Ck1EJK0pa0TfPqE4ncSs= +github.com/go-testfixtures/testfixtures/v3 v3.6.1/go.mod h1:Bsb2MoHAfHnNsPpSwAjtOs102mqDuM+1u3nE2OCi0N0= github.com/go-testfixtures/testfixtures/v3 v3.6.2 h1:xfcTCkQlyDmNF+DtpGvxOnUk8aj4aenOwcKO0valf9o= github.com/go-testfixtures/testfixtures/v3 v3.6.2/go.mod h1:iok8G2W/yEGHD4R9PDFRr+7PmAKZCKlr36D+HDND5Mo= +github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe h1:lXe2qZdvpiX5WZkZR4hgp4KJVfY3nMkvmwbVkpv1rVY= +github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= github.com/golang-sql/sqlexp v0.0.0-20170517235910-f1bb20e5a188 h1:+eHOFJl1BaXrQxKX+T06f78590z4qA2ZzBTqahsKSE4= github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= @@ -35,23 +47,62 @@ github.com/gosimple/unidecode v1.0.1/go.mod h1:CP0Cr1Y1kogOtx0bJblKzsVWrqYaqfNOnHzpgWw4Awc= github.com/hinshun/vt10x v0.0.0-20220119200601-820417d04eec h1:qv2VnGeEQHchGaZ/u7lxST/RaJw+cv273q79D81Xbog= github.com/hinshun/vt10x v0.0.0-20220119200601-820417d04eec/go.mod h1:Q48J4R4DvxnHolD5P8pOtXigYlRuPLGl6moFx3ulM68= +github.com/jackc/chunkreader v1.0.0/go.mod h1:RT6O25fNZIuasFJRyZ4R/Y2BbhasbmZXF9QQ7T3kePo= +github.com/jackc/chunkreader/v2 v2.0.0/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= github.com/jackc/chunkreader/v2 v2.0.1 h1:i+RDz65UE+mmpjTfyz0MoVTnzeYxroil2G82ki7MGG8= +github.com/jackc/chunkreader/v2 v2.0.1/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= +github.com/jackc/pgconn v0.0.0-20190420214824-7e0022ef6ba3/go.mod h1:jkELnwuX+w9qN5YIfX0fl88Ehu4XC3keFuOJJk9pcnA= +github.com/jackc/pgconn v0.0.0-20190824142844-760dd75542eb/go.mod h1:lLjNuW/+OfW9/pnVKPazfWOgNfH2aPem8YQ7ilXGvJE= +github.com/jackc/pgconn v0.0.0-20190831204454-2fabfa3c18b7/go.mod h1:ZJKsE/KZfsUgOEh9hBm+xYTstcNHg7UPMVJqRfQxq4s= +github.com/jackc/pgconn v1.5.0 h1:oFSOilzIZkyg787M1fEmyMfOUUvwj0daqYMfaWwNL4o= +github.com/jackc/pgconn v1.5.0/go.mod h1:QeD3lBfpTFe8WUnPZWN5KY/mB8FGMIYRdd8P8Jr0fAI= github.com/jackc/pgconn v1.12.1 h1:rsDFzIpRk7xT4B8FufgpCCeyjdNpKyghZeSefViE5W8= github.com/jackc/pgio v1.0.0 h1:g12B9UwVnzGhueNavwioyEEpAmqMe1E/BN9ES+8ovkE= +github.com/jackc/pgio v1.0.0/go.mod h1:oP+2QK2wFfUWgr+gxjoBH9KGBb31Eio69xUb0w5bYf8= +github.com/jackc/pgmock v0.0.0-20190831213851-13a1b77aafa2/go.mod h1:fGZlG77KXmcq05nJLRkk0+p82V8B8Dw8KN2/V9c/OAE= github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM= +github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= +github.com/jackc/pgproto3 v1.1.0/go.mod h1:eR5FA3leWg7p9aeAqi37XOTgTIbkABlvcPB3E5rlc78= +github.com/jackc/pgproto3/v2 v2.0.0-alpha1.0.20190420180111-c116219b62db/go.mod h1:bhq50y+xrl9n5mRYyCBFKkpRVTLYJVWeCc+mEAI3yXA= +github.com/jackc/pgproto3/v2 v2.0.0-alpha1.0.20190609003834-432c2951c711/go.mod h1:uH0AWtUmuShn0bcesswc4aBTWGvw0cAxIJp+6OB//Wg= +github.com/jackc/pgproto3/v2 v2.0.0-rc3/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvWKnT95C46ckYeM= +github.com/jackc/pgproto3/v2 v2.0.0-rc3.0.20190831210041-4c03ce451f29/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvWKnT95C46ckYeM= +github.com/jackc/pgproto3/v2 v2.0.1 h1:Rdjp4NFjwHnEslx2b66FfCI2S0LhO4itac3hXz6WX9M= +github.com/jackc/pgproto3/v2 v2.0.1/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= github.com/jackc/pgproto3/v2 v2.3.0 h1:brH0pCGBDkBW07HWlN/oSBXrmo3WB0UvZd1pIuDcL8Y= +github.com/jackc/pgservicefile v0.0.0-20200307190119-3430c5407db8 h1:Q3tB+ExeflWUW7AFcAhXqk40s9mnNYLk1nOkKNZ5GnU= +github.com/jackc/pgservicefile v0.0.0-20200307190119-3430c5407db8/go.mod h1:vsD4gTJCa9TptPL8sPkXrLZ+hDuNrZCnj29CQpr4X1E= github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b h1:C8S2+VttkHFdOOCXJe+YGfa4vHYwlt4Zx+IVXQ97jYg= +github.com/jackc/pgtype v0.0.0-20190421001408-4ed0de4755e0/go.mod h1:hdSHsc1V01CGwFsrv11mJRHWJ6aifDLfdV3aVjFF0zg= +github.com/jackc/pgtype v0.0.0-20190824184912-ab885b375b90/go.mod h1:KcahbBH1nCMSo2DXpzsoWOAfFkdEtEJpPbVLq8eE+mc= +github.com/jackc/pgtype v0.0.0-20190828014616-a8802b16cc59/go.mod h1:MWlu30kVJrUS8lot6TQqcg7mtthZ9T0EoIBFiJcmcyw= +github.com/jackc/pgtype v1.3.0 h1:l8JvKrby3RI7Kg3bYEeU9TA4vqC38QDpFCfcrC7KuN0= +github.com/jackc/pgtype v1.3.0/go.mod h1:b0JqxHvPmljG+HQ5IsvQ0yqeSi4nGcDTVjFoiLDb0Ik= github.com/jackc/pgtype v1.11.0 h1:u4uiGPz/1hryuXzyaBhSk6dnIyyG2683olG2OV+UUgs= +github.com/jackc/pgx v3.6.2+incompatible/go.mod h1:0ZGrqGqkRlliWnWB4zKnWtjbSWbGkVEFm4TeybAXq+I= +github.com/jackc/pgx/v4 v4.0.0-20190420224344-cc3461e65d96/go.mod h1:mdxmSJJuR08CZQyj1PVQBHy9XOp5p8/SHH6a0psbY9Y= +github.com/jackc/pgx/v4 v4.0.0-20190421002000-1b8f0016e912/go.mod h1:no/Y67Jkk/9WuGR0JG/JseM9irFbnEPbuWV2EELPNuM= +github.com/jackc/pgx/v4 v4.0.0-pre1.0.20190824185557-6972a5742186/go.mod h1:X+GQnOEnf1dqHGpw7JmHqHc1NxDoalibchSk9/RWuDc= +github.com/jackc/pgx/v4 v4.6.0 h1:Fh0O9GdlG4gYpjpwOqjdEodJUQM9jzN3Hdv7PN0xmm0= +github.com/jackc/pgx/v4 v4.6.0/go.mod h1:vPh43ZzxijXUVJ+t/EmXBtFmbFVO72cuneCT9oAlxAg= github.com/jackc/pgx/v4 v4.16.1 h1:JzTglcal01DrghUqt+PmzWsZx/Yh7SC/CTQmSBMTd0Y= +github.com/jackc/puddle v0.0.0-20190413234325-e4ced69a3a2b/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= +github.com/jackc/puddle v0.0.0-20190608224051-11cab39313c9/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= +github.com/jackc/puddle v1.1.0/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= +github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc= +github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= github.com/joho/godotenv v1.4.0 h1:3l4+N6zfMWnkbPEXKng2o2/MR5mSwTrBih4ZEkkz1lg= github.com/k0kubun/go-ansi v0.0.0-20180517002512-3bf9e2903213/go.mod h1:vNUNkEQ1e29fT/6vq2aBdFsgNPmy8qMdSay1npru+Sw= github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs= github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= @@ -59,17 +110,29 @@ github.com/lestrrat-go/envload v0.0.0-20180220234015-a3eb8ddeffcc/go.mod h1:kopuH9ugFRkIXf3YoqHKyrJ9YfUFsckUU9S7B+XP+is= github.com/lestrrat-go/strftime v1.0.6 h1:CFGsDEt1pOpFNU+TJB0nhz9jl+K0hZSLE205AhTIGQQ= github.com/lestrrat-go/strftime v1.0.6/go.mod h1:f7jQKgV5nnJpYgdEasS+/y7EsTb8ykN2z68n3TtcTaw= +github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/lib/pq v1.1.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/lib/pq v1.10.2 h1:AqzbZs4ZoCBp+GtejcpCpcxM3zlSMx29dXbUSeVtJb8= +github.com/lib/pq v1.10.2/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/lib/pq v1.10.5 h1:J+gdV2cUmX7ZqL2B0lFcW0m+egaHC2V3lpO8nWxyYiQ= +github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.12 h1:jF+Du6AlPIjs2BiUiQlKOX0rt3SujHxPnksPKZbaA40= github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= +github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-runewidth v0.0.13 h1:lTGmDsbAYt5DmK6OnoV7EuIF1wEIFAcxld6ypU4OSgU= github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= +github.com/mattn/go-sqlite3 v1.14.7/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= +github.com/mattn/go-sqlite3 v1.14.16 h1:yOQRA0RpS5PFz/oikGwBEqvAWhWg5ufRz4ETLjwpU1Y= +github.com/mattn/go-sqlite3 v1.14.16/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg= github.com/mattn/go-sqlite3 v2.0.3+incompatible h1:gXHsfypPkaMZrKbD5209QV9jbUTJKjyR5WD3HYQSd+U= github.com/mattn/go-sqlite3 v2.0.3+incompatible/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE= @@ -89,6 +152,7 @@ github.com/petermattis/goid v0.0.0-20220526132513-07eaf5d0b9f4 h1:COozsq2xbSoZ6kt+/iHGF7eQqiUZr2uxQoAe4OzNkhE= github.com/petermattis/goid v0.0.0-20220526132513-07eaf5d0b9f4/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= @@ -100,17 +164,29 @@ github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.8.1 h1:geMPLpDpQOgVyCg5z5GoRwLHepNdb71NXb67XFkP+Eg= github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o= +github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= +github.com/rs/zerolog v1.13.0/go.mod h1:YbFCdg8HfsridGWAh22vktObvhZbQsZXe4/zB0OKkWU= +github.com/rs/zerolog v1.15.0/go.mod h1:xYTKnLHcpfU2225ny5qZjxnj9NvkumZYjJHlAThCjNc= github.com/rvflash/elapsed v0.2.0 h1:zpMX24KJzo8jJaCI/6690Hb8tCEe5xtjAAjEgba0cns= github.com/rvflash/elapsed v0.2.0/go.mod h1:sgjohdXO66LHVgIEQpO92eQjDWyZ5twX1ow122ixFGY= github.com/sasha-s/go-deadlock v0.3.1 h1:sqv7fDNShgjcaxkO0JNcOAlr8B9+cV5Ey/OB71efZx0= github.com/sasha-s/go-deadlock v0.3.1/go.mod h1:F73l+cr82YSh10GxyRI6qZiCgK64VaZjwesgfQ1/iLM= +github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= github.com/schollz/progressbar/v3 v3.8.6 h1:QruMUdzZ1TbEP++S1m73OqRJk20ON11m6Wqv4EoGg8c= github.com/schollz/progressbar/v3 v3.8.6/go.mod h1:W5IEwbJecncFGBvuEh4A7HT1nZZ6WNIL2i3qbnI0WKY= +github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4= +github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= +github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sourcegraph/jsonrpc2 v0.1.0 h1:ohJHjZ+PcaLxDUjqk2NC3tIGsVa5bXThe1ZheSXOjuk= github.com/sourcegraph/jsonrpc2 v0.1.0/go.mod h1:ZafdZgk/axhT1cvZAPOhw+95nz2I/Ra5qMlU4gTRwIo= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= @@ -126,12 +202,37 @@ github.com/yuin/goldmark-meta v1.1.0/go.mod h1:U4spWENafuA7Zyg+Lj5RqK/MF+ovMYtBvXi1lBb2VP0= github.com/zchee/color/v2 v2.0.6 h1:+mD95jTXou3Bi8+ZWn3SOEDts36SNROILd9JId7VI9A= github.com/zchee/color/v2 v2.0.6/go.mod h1:mtte+U+f1/0xODbqR9J+TfcTjd86MMv6KNmpnC8MiXk= +github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q= +go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= +go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190411191339-88737f569e3a/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= +golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8= golang.org/x/crypto v0.0.0-20220131195533-30dcbda58838/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e h1:T8NU3HyQ8ClP4SEE+KbFlg6n0NhuTsN4MyznaarGsZM= golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190614084037-d442b75600c5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -140,18 +241,25 @@ golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a h1:dGzPydgVsqGcTRVwiLJ1jVbufYwmzD3LfVPLKsKg+0k= -golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f h1:v4INt8xihDGvnrfjMDVXGxw9wrfxYyCjk0KbXjhR55s= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210503060354-a79de5458b56/go.mod h1:tfny5GFUkzUvx4ps4ajbZsCe5lw1metzhBm9T3x7oIY= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.0.0-20220526004731-065cf7ba2467 h1:CBpWXWQpIRjzmkkA+M7q9Fqnwd2mZr3AFqexg8YTfoM= golang.org/x/term v0.0.0-20220526004731-065cf7ba2467/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= -golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.3.8 h1:nAL+RVCQ9uMn3vJZbV+MRnydTJFPf8qqY42YiA6MrqY= +golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190425163242-31fd60d6bfdc/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190823170909-c4a336ef6a2f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= @@ -159,6 +267,7 @@ gopkg.in/djherbis/times.v1 v1.3.0 h1:uxMS4iMtH6Pwsxog094W0FYldiNnfY/xba00vq6C2+o= gopkg.in/djherbis/times.v1 v1.3.0/go.mod h1:AQlg6unIsrsCEdQYhTzERy542dz6SFdQFZFv6mUY0P8= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/inconshreveable/log15.v2 v2.0.0-20180818164646-67afb5ed74ec/go.mod h1:aPpfJ7XW+gOuirDoZ8gHhLh3kZ1B08FtV2bbmy7Jv3s= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zk-0.13.0/internal/adapter/lsp/document.go new/zk-0.14.0/internal/adapter/lsp/document.go --- old/zk-0.13.0/internal/adapter/lsp/document.go 2023-02-13 08:23:21.000000000 +0100 +++ new/zk-0.14.0/internal/adapter/lsp/document.go 2023-05-20 15:05:27.000000000 +0200 @@ -5,6 +5,7 @@ "path/filepath" "regexp" "strings" + "unicode/utf16" "github.com/mickael-menu/zk/internal/core" "github.com/mickael-menu/zk/internal/util" @@ -131,30 +132,32 @@ // LookBehind returns the n characters before the given position, on the same line. func (d *document) LookBehind(pos protocol.Position, length int) string { line, ok := d.GetLine(int(pos.Line)) + utf16Bytes := utf16.Encode([]rune(line)) if !ok { return "" } charIdx := int(pos.Character) if length > charIdx { - return line[0:charIdx] + return string(utf16.Decode(utf16Bytes[0:charIdx])) } - return line[(charIdx - length):charIdx] + return string(utf16.Decode(utf16Bytes[(charIdx - length):charIdx])) } // LookForward returns the n characters after the given position, on the same line. func (d *document) LookForward(pos protocol.Position, length int) string { line, ok := d.GetLine(int(pos.Line)) + utf16Bytes := utf16.Encode([]rune(line)) if !ok { return "" } - lineLength := len(line) + lineLength := len(utf16Bytes) charIdx := int(pos.Character) if lineLength <= charIdx+length { - return line[charIdx:] + return string(utf16.Decode(utf16Bytes[charIdx:])) } - return line[charIdx:(charIdx + length)] + return string(utf16.Decode(utf16Bytes[charIdx:(charIdx + length)])) } var wikiLinkRegex = regexp.MustCompile(`\[?\[\[(.+?)(?: *\| *(.+?))?\]\]`) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zk-0.13.0/internal/cli/container.go new/zk-0.14.0/internal/cli/container.go --- old/zk-0.13.0/internal/cli/container.go 2023-02-13 08:23:21.000000000 +0100 +++ new/zk-0.14.0/internal/cli/container.go 2023-05-20 15:05:27.000000000 +0200 @@ -4,6 +4,7 @@ "io" "os" "path/filepath" + "strings" "github.com/mickael-menu/zk/internal/adapter/editor" "github.com/mickael-menu/zk/internal/adapter/fs" @@ -65,12 +66,32 @@ return nil, wrap(err) } if configPath != "" { - config, err = core.OpenConfig(configPath, config, fs) + config, err = core.OpenConfig(configPath, config, fs, true) if err != nil { return nil, wrap(err) } } + // Set the default notebook if not already set + // might be overrided if --notebook-dir flag is present + if osutil.GetOptEnv("ZK_NOTEBOOK_DIR").IsNull() && !config.Notebook.Dir.IsNull() { + // Expand in case there are environment variables on the path + notebookDir := os.Expand(config.Notebook.Dir.Unwrap(), os.Getenv) + if strings.HasPrefix(notebookDir, "~") { + dirname, err := os.UserHomeDir() + if err != nil { + return nil, wrap(err) + } + notebookDir = filepath.Join(dirname, notebookDir[1:]) + } + os.Setenv("ZK_NOTEBOOK_DIR", notebookDir) + } + + // Set the default shell if not already set + if osutil.GetOptEnv("ZK_SHELL").IsNull() && !config.Tool.Shell.IsEmpty() { + os.Setenv("ZK_SHELL", config.Tool.Shell.Unwrap()) + } + return &Container{ Version: version, Config: config, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zk-0.13.0/internal/core/config.go new/zk-0.14.0/internal/core/config.go --- old/zk-0.13.0/internal/core/config.go 2023-02-13 08:23:21.000000000 +0100 +++ new/zk-0.14.0/internal/core/config.go 2023-05-20 15:05:27.000000000 +0200 @@ -12,19 +12,23 @@ // Config holds the user configuration. type Config struct { - Note NoteConfig - Groups map[string]GroupConfig - Format FormatConfig - Tool ToolConfig - LSP LSPConfig - Filters map[string]string - Aliases map[string]string - Extra map[string]string + Notebook NotebookConfig + Note NoteConfig + Groups map[string]GroupConfig + Format FormatConfig + Tool ToolConfig + LSP LSPConfig + Filters map[string]string + Aliases map[string]string + Extra map[string]string } // NewDefaultConfig creates a new Config with the default settings. func NewDefaultConfig() Config { return Config{ + Notebook: NotebookConfig{ + Dir: opt.NullString, + }, Note: NoteConfig{ FilenameTemplate: "{{id}}", Extension: "md", @@ -36,7 +40,7 @@ Length: 4, Case: CaseLower, }, - Ignore: []string{}, + Exclude: []string{}, }, Groups: map[string]GroupConfig{}, Format: FormatConfig{ @@ -148,6 +152,7 @@ // ToolConfig holds the external tooling configuration. type ToolConfig struct { Editor opt.String + Shell opt.String Pager opt.String FzfPreview opt.String FzfLine opt.String @@ -191,6 +196,11 @@ LSPDiagnosticHint LSPDiagnosticSeverity = 4 ) +// NotebookConfig holds configuration about the default notebook +type NotebookConfig struct { + Dir opt.String +} + // NoteConfig holds the user configuration used when generating new notes. type NoteConfig struct { // Handlebars template used when generating a new filename. @@ -206,7 +216,7 @@ // Settings used when generating a random ID. IDOptions IDOptions // Path globs to ignore when indexing notes. - Ignore []string + Exclude []string } // GroupConfig holds the user configuration for a given group of notes. @@ -216,16 +226,16 @@ Extra map[string]string } -// IgnoreGlobs returns all the Note.Ignore path globs for the group paths, +// ExcludeGlobs returns all the Note.Exclude path globs for the group paths, // relative to the root of the notebook. -func (c GroupConfig) IgnoreGlobs() []string { +func (c GroupConfig) ExcludeGlobs() []string { if len(c.Paths) == 0 { - return c.Note.Ignore + return c.Note.Exclude } globs := []string{} for _, p := range c.Paths { - for _, g := range c.Note.Ignore { + for _, g := range c.Note.Exclude { globs = append(globs, filepath.Join(p, g)) } } @@ -248,7 +258,7 @@ // OpenConfig creates a new Config instance from its TOML representation stored // in the given file. -func OpenConfig(path string, parentConfig Config, fs FileStorage) (Config, error) { +func OpenConfig(path string, parentConfig Config, fs FileStorage, isGlobal bool) (Config, error) { // The local config is optional. exists, err := fs.FileExists(path) if err == nil && !exists { @@ -260,7 +270,7 @@ return parentConfig, errors.Wrapf(err, "failed to open config file at %s", path) } - return ParseConfig(content, path, parentConfig) + return ParseConfig(content, path, parentConfig, isGlobal) } // ParseConfig creates a new Config instance from its TOML representation. @@ -268,7 +278,7 @@ // for templates. // // The parentConfig will be used to inherit default config settings. -func ParseConfig(content []byte, path string, parentConfig Config) (Config, error) { +func ParseConfig(content []byte, path string, parentConfig Config, isGlobal bool) (Config, error) { wrap := errors.Wrapperf("failed to read config") config := parentConfig @@ -279,6 +289,16 @@ return config, wrap(err) } + // Notebook + notebook := tomlConf.Notebook + if notebook.Dir != "" { + if isGlobal { + config.Notebook.Dir = opt.NewNotEmptyString(notebook.Dir) + } else { + return config, wrap(errors.New("notebook.dir should not be set on local configuration")) + } + } + // Note note := tomlConf.Note if note.Filename != "" { @@ -305,8 +325,11 @@ if note.DefaultTitle != "" { config.Note.DefaultTitle = note.DefaultTitle } + for _, v := range note.Exclude { + config.Note.Exclude = append(config.Note.Exclude, v) + } for _, v := range note.Ignore { - config.Note.Ignore = append(config.Note.Ignore, v) + config.Note.Exclude = append(config.Note.Exclude, v) } if tomlConf.Extra != nil { for k, v := range tomlConf.Extra { @@ -355,6 +378,9 @@ if tool.Editor != nil { config.Tool.Editor = opt.NewNotEmptyString(*tool.Editor) } + if tool.Shell != nil { + config.Tool.Shell = opt.NewNotEmptyString(*tool.Shell) + } if tool.Pager != nil { config.Tool.Pager = opt.NewStringWithPtr(tool.Pager) } @@ -454,8 +480,11 @@ if note.DefaultTitle != "" { res.Note.DefaultTitle = note.DefaultTitle } + for _, v := range note.Exclude { + res.Note.Exclude = append(res.Note.Exclude, v) + } for _, v := range note.Ignore { - res.Note.Ignore = append(res.Note.Ignore, v) + res.Note.Exclude = append(res.Note.Exclude, v) } if tomlConf.Extra != nil { for k, v := range tomlConf.Extra { @@ -468,14 +497,19 @@ // tomlConfig holds the TOML representation of Config type tomlConfig struct { - Note tomlNoteConfig - Groups map[string]tomlGroupConfig `toml:"group"` - Format tomlFormatConfig - Tool tomlToolConfig - LSP tomlLSPConfig - Extra map[string]string - Filters map[string]string `toml:"filter"` - Aliases map[string]string `toml:"alias"` + Notebook tomlNotebookConfig + Note tomlNoteConfig + Groups map[string]tomlGroupConfig `toml:"group"` + Format tomlFormatConfig + Tool tomlToolConfig + LSP tomlLSPConfig + Extra map[string]string + Filters map[string]string `toml:"filter"` + Aliases map[string]string `toml:"alias"` +} + +type tomlNotebookConfig struct { + Dir string } type tomlNoteConfig struct { @@ -487,7 +521,8 @@ IDCharset string `toml:"id-charset"` IDLength int `toml:"id-length"` IDCase string `toml:"id-case"` - Ignore []string `toml:"ignore"` + Exclude []string `toml:"exclude"` + Ignore []string `toml:"ignore"` // Legacy alias to `exclude` } type tomlGroupConfig struct { @@ -511,6 +546,7 @@ type tomlToolConfig struct { Editor *string + Shell *string Pager *string FzfPreview *string `toml:"fzf-preview"` FzfLine *string `toml:"fzf-line"` diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zk-0.13.0/internal/core/config_test.go new/zk-0.14.0/internal/core/config_test.go --- old/zk-0.13.0/internal/core/config_test.go 2023-02-13 08:23:21.000000000 +0100 +++ new/zk-0.14.0/internal/core/config_test.go 2023-05-20 15:05:27.000000000 +0200 @@ -10,10 +10,13 @@ ) func TestParseDefaultConfig(t *testing.T) { - conf, err := ParseConfig([]byte(""), ".zk/config.toml", NewDefaultConfig()) + conf, err := ParseConfig([]byte(""), ".zk/config.toml", NewDefaultConfig(), true) assert.Nil(t, err) assert.Equal(t, conf, Config{ + Notebook: NotebookConfig{ + Dir: opt.NullString, + }, Note: NoteConfig{ FilenameTemplate: "{{id}}", Extension: "md", @@ -25,7 +28,7 @@ }, DefaultTitle: "Untitled", Lang: "en", - Ignore: []string{}, + Exclude: []string{}, }, Groups: make(map[string]GroupConfig), Format: FormatConfig{ @@ -40,6 +43,7 @@ }, Tool: ToolConfig{ Editor: opt.NullString, + Shell: opt.NullString, Pager: opt.NullString, FzfPreview: opt.NullString, FzfLine: opt.NullString, @@ -57,7 +61,7 @@ } func TestParseInvalidConfig(t *testing.T) { - _, err := ParseConfig([]byte(`;`), ".zk/config.toml", NewDefaultConfig()) + _, err := ParseConfig([]byte(`;`), ".zk/config.toml", NewDefaultConfig(), false) assert.NotNil(t, err) } @@ -65,6 +69,9 @@ conf, err := ParseConfig([]byte(` # Comment + [notebook] + dir = "~/notebook" + [note] filename = "{{id}}.note" extension = "txt" @@ -74,7 +81,7 @@ id-charset = "alphanum" id-length = 4 id-case = "lower" - ignore = ["ignored", ".git"] + exclude = ["ignored", ".git"] [format.markdown] hashtags = false @@ -86,6 +93,7 @@ [tool] editor = "vim" + shell = "/bin/bash" pager = "less" fzf-preview = "bat {1}" fzf-line = "{{title}}" @@ -116,7 +124,7 @@ id-charset = "letters" id-length = 8 id-case = "mixed" - ignore = ["new-ignored"] + exclude = ["new-ignored"] [group.log.extra] log-ext = "value" @@ -136,10 +144,13 @@ [lsp.diagnostics] wiki-title = "hint" dead-link = "none" - `), ".zk/config.toml", NewDefaultConfig()) + `), ".zk/config.toml", NewDefaultConfig(), true) assert.Nil(t, err) assert.Equal(t, conf, Config{ + Notebook: NotebookConfig{ + Dir: opt.NewString("~/notebook"), + }, Note: NoteConfig{ FilenameTemplate: "{{id}}.note", Extension: "txt", @@ -151,7 +162,7 @@ }, Lang: "fr", DefaultTitle: "Sans titre", - Ignore: []string{"ignored", ".git"}, + Exclude: []string{"ignored", ".git"}, }, Groups: map[string]GroupConfig{ "log": { @@ -167,7 +178,7 @@ }, Lang: "de", DefaultTitle: "Ohne Titel", - Ignore: []string{"ignored", ".git", "new-ignored"}, + Exclude: []string{"ignored", ".git", "new-ignored"}, }, Extra: map[string]string{ "hello": "world", @@ -188,7 +199,7 @@ }, Lang: "fr", DefaultTitle: "Sans titre", - Ignore: []string{"ignored", ".git"}, + Exclude: []string{"ignored", ".git"}, }, Extra: map[string]string{ "hello": "world", @@ -208,7 +219,7 @@ }, Lang: "fr", DefaultTitle: "Sans titre", - Ignore: []string{"ignored", ".git"}, + Exclude: []string{"ignored", ".git"}, }, Extra: map[string]string{ "hello": "world", @@ -228,6 +239,7 @@ }, Tool: ToolConfig{ Editor: opt.NewString("vim"), + Shell: opt.NewString("/bin/bash"), Pager: opt.NewString("less"), FzfPreview: opt.NewString("bat {1}"), FzfLine: opt.NewString("{{title}}"), @@ -274,7 +286,7 @@ id-charset = "letters" id-length = 42 id-case = "upper" - ignore = ["ignored", ".git"] + exclude = ["ignored", ".git"] [extra] hello = "world" @@ -292,7 +304,7 @@ log-ext = "value" [group.inherited] - `), ".zk/config.toml", NewDefaultConfig()) + `), ".zk/config.toml", NewDefaultConfig(), false) assert.Nil(t, err) assert.Equal(t, conf, Config{ @@ -307,7 +319,7 @@ }, Lang: "fr", DefaultTitle: "Sans titre", - Ignore: []string{"ignored", ".git"}, + Exclude: []string{"ignored", ".git"}, }, Groups: map[string]GroupConfig{ "log": { @@ -323,7 +335,7 @@ }, Lang: "fr", DefaultTitle: "Sans titre", - Ignore: []string{"ignored", ".git"}, + Exclude: []string{"ignored", ".git"}, }, Extra: map[string]string{ "hello": "override", @@ -344,7 +356,7 @@ }, Lang: "fr", DefaultTitle: "Sans titre", - Ignore: []string{"ignored", ".git"}, + Exclude: []string{"ignored", ".git"}, }, Extra: map[string]string{ "hello": "world", @@ -391,7 +403,7 @@ [tool] pager = "" fzf-preview = "" - `), ".zk/config.toml", NewDefaultConfig()) + `), ".zk/config.toml", NewDefaultConfig(), false) assert.Nil(t, err) assert.Equal(t, conf.Tool.Pager.IsNull(), false) @@ -400,13 +412,29 @@ assert.Equal(t, conf.Tool.FzfPreview, opt.NewString("")) } +func TestParseNotebook(t *testing.T) { + toml := ` + [notebook] + dir = "/home/user/folder" + ` + // Should parse notebook if isGlobal == true + conf, err := ParseConfig([]byte(toml), ".zk/config.toml", NewDefaultConfig(), true) + assert.Nil(t, err) + assert.Equal(t, conf.Notebook.Dir, opt.NewString("/home/user/folder")) + + // Should not parse notebook if isGlobal == false + conf, err = ParseConfig([]byte(toml), ".zk/config.toml", NewDefaultConfig(), false) + assert.NotNil(t, err) + assert.Err(t, err, "notebook.dir should not be set on local configuration") +} + func TestParseIDCharset(t *testing.T) { test := func(charset string, expected Charset) { toml := fmt.Sprintf(` [note] id-charset = "%v" `, charset) - conf, err := ParseConfig([]byte(toml), ".zk/config.toml", NewDefaultConfig()) + conf, err := ParseConfig([]byte(toml), ".zk/config.toml", NewDefaultConfig(), false) assert.Nil(t, err) if !cmp.Equal(conf.Note.IDOptions.Charset, expected) { t.Errorf("Didn't parse ID charset `%v` as expected", charset) @@ -427,7 +455,7 @@ [note] id-case = "%v" `, letterCase) - conf, err := ParseConfig([]byte(toml), ".zk/config.toml", NewDefaultConfig()) + conf, err := ParseConfig([]byte(toml), ".zk/config.toml", NewDefaultConfig(), false) assert.Nil(t, err) if !cmp.Equal(conf.Note.IDOptions.Case, expected) { t.Errorf("Didn't parse ID case `%v` as expected", letterCase) @@ -448,7 +476,7 @@ [format.markdown] link-format = "%s" `, format) - conf, err := ParseConfig([]byte(toml), ".zk/config.toml", NewDefaultConfig()) + conf, err := ParseConfig([]byte(toml), ".zk/config.toml", NewDefaultConfig(), false) assert.Nil(t, err) assert.Equal(t, conf.Format.Markdown.LinkEncodePath, expected) } @@ -466,7 +494,7 @@ wiki-title = "%s" dead-link = "%s" `, value, value) - conf, err := ParseConfig([]byte(toml), ".zk/config.toml", NewDefaultConfig()) + conf, err := ParseConfig([]byte(toml), ".zk/config.toml", NewDefaultConfig(), false) assert.Nil(t, err) assert.Equal(t, conf.LSP.Diagnostics.WikiTitle, expected) assert.Equal(t, conf.LSP.Diagnostics.DeadLink, expected) @@ -483,35 +511,35 @@ [lsp.diagnostics] wiki-title = "foobar" ` - _, err := ParseConfig([]byte(toml), ".zk/config.toml", NewDefaultConfig()) + _, err := ParseConfig([]byte(toml), ".zk/config.toml", NewDefaultConfig(), false) assert.Err(t, err, "foobar: unknown LSP diagnostic severity - may be none, hint, info, warning or error") } -func TestGroupConfigIgnoreGlobs(t *testing.T) { +func TestGroupConfigExcludeGlobs(t *testing.T) { // empty globs config := GroupConfig{ Paths: []string{"path"}, - Note: NoteConfig{Ignore: []string{}}, + Note: NoteConfig{Exclude: []string{}}, } - assert.Equal(t, config.IgnoreGlobs(), []string{}) + assert.Equal(t, config.ExcludeGlobs(), []string{}) // empty paths config = GroupConfig{ Paths: []string{}, Note: NoteConfig{ - Ignore: []string{"ignored", ".git"}, + Exclude: []string{"ignored", ".git"}, }, } - assert.Equal(t, config.IgnoreGlobs(), []string{"ignored", ".git"}) + assert.Equal(t, config.ExcludeGlobs(), []string{"ignored", ".git"}) // several paths config = GroupConfig{ Paths: []string{"log", "drafts"}, Note: NoteConfig{ - Ignore: []string{"ignored", "*.git"}, + Exclude: []string{"ignored", "*.git"}, }, } - assert.Equal(t, config.IgnoreGlobs(), []string{"log/ignored", "log/*.git", "drafts/ignored", "drafts/*.git"}) + assert.Equal(t, config.ExcludeGlobs(), []string{"log/ignored", "log/*.git", "drafts/ignored", "drafts/*.git"}) } func TestGroupConfigClone(t *testing.T) { @@ -528,7 +556,7 @@ }, Lang: "fr", DefaultTitle: "Sans titre", - Ignore: []string{"ignored", ".git"}, + Exclude: []string{"ignored", ".git"}, }, Extra: map[string]string{ "hello": "world", @@ -548,7 +576,7 @@ clone.Note.IDOptions.Case = CaseUpper clone.Note.Lang = "de" clone.Note.DefaultTitle = "Ohne Titel" - clone.Note.Ignore = []string{"other-ignored"} + clone.Note.Exclude = []string{"other-ignored"} clone.Extra["test"] = "modified" // Check that we didn't modify the original @@ -565,7 +593,7 @@ }, Lang: "fr", DefaultTitle: "Sans titre", - Ignore: []string{"ignored", ".git"}, + Exclude: []string{"ignored", ".git"}, }, Extra: map[string]string{ "hello": "world", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zk-0.13.0/internal/core/note_index.go new/zk-0.14.0/internal/core/note_index.go --- old/zk-0.13.0/internal/core/note_index.go 2023-02-13 08:23:21.000000000 +0100 +++ new/zk-0.14.0/internal/core/note_index.go 2023-05-20 15:05:27.000000000 +0200 @@ -136,13 +136,13 @@ return true, nil } - for _, ignoreGlob := range group.IgnoreGlobs() { + for _, ignoreGlob := range group.ExcludeGlobs() { matches, err := doublestar.PathMatch(ignoreGlob, path) if err != nil { - return true, errors.Wrapf(err, "failed to match ignore glob %s to %s", ignoreGlob, path) + return true, errors.Wrapf(err, "failed to match exclude glob %s to %s", ignoreGlob, path) } if matches { - notifyIgnored("matched ignore glob \"" + ignoreGlob + "\"") + notifyIgnored("matched exclude glob \"" + ignoreGlob + "\"") return true, nil } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zk-0.13.0/internal/core/notebook_store.go new/zk-0.14.0/internal/core/notebook_store.go --- old/zk-0.13.0/internal/core/notebook_store.go 2023-02-13 08:23:21.000000000 +0100 +++ new/zk-0.14.0/internal/core/notebook_store.go 2023-05-20 15:05:27.000000000 +0200 @@ -64,7 +64,7 @@ } configPath := filepath.Join(path, ".zk/config.toml") - config, err := OpenConfig(configPath, ns.config, ns.fs) + config, err := OpenConfig(configPath, ns.config, ns.fs, false) if err != nil { return nil, wrap(err) } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zk-0.13.0/internal/util/os/os.go new/zk-0.14.0/internal/util/os/os.go --- old/zk-0.13.0/internal/util/os/os.go 2023-02-13 08:23:21.000000000 +0100 +++ new/zk-0.14.0/internal/util/os/os.go 2023-05-20 15:05:27.000000000 +0200 @@ -10,7 +10,10 @@ // Getenv returns an optional String for the environment variable with given // key. func GetOptEnv(key string) opt.String { - return opt.NewNotEmptyString(os.Getenv(key)) + if value, ok := os.LookupEnv(key); ok { + return opt.NewNotEmptyString(value) + } + return opt.NullString } // Env returns a map of environment variables. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zk-0.13.0/tests/cmd-index-legacy-ignore.tesh new/zk-0.14.0/tests/cmd-index-legacy-ignore.tesh --- old/zk-0.13.0/tests/cmd-index-legacy-ignore.tesh 1970-01-01 01:00:00.000000000 +0100 +++ new/zk-0.14.0/tests/cmd-index-legacy-ignore.tesh 2023-05-20 15:05:27.000000000 +0200 @@ -0,0 +1,15 @@ +$ cd legacy-ignore + +# Index initial notes. +$ zk index +>Indexed 3 notes in 0s +> + 3 added +> ~ 0 modified +> - 0 removed + +# Ignore path patterns. +$ touch carrot-ignored/ananas.md && zk index +>Indexed 3 notes in 0s +> + 0 added +> ~ 0 modified +> - 0 removed diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zk-0.13.0/tests/cmd-index.tesh new/zk-0.14.0/tests/cmd-index.tesh --- old/zk-0.13.0/tests/cmd-index.tesh 2023-02-13 08:23:21.000000000 +0100 +++ new/zk-0.14.0/tests/cmd-index.tesh 2023-05-20 15:05:27.000000000 +0200 @@ -99,8 +99,8 @@ >- removed eggplant/apple.md >- unchanged eggplant/clementine.md >- modified litchee.md ->- ignored carrot-ignored/ananas.md: matched ignore glob "carrot-ignored/*" ->- ignored carrot-ignored/tomato.md: matched ignore glob "carrot-ignored/*" +>- ignored carrot-ignored/ananas.md: matched exclude glob "carrot-ignored/*" +>- ignored carrot-ignored/tomato.md: matched exclude glob "carrot-ignored/*" >- ignored orange.markdown: expected extension "md" > >Indexed 3 notes in 0s @@ -113,8 +113,8 @@ >- unchanged banana.md >- unchanged eggplant/clementine.md >- unchanged litchee.md ->- ignored carrot-ignored/ananas.md: matched ignore glob "carrot-ignored/*" ->- ignored carrot-ignored/tomato.md: matched ignore glob "carrot-ignored/*" +>- ignored carrot-ignored/ananas.md: matched exclude glob "carrot-ignored/*" +>- ignored carrot-ignored/tomato.md: matched exclude glob "carrot-ignored/*" >- ignored orange.markdown: expected extension "md" > >Indexed 3 notes in 0s diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zk-0.13.0/tests/config-note-exclude.tesh new/zk-0.14.0/tests/config-note-exclude.tesh --- old/zk-0.13.0/tests/config-note-exclude.tesh 1970-01-01 01:00:00.000000000 +0100 +++ new/zk-0.14.0/tests/config-note-exclude.tesh 2023-05-20 15:05:27.000000000 +0200 @@ -0,0 +1,49 @@ +$ cd blank + +$ mkdir dir +$ mkdir dir/subdir +$ touch banana.md +$ touch orange.md +$ touch dir/orange.md +$ touch dir/subdir/apple.md + +# Ignore a file in the root directory. +$ echo "[note]\n exclude = ['orange.md']" > .zk/config.toml +$ zk index -v +>- added banana.md +>- added dir/orange.md +>- added dir/subdir/apple.md +>- ignored orange.md: matched exclude glob "orange.md" +> +>Indexed 3 notes in 0s +> + 3 added +> ~ 0 modified +> - 0 removed + +# Ignore with wildcards. +$ echo "[note]\n exclude = ['*rang*', 'dir/*']" > .zk/config.toml +$ zk index -v +>- unchanged banana.md +>- removed dir/orange.md +>- unchanged dir/subdir/apple.md +>- ignored dir/orange.md: matched exclude glob "dir/*" +>- ignored orange.md: matched exclude glob "*rang*" +> +>Indexed 2 notes in 0s +> + 0 added +> ~ 0 modified +> - 1 removed + +# Unignore all files. +$ echo "" > .zk/config.toml +$ zk index -v +>- unchanged banana.md +>- added dir/orange.md +>- unchanged dir/subdir/apple.md +>- added orange.md +> +>Indexed 4 notes in 0s +> + 2 added +> ~ 0 modified +> - 0 removed + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zk-0.13.0/tests/config-note-ignore.tesh new/zk-0.14.0/tests/config-note-ignore.tesh --- old/zk-0.13.0/tests/config-note-ignore.tesh 2023-02-13 08:23:21.000000000 +0100 +++ new/zk-0.14.0/tests/config-note-ignore.tesh 1970-01-01 01:00:00.000000000 +0100 @@ -1,49 +0,0 @@ -$ cd blank - -$ mkdir dir -$ mkdir dir/subdir -$ touch banana.md -$ touch orange.md -$ touch dir/orange.md -$ touch dir/subdir/apple.md - -# Ignore a file in the root directory. -$ echo "[note]\n ignore = ['orange.md']" > .zk/config.toml -$ zk index -v ->- added banana.md ->- added dir/orange.md ->- added dir/subdir/apple.md ->- ignored orange.md: matched ignore glob "orange.md" -> ->Indexed 3 notes in 0s -> + 3 added -> ~ 0 modified -> - 0 removed - -# Ignore with wildcards. -$ echo "[note]\n ignore = ['*rang*', 'dir/*']" > .zk/config.toml -$ zk index -v ->- unchanged banana.md ->- removed dir/orange.md ->- unchanged dir/subdir/apple.md ->- ignored dir/orange.md: matched ignore glob "dir/*" ->- ignored orange.md: matched ignore glob "*rang*" -> ->Indexed 2 notes in 0s -> + 0 added -> ~ 0 modified -> - 1 removed - -# Unignore all files. -$ echo "" > .zk/config.toml -$ zk index -v ->- unchanged banana.md ->- added dir/orange.md ->- unchanged dir/subdir/apple.md ->- added orange.md -> ->Indexed 4 notes in 0s -> + 2 added -> ~ 0 modified -> - 0 removed - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zk-0.13.0/tests/fixtures/index/.zk/config.toml new/zk-0.14.0/tests/fixtures/index/.zk/config.toml --- old/zk-0.13.0/tests/fixtures/index/.zk/config.toml 2023-02-13 08:23:21.000000000 +0100 +++ new/zk-0.14.0/tests/fixtures/index/.zk/config.toml 2023-05-20 15:05:27.000000000 +0200 @@ -1,4 +1,4 @@ [note] -ignore = [ +exclude = [ "carrot-ignored/*", ] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zk-0.13.0/tests/fixtures/legacy-ignore/.zk/config.toml new/zk-0.14.0/tests/fixtures/legacy-ignore/.zk/config.toml --- old/zk-0.13.0/tests/fixtures/legacy-ignore/.zk/config.toml 1970-01-01 01:00:00.000000000 +0100 +++ new/zk-0.14.0/tests/fixtures/legacy-ignore/.zk/config.toml 2023-05-20 15:05:27.000000000 +0200 @@ -0,0 +1,4 @@ +[note] +ignore = [ + "carrot-ignored/*", +] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zk-0.13.0/tests/fixtures/legacy-ignore/banana.md new/zk-0.14.0/tests/fixtures/legacy-ignore/banana.md --- old/zk-0.13.0/tests/fixtures/legacy-ignore/banana.md 1970-01-01 01:00:00.000000000 +0100 +++ new/zk-0.14.0/tests/fixtures/legacy-ignore/banana.md 2023-05-20 15:05:27.000000000 +0200 @@ -0,0 +1,3 @@ +# Banana + +Content of banana diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zk-0.13.0/tests/fixtures/legacy-ignore/carrot-ignored/tomato.md new/zk-0.14.0/tests/fixtures/legacy-ignore/carrot-ignored/tomato.md --- old/zk-0.13.0/tests/fixtures/legacy-ignore/carrot-ignored/tomato.md 1970-01-01 01:00:00.000000000 +0100 +++ new/zk-0.14.0/tests/fixtures/legacy-ignore/carrot-ignored/tomato.md 2023-05-20 15:05:27.000000000 +0200 @@ -0,0 +1,3 @@ +# Tomato + +Content of tomato diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zk-0.13.0/tests/fixtures/legacy-ignore/eggplant/clementine.md new/zk-0.14.0/tests/fixtures/legacy-ignore/eggplant/clementine.md --- old/zk-0.13.0/tests/fixtures/legacy-ignore/eggplant/clementine.md 1970-01-01 01:00:00.000000000 +0100 +++ new/zk-0.14.0/tests/fixtures/legacy-ignore/eggplant/clementine.md 2023-05-20 15:05:27.000000000 +0200 @@ -0,0 +1,3 @@ +# Clementine + +Content of clementine diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zk-0.13.0/tests/fixtures/legacy-ignore/litchee.md new/zk-0.14.0/tests/fixtures/legacy-ignore/litchee.md --- old/zk-0.13.0/tests/fixtures/legacy-ignore/litchee.md 1970-01-01 01:00:00.000000000 +0100 +++ new/zk-0.14.0/tests/fixtures/legacy-ignore/litchee.md 2023-05-20 15:05:27.000000000 +0200 @@ -0,0 +1,3 @@ +# Litchee + +Content of litchee diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zk-0.13.0/tests/issue-173.tesh new/zk-0.14.0/tests/issue-173.tesh --- old/zk-0.13.0/tests/issue-173.tesh 2023-02-13 08:23:21.000000000 +0100 +++ new/zk-0.14.0/tests/issue-173.tesh 2023-05-20 15:05:27.000000000 +0200 @@ -3,7 +3,7 @@ $ cd blank -$ echo "[note]\n ignore = ['drafts/**']" > .zk/config.toml +$ echo "[note]\n exclude = ['drafts/**']" > .zk/config.toml $ mkdir -p drafts/subdir/subdir $ echo "# This is not ignored" > not-ignored.md
